import { DerivedFunction , DERIVE_FUNCTION_KEY } from "./derive" ; import { Factory , AttributeFunction , FACTORY_FUNCTION_KEY } from "./define" ; import { ARRAY_FACTORY_KEY , ArrayFactoryPassThrough } from "./array" ; function isDerivedFunction < Base , Output > ( fn ) { return fn && fn . __cooky_cutter === DERIVE_FUNCTION_KEY ; } function isFactoryFunction < Base > ( fn ) { return fn && fn . __cooky_cutter === FACTORY_FUNCTION_KEY ; } function isArrayFactoryFunction < Base > ( fn ) { return fn && fn . __cooky_cutter === ARRAY_FACTORY_KEY ; } function isAttributeFunction < T > ( fn ) { return fn && { } . toString . call ( fn ) === "[object Function]" ; } type Keys < T > = keyof T ; type Diff < T , U > = T extends U ? never : T ; type DiffProperties < T , U > = Pick < T , Diff < Keys < T > , Keys < U > > > ; export type ArrayElement < ArrayType > = ArrayType extends ReadonlyArray < infer ElementType > ? ElementType : never ; export { isAttributeFunction , isDerivedFunction , isFactoryFunction , isArrayFactoryFunction , DiffProperties , } ;