import { Factory , FactoryConfig } from "./define" ; export type ArrayFactory < T > = ( override ? : FactoryConfig < T > ) => T [ ] ; export type ArrayFactoryPassThrough < T > = ( override ? : FactoryConfig < T > ) => T ; export const ARRAY_FACTORY_KEY = "arrayFactory" ; param factory param size export function array < Result > ( factory , size = 5 ) { const arrayFactory = ( override ? ) => { const arr = [ ] ; for ( let i = 0 ; i < size ; i ++ ) { arr . push ( factory ( override ) ) ; } return arr ; } ; arrayFactory . __cooky_cutter = ARRAY_FACTORY_KEY as typeof ARRAY_FACTORY_KEY ; return arrayFactory ; }