Erster Docker-Stand
This commit is contained in:
16
_node_modules/fast-check/lib/esm/check/property/AsyncProperty.js
generated
Normal file
16
_node_modules/fast-check/lib/esm/check/property/AsyncProperty.js
generated
Normal file
@@ -0,0 +1,16 @@
|
||||
import { assertIsArbitrary } from '../arbitrary/definition/Arbitrary.js';
|
||||
import { tuple } from '../../arbitrary/tuple.js';
|
||||
import { AsyncProperty } from './AsyncProperty.generic.js';
|
||||
import { AlwaysShrinkableArbitrary } from '../../arbitrary/_internals/AlwaysShrinkableArbitrary.js';
|
||||
import { safeForEach, safeMap, safeSlice } from '../../utils/globals.js';
|
||||
function asyncProperty(...args) {
|
||||
if (args.length < 2) {
|
||||
throw new Error('asyncProperty expects at least two parameters');
|
||||
}
|
||||
const arbs = safeSlice(args, 0, args.length - 1);
|
||||
const p = args[args.length - 1];
|
||||
safeForEach(arbs, assertIsArbitrary);
|
||||
const mappedArbs = safeMap(arbs, (arb) => new AlwaysShrinkableArbitrary(arb));
|
||||
return new AsyncProperty(tuple(...mappedArbs), (t) => p(...t));
|
||||
}
|
||||
export { asyncProperty };
|
||||
Reference in New Issue
Block a user