import { ConstructorFunction, FunctionCallLookup, IMocked, LookupType } from '../mock/index.js'; export function getLookup, U extends LookupType>( mock: IMocked, lookupType: U, ): FunctionCallLookup { switch (lookupType) { case 'constructorFunction': return mock.constructorCallLookup as FunctionCallLookup; case 'function': return mock.functionCallLookup as FunctionCallLookup; case 'getter': return mock.getterCallLookup as FunctionCallLookup; case 'setter': return mock.setterCallLookup as FunctionCallLookup; case 'staticFunction': return mock.staticFunctionCallLookup as FunctionCallLookup; case 'staticGetter': return mock.staticGetterCallLookup as FunctionCallLookup; case 'staticSetter': return mock.staticSetterCallLookup as FunctionCallLookup; } throw new Error(`Unknown lookup type: ${lookupType}`); }