fast-check
Version:
Property based testing framework for JavaScript (like QuickCheck)
15 lines (14 loc) • 606 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.set = set;
const uniqueArray_1 = require("./uniqueArray");
const ArrayToSet_1 = require("./_internals/mappers/ArrayToSet");
/**@__NO_SIDE_EFFECTS__*/function set(arb, constraints = {}) {
return (0, uniqueArray_1.uniqueArray)(arb, {
minLength: constraints.minLength,
maxLength: constraints.maxLength,
size: constraints.size,
depthIdentifier: constraints.depthIdentifier,
comparator: 'SameValueZero',
}).map(ArrayToSet_1.arrayToSetMapper, ArrayToSet_1.arrayToSetUnmapper);
}