UNPKG

@nent/core

Version:

Functional elements to add routing, data-binding, dynamic HTML, declarative actions, audio, video, and so much more. Supercharge static HTML files into web apps without script or builds.

4 lines 1.05 kB
/*! * NENT 2022 */ (()=>{const e=(e,t)=>{const s=globalThis[t];return null!=s&&e instanceof s},t=s=>{if(null!=s){if(e(s,"ArrayBuffer")||e(s,"MessagePort")||e(s,"ImageBitmap")||e(s,"OffscreenCanvas"))return[s];if("object"==typeof s)return s.constructor===Object&&(s=Object.values(s)),Array.isArray(s)?s.flatMap(t):t(s.buffer)}return[]},s={},r="stencil.evaluate.worker",n=r+".cb";addEventListener("message",(async({data:e})=>{if(e&&e[0]===r){let a,o,c=e[1],i=e[2],l=e[3],f=0,u=l.length;try{for(;f<u;f++)if(Array.isArray(l[f])&&l[f][0]===n){const e=l[f][1];l[f]=(...t)=>{postMessage([n,e,t])}}a=await s[i](...l)}catch(e){a=null,o=e instanceof Error?{isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:{isError:!1,value:e},a=void 0}const d=t(a);postMessage([r,c,a,o],d)}})),self.importScripts("https://cdn.jsdelivr.net/npm/expr-eval@2.0.2/dist/bundle.min.js");const a=new self.exprEval.Parser({operators:{in:!0,assignment:!1}});s.evalExpression=async function(e,t={}){let s=!1;try{s=a.evaluate(e,t)}catch(e){console.debug(e)}return s}})();