Lines 1-21javascript
1import{s as m,validate as xe,filter as ze}from"tosijs-schema";function Oe(e,n){return(e instanceof String||e instanceof Number||e instanceof Boolean)&&(e=e.valueOf()),(n instanceof String||n instanceof Number||n instanceof Boolean)&&(n=n.valueOf()),!!(e===n||typeof e=="number"&&typeof n=="number"&&isNaN(e)&&isNaN(n)||e==null&&n==null)}function Vt(e){let n=globalThis;if(!(!n.__tjs||typeof n.__tjs.record!="function"))try{n.__tjs.record(e)}catch{}}var D=class{$error=!0;message;op;cause;constructor(n,t,r){this.message=n,this.op=t,this.cause=r,Vt({source:"vm",severity:"error",message:n,data:{op:t,c ...
2Supported: comparisons, &&, ||, !, arithmetic, member access (a.b), literals`)}return r.node}function tr(e){let n=[],t=0;for(;t<e.length;){for(;t<e.length&&/\s/.test(e[t]);)t++;if(t>=e.length)break;if(e[t]==='"'||e[t]==="'"){let r=e[t++],s="";for(;t<e.length&&e[t]!==r;)e[t]==="\\"&&t+1<e.length&&t++,s+=e[t++];t++,n.push(JSON.stringify(s));continue}if(e.slice(t,t+2).match(/^(&&|\|\||==|!=|>=|<=)$/)){n.push(e.slice(t,t+2)),t+=2;continue}if("+-*/%><!().?:[]".includes(e[t])){n.push(e[t]),t++;continue}if(/\d/.test(e[t])){let r="";for(;t<e.length&&/[\d.]/.test(e[t]);)r+=e[t++];n.push(r);continue}if( ...
HighCloud Metadata Access
Source reaches cloud instance metadata or link-local credential endpoints.
dist/tjs-eval.jsView on unpkg · L1 3`),r=this.line-1,s=Math.max(0,r-n),o=Math.min(t.length-1,r+n),i=[],a=String(o+1).length;for(let l=s;l<=o;l++){let c=String(l+1).padStart(a),u=l===r?">":" ";if(i.push(`${u} ${c} | ${t[l]}`),l===r){let p=" ".repeat(a+4+this.column);i.push(
4`)}};function W(e){return{depth:e.depth+1,locals:new Map,parent:e,parameters:e.parameters,atoms:e.atoms,warnings:e.warnings,source:e.source,filename:e.filename,options:e.options,helpers:e.helpers,helperSteps:e.helperSteps,helperTransforming:e.helperTransforming}}function _(e){return e.loc?{line:e.loc.start.line,column:e.loc.start.column}:{line:1,column:0}}import*as
5`)}function pr(e){let n=Ce.parse(e,{ecmaVersion:"latest"}),t=[],r=o=>t.push([o.body.start+1,"__fuel();"]);Me(n,{FunctionDeclaration:r,FunctionExpression:r,ArrowFunctionExpression(o){o.body.type==="BlockStatement"?t.push([o.body.start+1,"__fuel();"]):(t.push([o.body.start,"(__fuel(), "]),t.push([o.body.end,")"]))}}),t.sort((o,i)=>i[0]-o[0]);let s=e;for(let[o,i]of t)s=s.slice(0,o)+i+s.slice(o);return s}function et(e,n,t={}){let r=fr(e,t);if(!r.safe)return{safe:!1,diagnostics:r.diagnostics};if(!r.predicates.includes(n))return{safe:!1,diagnostics:[{predicate:n,message:`entry predicate '${n}' not f ...
6`);if(T.length===0)return h?`${u}${h}`:`${u}`;let $=`${u}import { ${T.join(", ")} } from '${d}'`;return h?`${$}
7${u}${h}`:$}),blocks:s}}function gr(e){let n=e.trim();return n?n.split(",").map(t=>t.trim()).filter(t=>t.length>0):[]}function hr(e){return e.startsWith("f32x4_")||e.startsWith("v128_")}function yr(e){let n=e.replace(/\/\/[^\n]*/g,"").replace(/\/\*[\s\S]*?\*\//g,""),t=new Set,r=/\.([a-zA-Z_$][a-zA-Z0-9_$]*)\b/g,s;for(;(s=r.exec(n))!==null;)t.add(s[1]);let o=/(?<!\.)(\b[a-zA-Z_$][a-zA-Z0-9_$]*)\b/g,i=new Set;for(;(s=o.exec(n))!==null;)i.add(s[1]);for(let f of t){if(!i.has(f))continue;let d=new RegExp(`(?<!\\.)\\b${f}\\b`,"g"),g=new RegExp(`\\.${f}\\b`,"g"),y=n.match(d)?.length||0,w=n.match(g)?. ...
8`),o=[],i=!1;for(let a=0;a<s.length;a++){let l=s[a],c=a>0?s[a-1]:"";if(i){o.push(l),l.includes("*/")&&(i=!1);continue}let u=l.indexOf(
9`)}function wr(e){let n=[],t=0,r="normal",s=[];for(;t<e.length;){let i=e[t],a=e[t+1];switch(r){
10`&&(r="normal"),t++;continue;case"block-comment":if(i==="*"&&a==="/"){t+=2,r="normal";continue}t++;continue;case"regex"
11`&&(r="normal"),t++;continue;case"block-comment":if(i==="*"&&a==="/"){t+=2,r="normal";continue}t++;continue;case"regex":if(i==="\\"&&t+1<e.length){t+=2;continue}if(i==="["){for(t++;t<e.length&&e[t]!=="]";)e[t]==="\\"&&t+1<e.length?t+=2:t++;t<e.length&&t++;continue}if(i==="/"){for(t++;t<e.length&&/[gimsuy]/.test(e[t]);)t++;r="normal";continue}t++;continue;case"normal":if(s.length>0){if(i==="{")s[s.length-1]++;else if(i==="}"&&(s[s.length-1]--,s[s.length-1]===0)){s.pop(),t++,r="template-string";continue}}if(i==="'"){t++,r="single-string";continue}if(i==='"'){t++,r="double-string";continue}if(i== ...
12`,i);a===-1&&(a=e.length);let l=e.slice(i,a).trim();if(l){let c=nt(l);n+=`const ${s} = Union('${o}', [${c.join(", "
13`||e[r-1]===";"||e[r-1]==="}"){let h=s.match(/^(\s*)extend\s+([A-Z]\w*)\s*\{/)}t+=e[r],r++;continue}let i=o[1],a=o[2],l=r+o[0].length-1,c=oe(e,l),u=e.slice(l+1,c-1).trim(),p=[],f=0,d=e.slice(l+1,c-1);for(;f<d.length;){let h=d.slice(f).match(/^(\s*)(async\s+)?(\w+)\s*\(/);if(!h){f++;continue}let $=h[1],S=!!h[2],b=h[3],v=f+h[0].length-1,k=1,j=v+1;for(;j<d.length&&k>0;)d[j]==="("&&k++,d[j]===")"&&k--,j++;let C=d.slice(v+1,j-1),M=j;for(;M<d.length&&/\s/.test(d[M]);)M++;if(d[M]==="="&&d[M+1]===">"){let G=Z(e,l+1+f);throw new O(`Arrow functions are not allowed in extend blocks (method '${b}'
14`),E;g?E=`${i}const __ext_${a} = {
17`:E=`${i}Object.assign(__ext_${a}, {
20`;for(let T of p)E+=`${i}if (__tjs?.registerExtension) { __tjs.registerExtension('${a}', '${T.name}', __ext_${a}.${T.name}) }
21`;t+=E,r=c}return r<=e.length&&t.length<e.length,{source:t,extensions:n}}function bt(e,n){if(n.size===0)return e;let t=new Map;for(let[s,o]of n)for(let i of o)t.has(i)||t.set(i,[]),t.get(i).push(s);let r=e;for(let[s,o]of t){if(!o.includes("String"))continue;let i=new RegExp(`('(?:[^'\\\\]|\\\\.)*')\\.(${s})\\((\\))?`,"g");r=r.replace(i,(c,u,p,f)=>f?`__ext_String.${p}.call(${u})`:`__ext_String.${p}.call(${u}, `);let a=new RegExp(`("(?:[^"\\\\]|\\\\.)*")\\.(${s})\\((\\))?`,"g");r=r.replace(a,(c,u,p,f)=>f?`__ext_String.${p}.call(${u})`:`__ext_String.${p}.call(${u}, `);let l=new RegExp("(`(?:[^`\\ ...
Long lines were clipped for display.