campus-errand/miniapp/node_modules/fast-check/lib/arbitrary/set.js
2026-03-01 05:01:47 +08:00

12 lines
498 B
JavaScript

import { uniqueArray } from './uniqueArray.js';
import { arrayToSetMapper, arrayToSetUnmapper } from './_internals/mappers/ArrayToSet.js';
export /**@__NO_SIDE_EFFECTS__*/function set(arb, constraints = {}) {
return uniqueArray(arb, {
minLength: constraints.minLength,
maxLength: constraints.maxLength,
size: constraints.size,
depthIdentifier: constraints.depthIdentifier,
comparator: 'SameValueZero',
}).map(arrayToSetMapper, arrayToSetUnmapper);
}