tupleson
Version:
A hackable JSON serializer/deserializer
14 lines • 359 B
JavaScript
const tsonRegExp = {
deserialize: (str) => {
const body = str.slice(1, str.lastIndexOf("/"));
const flags = str.slice(str.lastIndexOf("/") + 1);
return new RegExp(body, flags);
},
key: "RegExp",
serialize: (value) => "" + value,
test: (value) => value instanceof RegExp
};
export {
tsonRegExp
};
//# sourceMappingURL=tsonRegExp.mjs.map