typelit
Version:
A type-safe string templating library for TypeScript
3 lines (2 loc) • 600 B
JavaScript
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e="undefined"!=typeof globalThis?globalThis:e||self).typelit=n()}(this,(function(){"use strict";function e(e={}){return function(...n){return{_extract:e=>n.reduce(((e,n)=>e[n]),e),stringify:e.stringify??String}}}function n(e,...n){return t=>n.reduce(((n,i,r)=>n+i.stringify(i._extract(t))+e[r+1]),e[0])}return n.boolean=e(),n.string=e(),n.number=e(),n.bigint=e(),n.date=e(),n.json=e({stringify:e=>JSON.stringify(e,null,2)}),n}));
//# sourceMappingURL=index.js.map