@kosatyi/ejs 0.0.75 → 0.0.77

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ejs={})}(this,(function(t){"use strict";function e(){e=function(){return n};var t,n={},r=Object.prototype,o=r.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},a="function"==typeof Symbol?Symbol:{},u=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function s(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,n){return t[e]=n}}function f(t,e,n,r){var o=e&&e.prototype instanceof y?e:y,a=Object.create(o.prototype),u=new T(r||[]);return i(a,"_invoke",{value:F(t,n,u)}),a}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}n.wrap=f;var p="suspendedStart",v="suspendedYield",g="executing",b="completed",m={};function y(){}function d(){}function w(){}var x={};s(x,u,(function(){return this}));var E=Object.getPrototypeOf,j=E&&E(E(B([])));j&&j!==r&&o.call(j,u)&&(x=j);var O=w.prototype=y.prototype=Object.create(x);function L(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function n(r,i,a,u){var c=h(t[r],t,i);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==typeof s&&o.call(s,"__await")?e.resolve(s.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,u)}))}u(c.arg)}var r;i(this,"_invoke",{value:function(t,o){function i(){return new e((function(e,r){n(t,o,e,r)}))}return r=r?r.then(i,i):i()}})}function F(e,n,r){var o=p;return function(i,a){if(o===g)throw new Error("Generator is already running");if(o===b){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var u=r.delegate;if(u){var c=P(u,r);if(c){if(c===m)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=b,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=g;var l=h(e,n,r);if("normal"===l.type){if(o=r.done?b:v,l.arg===m)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=b,r.method="throw",r.arg=l.arg)}}}function P(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,P(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),m;var i=h(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,m;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function N(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function B(e){if(e||""===e){var n=e[u];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function n(){for(;++r<e.length;)if(o.call(e,r))return n.value=e[r],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(typeof e+" is not iterable")}return d.prototype=w,i(O,"constructor",{value:w,configurable:!0}),i(w,"constructor",{value:d,configurable:!0}),d.displayName=s(w,l,"GeneratorFunction"),n.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},n.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,s(t,l,"GeneratorFunction")),t.prototype=Object.create(O),t},n.awrap=function(t){return{__await:t}},L(k.prototype),s(k.prototype,c,(function(){return this})),n.AsyncIterator=k,n.async=function(t,e,r,o,i){void 0===i&&(i=Promise);var a=new k(f(t,e,r,o),i);return n.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},L(O),s(O,l,"Generator"),s(O,u,(function(){return this})),s(O,"toString",(function(){return"[object Generator]"})),n.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},n.values=B,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(N),!e)for(var n in this)"t"===n.charAt(0)&&o.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(r,o){return u.type="throw",u.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=o.call(a,"catchLoc"),l=o.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),N(n),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;N(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:B(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},n}function n(t,e,n,r,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void n(t)}u.done?e(c):Promise.resolve(c).then(r,o)}function r(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var o=function(){var t=[].slice.call(arguments),e=t.shift();return t.filter(e).pop()},i=function(t){return Array.isArray(t)},a=function(t){return"function"==typeof t},u=function(t){return"string"==typeof t},c=function(t){return"boolean"==typeof t},l=function(t){return void 0===t},s="[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0),f=function(){return s},h={"'":"'","\\":"\\","\r":"r","\n":"n","\t":"t","\u2028":"u2028","\u2029":"u2029"},p={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"},v=function(t){return new RegExp(["[",Object.keys(t).join(""),"]"].join(""),"g")},g=v(p),b=v(h),m=function(){return(""+(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"")).replace(g,(function(t){return p[t]}))},y=function(t){return(""+t).replace(b,(function(t){return"\\"+h[t]}))},d=function(t,e){var n=t;return null==n?"":!0===e?m(n):n},w=function(t,e){return Boolean(t instanceof e)},x=function(t,e,n){for(var r=t,o=String(e).split("."),i=o.pop(),u=0;u<o.length;u++){var c=o[u];if(a(r.toJSON)&&(r=r.toJSON()),n&&!1===r.hasOwnProperty(c)){r={};break}r=r[c]=r[c]||{}}return a(r.toJSON)&&(r=r.toJSON()),[r,i]},E=function(t,e){var n=t.split(".").pop();return n!==e&&(t=[t,e].join(".")),t},j=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return n.filter((function(t){return t})).reduce((function(t,e){return Object.assign(t,e)}),t)},O=function(){},L=function(t,e){var n;for(n in t)P(t,n)&&e(t[n],n,t)},k=function(t,e){return function(t,e,n){var r=t instanceof Array,o=r?[]:{};return L(t,(function(t,n,i){var a=e(t,n,i);!1===l(a)&&(r?o.push(a):o[n]=a)})),o}(t,(function(t,n){if(-1===e.indexOf(n))return t}))},F=function(t,e,n){return Promise.resolve(t).then(e.bind(n))},P=function(t,e){return t&&t.hasOwnProperty(e)},S={export:"ejsPrecompiled",cache:!0,chokidar:null,path:"views",resolver:function(t,e){return Promise.resolve(["resolver is not defined",t,e].join(" "))},extension:"ejs",rmWhitespace:!0,withObject:!0,globalHelpers:[],vars:{SCOPE:"ejs",COMPONENT:"ui",EXTEND:"$$e",BUFFER:"$$a",LAYOUT:"$$l",BLOCKS:"$$b",MACRO:"$$m",SAFE:"$$v"},token:{start:"<%",end:"%>",regex:"([\\s\\S]+?)"}},N=function(t,e){j(t,{path:o(u,S.path,t.path,e.path),export:o(u,S.export,t.export,e.export),resolver:o(a,S.resolver,t.resolver,e.resolver),extension:o(u,S.extension,t.extension,e.extension),withObject:o(c,S.withObject,t.withObject,e.withObject),rmWhitespace:o(c,S.rmWhitespace,t.rmWhitespace,e.rmWhitespace),cache:o(c,S.cache,t.cache,e.cache),token:j({},S.token,t.token,e.token),vars:j({},S.vars,t.vars,e.vars),globalHelpers:o(i,S.globalHelpers,t.globalHelpers,e.globalHelpers)})},T="undefined"!=typeof globalThis?globalThis:window||self;function B(t){if(!1===w(this,B))return new B;var e={enabled:!0,list:{}};this.configure=function(t){e.enabled=t.cache,!1===f()&&this.load(T[t.export])},this.clear=function(){e.list={}},this.load=function(t){return e.enabled&&j(e.list,t||{}),this},this.get=function(t){if(e.enabled)return e.list[t]},this.set=function(t,n){return e.enabled&&(e.list[t]=n),this},this.resolve=function(t){return Promise.resolve(this.get(t))},this.remove=function(t){delete e.list[t]},this.exist=function(t){return P(e.list,t)}}var _=[{symbol:"-",format:function(t){return"')\n".concat(this.BUFFER,"(").concat(this.SAFE,"(").concat(t,",1))\n").concat(this.BUFFER,"('")}},{symbol:"=",format:function(t){return"')\n".concat(this.BUFFER,"(").concat(this.SAFE,"(").concat(t,"))\n").concat(this.BUFFER,"('")}},{symbol:"#",format:function(t){return"')\n/**".concat(t,"**/\n").concat(this.BUFFER,"('")}},{symbol:"",format:function(t){return"')\n".concat(t.trim(),"\n").concat(this.BUFFER,"('")}}];function R(t){if(!1===w(this,R))return new R(t);var e={};this.configure=function(t){e.withObject=t.withObject,e.rmWhitespace=t.rmWhitespace,e.token=t.token,e.vars=t.vars,e.globalHelpers=t.globalHelpers,e.matches=[],e.formats=[],e.slurp={match:"[ \\t]*",start:[e.token.start,"_"],end:["_",e.token.end]},_.forEach((function(t){e.matches.push(e.token.start.concat(t.symbol).concat(e.token.regex).concat(e.token.end)),e.formats.push(t.format.bind(e.vars))})),e.regex=new RegExp(e.matches.join("|").concat("|$"),"g"),e.slurpStart=new RegExp([e.slurp.match,e.slurp.start.join("")].join(""),"gm"),e.slurpEnd=new RegExp([e.slurp.end.join(""),e.slurp.match].join(""),"gm")},this.compile=function(t,n){var r=e.vars,o=r.SCOPE,i=r.SAFE,a=r.BUFFER,u=r.COMPONENT,c=e.globalHelpers;t=String(t),e.rmWhitespace&&(t=t.replace(/[\r\n]+/g,"\n").replace(/^\s+|\s+$/gm,"")),t=t.replace(e.slurpStart,e.token.start).replace(e.slurpEnd,e.token.end);var l,s,f,h="".concat(a,"('");l=e.regex,s=function(n,r,o){h+=y(t.slice(r,o)),n.forEach((function(t,n){t&&(h+=e.formats[n](t))}))},f=0,t.replace(l,(function(){var t=[].slice.call(arguments,0,-1),e=t.pop(),n=t.shift();return s(t,f,e),f=e+n.length,n})),h="try{".concat(h+="');","}catch(e){console.info(e)}"),e.withObject&&(h="with(".concat(o,"){").concat(h,"}")),h="".concat(a,".start();").concat(h,"return ").concat(a,".end();"),h+="\n//# sourceURL=".concat(n);var p=null,v=[o,u,a,i].concat(c);try{(p=Function.apply(null,v.concat(h))).source="(function(".concat(v.join(","),"){\n").concat(h,"\n})")}catch(t){throw t.filename=n,t.source=h,t}return p},this.configure(t)}function A(t,e,n){if(!1===w(this,A))return new A(t,e,n);if(!1===w(e,B))throw new TypeError("cache is not instance of Cache");if(!1===w(n,R))throw new TypeError("compiler is not instance of Compiler");var r={},o=function(t){return r.resolver(r.path,t)};this.configure=function(t){r.path=t.path,r.cache=t.cache,a(t.resolver)&&(r.resolver=t.resolver)},this.get=function(t){return e.exist(t)?e.resolve(t):o(t).then((function(r){return function(t,n){return e.set(t,n),n}(t,function(t,e){return a(t)?t:n.compile(t,e)}(r,t))}))},this.configure(t)}var $=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],C=" ",U='"',M="/",H="<",G=">",W=function(t,e,n){var r=[],o=-1===$.indexOf(t),i=function(t,e,n){var r=[];return L(t,(function(t,n,o){var i=e(t,n,o);!1===l(i)&&r.push(i)})),r}(e,(function(t,e){if(null!=t)return[m(e),[U,m(t),U].join("")].join("=")})).join(C);return r.push([H,t,C,i,G].join("")),n&&r.push(n instanceof Array?n.join(""):n),o&&r.push([H,M,t,G].join("")),r.join("")};function J(t){return Promise.all(t||[]).then((function(t){return t.join("")}))}function Y(){var t=[],e=[];function n(t){e.push(t)}return n.start=function(){e=[]},n.backup=function(){t.push(e.concat()),e=[]},n.restore=function(){var n=e.concat();return e=t.pop(),J(n)},n.error=function(t){throw t},n.end=function(){return J(e)},n}function q(t){if(!1===w(this,q))return new q(t);this.configure=function(t,e){var n,o=t.vars,i=o.BLOCKS,c=o.MACRO,l=o.EXTEND,s=o.LAYOUT,f=o.BUFFER,h=o.COMPONENT;function p(t){this[i]={},this[c]={},j(this,t||{})}this.create=function(t){return new p(t)},this.helpers=function(t){j(p.prototype,t||{})},p.prototype=j({},e||{}),Object.defineProperties(p.prototype,(r(n={},f,{value:Y(),writable:!0,configurable:!1,enumerable:!1}),r(n,i,{value:{},writable:!0,configurable:!1,enumerable:!1}),r(n,c,{value:{},writable:!0,configurable:!1,enumerable:!1}),r(n,s,{value:!1,writable:!0,configurable:!1,enumerable:!1}),r(n,l,{value:!1,writable:!0,configurable:!1,enumerable:!1}),r(n,"getMacro",{value:function(){return this[c]},writable:!1,configurable:!1,enumerable:!1}),r(n,"getBuffer",{value:function(){return this[f]},writable:!1,configurable:!1,enumerable:!1}),r(n,"getComponent",{value:function(){var t=this;return h in t?function(){return t[h].apply(t,arguments)}:function(){console.log("%s function not defined",h)}},writable:!1,configurable:!1,enumerable:!1}),r(n,"getBlocks",{value:function(){return this[i]},writable:!1,configurable:!1,enumerable:!1}),r(n,"setExtend",{value:function(t){this[l]=t},writable:!1,configurable:!1,enumerable:!1}),r(n,"getExtend",{value:function(){return this[l]},writable:!1,configurable:!1,enumerable:!1}),r(n,"setLayout",{value:function(t){this[s]=t},writable:!1,configurable:!1,enumerable:!1}),r(n,"getLayout",{value:function(){return this[s]},writable:!1,configurable:!1,enumerable:!1}),r(n,"clone",{value:function(t){var e=[s,l,f];return!0===t&&e.push(i),k(this,e)},writable:!1,configurable:!1,enumerable:!1}),r(n,"extend",{value:function(t){this.setExtend(!0),this.setLayout(t)},writable:!1,configurable:!1,enumerable:!1}),r(n,"echo",{value:function(t){var e=this.getBuffer();[].slice.call(arguments).forEach(e)},writable:!1,configurable:!1,enumerable:!1}),r(n,"fn",{value:function(t){var e=this.getBuffer(),n=this;return function(){return e.backup(),a(t)&&t.apply(n,arguments),e.restore()}},writable:!1,configurable:!1,enumerable:!1}),r(n,"get",{value:function(t,e){var n=x(this,t,!0),r=n.shift(),o=n.pop();return P(r,o)?r[o]:e},writable:!1,configurable:!1,enumerable:!1}),r(n,"set",{value:function(t,e){var n=x(this,t,!1),r=n.shift(),o=n.pop();return this.getExtend()&&P(r,o)?r[o]:r[o]=e},writable:!1,configurable:!1,enumerable:!1}),r(n,"macro",{value:function(t,e){var n=this.getMacro(),r=this.fn(e),o=this;n[t]=function(){return o.echo(r.apply(void 0,arguments))}},writable:!1,configurable:!1,enumerable:!1}),r(n,"call",{value:function(t){var e=this.getMacro()[t],n=[].slice.call(arguments,1);if(a(e))return e.apply(e,n)},writable:!1,configurable:!1,enumerable:!1}),r(n,"block",{value:function(t,e){var n=this,r=this.getBlocks();if(r[t]=r[t]||[],r[t].push(this.fn(e)),!this.getExtend()){var o=Object.assign([],r[t]),i=function(){return o.shift()};this.echo(i()(function t(){var e=i();return e?function(){n.echo(e(t()))}:O}()))}},writable:!1,configurable:!1,enumerable:!1}),r(n,"include",{value:function(t,e,n){var r=!1===n?{}:this.clone(!0),o=j(r,e||{}),i=this.render(t,o);this.echo(i)},writable:!1,configurable:!1,enumerable:!1}),r(n,"use",{value:function(t,e){var n=this.require(t);this.echo(F(n,(function(t){var n=this.getMacro();L(t,(function(t,r){n[[e,r].join(".")]=t}))}),this))},writable:!1,configurable:!1,enumerable:!1}),r(n,"async",{value:function(t,e){this.echo(F(t,(function(t){return this.fn(e)(t)}),this))},writable:!1,configurable:!1,enumerable:!1}),r(n,"each",{value:function(t,e){u(t)&&(t=this.get(t,[])),L(t,e)},writable:!1,configurable:!1,enumerable:!1}),r(n,"element",{value:function(t,e,n){return W(t,e,n)},writable:!1,configurable:!1,enumerable:!1}),r(n,"el",{value:function(t,e,n){a(n)&&(n=this.fn(n)()),this.echo(F(n,(function(n){return this.element(t,e,n)}),this))},writable:!1,configurable:!1,enumerable:!1}),n))},this.configure(t)}var I={},D=new function t(e){if(!1===w(this,t))return new t(e);var n={},r={};N(r,e||{});var o=new q(r),i=new R(r),u=new B,c=new A(r,u,i),l=function(t,e){var n=[e,e.getComponent(),e.getBuffer(),d];return r.globalHelpers.forEach((function(t){a(e[t])&&n.push(e[t].bind(e))})),c.get(t).then((function(t){return t.apply(e,n)}))},s=function t(e,n){var i=E(e,r.extension),a=o.create(n);return l(i,a).then((function(e){if(a.getExtend()){a.setExtend(!1);var n=a.getLayout(),r=a.clone();return t(n,r)}return e}))};return this.configure=function(t){return N(r,t=t||{}),o.configure(r,n),i.configure(r),u.configure(r),c.configure(r),r},this.render=function(t,e){return s(t,e)},this.helpers=function(t){o.helpers(j(n,t))},this.preload=function(t){return u.load(t||{})},this.create=function(e){return new t(e)},this.compile=function(t,e){return i.compile(t,e)},this.context=function(t){return o.create(t)},this.helpers({require:function(t){var e=E(t,r.extension),n=o.create({});return l(e,n).then((function(){return n.getMacro()}))},render:s}),this}({cache:!1,withObject:!1,resolver:function(t,e){return e in I?Promise.resolve(I[e]):Promise.resolve(["template not found",e])}});function K(){var t;return t=e().mark((function t(n){return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:Object.assign(I,n||{});case 1:case"end":return t.stop()}}),t)})),K=function(){var e=this,r=arguments;return new Promise((function(o,i){var a=t.apply(e,r);function u(t){n(a,o,i,u,c,"next",t)}function c(t){n(a,o,i,u,c,"throw",t)}u(void 0)}))},K.apply(this,arguments)}var X=D.render,z=D.context,Q=D.compile,V=D.helpers,Z=D.preload,tt=D.configure,et=D.create;t.compile=Q,t.configure=tt,t.context=z,t.create=et,t.helpers=V,t.preload=Z,t.render=X,t.useTemplates=function(t){return K.apply(this,arguments)}}));
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "EJS Templates",
4
4
  "homepage": "https://github.com/kosatyi/ejs",
5
5
  "type": "module",
6
- "version": "0.0.75",
6
+ "version": "0.0.77",
7
7
  "main": "dist/cjs/index.js",
8
8
  "module": "dist/esm/index.js",
9
9
  "browser": "dist/umd/browser.js",
@@ -18,6 +18,10 @@
18
18
  "import": "./dist/esm/browser.js",
19
19
  "require": "./dist/cjs/browser.js"
20
20
  },
21
+ "./worker": {
22
+ "import": "./dist/esm/worker.js",
23
+ "require": "./dist/cjs/worker.js"
24
+ },
21
25
  "./element": {
22
26
  "import": "./dist/esm/element.js",
23
27
  "require": "./dist/cjs/element.js"
package/types/global.d.ts CHANGED
@@ -1,103 +1,92 @@
1
1
  declare global {
2
- export namespace ejs {
2
+ interface EJS {
3
3
  /**
4
4
  * extend layout with blocks in current template file
5
5
  * @param layout
6
6
  */
7
- function extend(layout: string): any
8
-
7
+ extend(layout: string): any
9
8
  /**
10
9
  * define block with custom **name** and callback
11
10
  * @param name
12
11
  * @param [callback]
13
12
  */
14
- function block(name: string, callback?: Function): any
15
-
13
+ block(name: string, callback?: Function): any
16
14
  /**
17
15
  * set property in current scope
18
16
  * @param path
19
17
  * @param value
20
18
  */
21
- function set(path: string, value: any): any
22
-
19
+ set(path: string, value: any): any
23
20
  /**
24
21
  * get property in current scope
25
22
  * @param path
26
23
  * @param defaults
27
24
  */
28
- function get(path: string, defaults?: any): any
29
-
25
+ get(path: string, defaults?: any): any
30
26
  /**
31
27
  * import macro from file **path** and set to current scope **name** property
32
28
  * @param path
33
29
  * @param name
34
30
  */
35
- function use(path: string, name: string): any
36
-
31
+ use(path: string, name: string): any
37
32
  /**
38
33
  * define macro function with custom **name**
39
34
  * @param name
40
35
  * @param callback
41
36
  */
42
- function macro(name: string, callback: any): any
43
-
37
+ macro(name: string, callback: any): any
44
38
  /**
45
39
  * call macro function
46
40
  * @param name
47
41
  * @param props
48
42
  * @param callback
49
43
  */
50
- function call(name: string, props?: object, callback?: any): any
51
-
44
+ call(name: string, props?: object, callback?: any): any
52
45
  /**
53
46
  * asynchronous template execution
54
47
  * @param promise
55
48
  * @param callback
56
49
  */
57
- function async(promise: Promise<any>, callback?: any): any
58
-
50
+ async(promise: Promise<any>, callback?: any): any
59
51
  /**
60
52
  * asynchronous template execution
61
53
  * @param callback
62
54
  */
63
- function fn(callback: Function): any
64
-
55
+ fn(callback: Function): any
65
56
  /**
66
57
  *
67
58
  * @param {string} tag
68
59
  * @param {object} attrs
69
60
  * @param {function} content
70
61
  */
71
- function el(tag: string, attrs?: object, content?: any): any
72
-
62
+ el(tag: string, attrs?: object, content?: any): any
73
63
  /**
74
64
  * buffer output
75
65
  * @param args
76
66
  */
77
- function echo(...args: any[]): any
78
-
67
+ echo(...args: any[]): any
79
68
  /**
80
69
  * append rendered template from file
81
70
  * @param path
82
71
  * @param data
83
72
  * @param cx
84
73
  */
85
- function include(path: string, data?: object, cx?: boolean): any
86
-
74
+ include(path: string, data?: object, cx?: boolean): any
87
75
  /**
88
76
  *
89
77
  * @param value
90
78
  * @param callback
91
79
  */
92
- function each(value: any, callback: Function): any
93
-
80
+ each(value: any, callback: Function): any
94
81
  /**
95
82
  * define block with custom **name** and callback
96
83
  * @param {string} name
97
84
  * @param {object} [props]
98
85
  */
99
- function ui(name: string, props?: object): any
86
+ ui(name: string, props?: object): any
100
87
  }
88
+
89
+ const ejs: EJS
101
90
  }
102
91
 
103
92
  export = global
@@ -1,3 +0,0 @@
1
- {
2
- "type": "commonjs"
3
- }