git.delta.rocks / unique-network / refs/commits / 9d232ae806cb

difftreelog

test evm token properties

Yaroslav Bolyukin2022-05-17parent: #e6b5895.patch.diff
in: master

3 files changed

modifiedtests/src/eth/collectionProperties.test.tsdiffbeforeafterboth

no syntactic changes

addedtests/src/eth/tokenProperties.test.tsdiffbeforeafterboth

no changes

modifiedtests/src/eth/util/helpers.tsdiffbeforeafterboth
323 return before - after;323 return before - after;
324}324}
325325
326type ElementOf<A> = A extends readonly (infer T)[] ? T : never;
327// I want a fancier api, not a memory efficiency
328export function* cartesian<T extends Array<Array<any>>, R extends Array<any>>(internalRest: [...R], ...args: [...T]): Generator<[...R, ...{[K in keyof T]: ElementOf<T[K]>}]> {
329 if(args.length === 0) {
330 yield internalRest as any;
331 return;
332 }
333 for(const value of args[0]) {
334 yield* cartesian([...internalRest, value], ...args.slice(1)) as any;
335 }
336}