Initial commit
This commit is contained in:
commit
b3a51a4115
10336 changed files with 2381973 additions and 0 deletions
16
node_modules/fast-check/lib/arbitrary/_internals/mappers/ArrayToMap.js
generated
vendored
Normal file
16
node_modules/fast-check/lib/arbitrary/_internals/mappers/ArrayToMap.js
generated
vendored
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.arrayToMapMapper = arrayToMapMapper;
|
||||
exports.arrayToMapUnmapper = arrayToMapUnmapper;
|
||||
function arrayToMapMapper(data) {
|
||||
return new Map(data);
|
||||
}
|
||||
function arrayToMapUnmapper(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 !== Map) {
|
||||
throw new Error('Incompatible instance received: should be of exact type Map');
|
||||
}
|
||||
return Array.from(value);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue