Initial commit
This commit is contained in:
commit
b3a51a4115
10336 changed files with 2381973 additions and 0 deletions
16
node_modules/fast-check/lib/esm/check/property/Property.js
generated
vendored
Normal file
16
node_modules/fast-check/lib/esm/check/property/Property.js
generated
vendored
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import { assertIsArbitrary } from '../arbitrary/definition/Arbitrary.js';
|
||||
import { tuple } from '../../arbitrary/tuple.js';
|
||||
import { Property } from './Property.generic.js';
|
||||
import { AlwaysShrinkableArbitrary } from '../../arbitrary/_internals/AlwaysShrinkableArbitrary.js';
|
||||
import { safeForEach, safeMap, safeSlice } from '../../utils/globals.js';
|
||||
function property(...args) {
|
||||
if (args.length < 2) {
|
||||
throw new Error('property 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 Property(tuple(...mappedArbs), (t) => p(...t));
|
||||
}
|
||||
export { property };
|
||||
Loading…
Add table
Add a link
Reference in a new issue