@sigiljs/sigil
Version:
TypeScript-first Node.js HTTP framework offering schema-driven routing, modifier-based middleware, plugin extensibility, and flexible response templating
2 lines (1 loc) • 466 B
JavaScript
;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function t(e,r){if(typeof e=="string")return e;try{return JSON.stringify(e,r?.replacer,r?.space)}catch(n){if(r?.throw)throw new Error("Cannot serialize json: "+n?.message);return r?.fallback?String(r?.fallback):null}}function i(e,r){try{return JSON.parse(e)}catch(n){if(r)throw new Error("Cannot deserialize json: "+n?.message);return null}}exports.jsonParse=i;exports.jsonStringify=t;