Creates an array with length elements, in such a way that the output's type
includes the length of the array. This function is equivalent to:
Array.from({length}, (_, i) =>init(i)) asT[] & { length: L }
but less verbose.
This can be used to create arrays matching constructor types, for example:
constt = awaitnexus.createTransaction() constrasselbock = t.create("rasselbock", { // requires an array of 32 elements patterns:createArray(32, () => ({ // requires an array of 7 elements effectOrder:createArray(7, (i) =>i), })), })
Creates an array with
lengthelements, in such a way that the output's type includes the length of the array. This function is equivalent to:but less verbose.
This can be used to create arrays matching constructor types, for example: