spiritjs
Version:
The animation toolkit for the web
24 lines (23 loc) • 503 B
JavaScript
;
exports.__esModule = true;
exports["default"] = void 0;
var EvalMap =
/**
* Create an evaluable map
*
* @param {RegExp} regex
* @param {*} map
*/
function EvalMap(regex, map) {
if (!regex || regex && !(regex instanceof RegExp)) {
throw new Error('Invalid expression.');
}
if (map === null || map === undefined) {
throw new Error('Invalid mapping.');
}
Object.assign(this, {
regex: regex,
map: map
});
};
var _default = exports["default"] = EvalMap;