You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

16 lines
611 B

"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);
}