Добавлена ДБ
This commit is contained in:
16
node_modules/fast-check/lib/arbitrary/_internals/mappers/ArrayToSet.js
generated
vendored
Normal file
16
node_modules/fast-check/lib/arbitrary/_internals/mappers/ArrayToSet.js
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.arrayToSetMapper = arrayToSetMapper;
|
||||
exports.arrayToSetUnmapper = arrayToSetUnmapper;
|
||||
function arrayToSetMapper(data) {
|
||||
return new Set(data);
|
||||
}
|
||||
function arrayToSetUnmapper(value) {
|
||||
if (typeof value !== 'object' || value === null) {
|
||||
throw new Error('Incompatible instance received: should be a non-null object');
|
||||
}
|
||||
if (!('constructor' in value) || value.constructor !== Set) {
|
||||
throw new Error('Incompatible instance received: should be of exact type Set');
|
||||
}
|
||||
return Array.from(value);
|
||||
}
|
||||
Reference in New Issue
Block a user