@sheetxl/scripting 0.4.20 → 0.4.21
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.
- package/browser/cjs/{FSJV4VxGhYhUWiqB.cjs → B53LLicBNrtKpVyu.cjs} +4 -4
- package/browser/cjs/{DSsVt2Oe-mQ1G1SU.cjs → CE-3r2WvxoJ2gGRS.cjs} +1 -1
- package/browser/cjs/{CLShXjYU2djtsxDg.cjs → CEcQ8ktGllEA9Nhd.cjs} +2 -2
- package/browser/cjs/{D6qhs7_I1Owa9k4f.cjs → CtQs8QmtM5734xOj.cjs} +1 -1
- package/browser/cjs/index.cjs +2 -2
- package/browser/cjs/nAEbHufxERnBQ_OH.cjs +32 -0
- package/browser/esm/{Cyd5uzVL8CAQMY6j.mjs → BvVnGL93zPNrNW9U.mjs} +1 -1
- package/browser/esm/{D-daJSOdJgKB3fJ2.mjs → D15akh90uxgMURMn.mjs} +2 -2
- package/browser/esm/{O4kIdvXPTztQYC7U.mjs → SVOya_s4QLh8mezD.mjs} +4 -4
- package/browser/esm/{Ct0qqt65wZfznmsz.mjs → Wf8wVXnq-3fmVj-F.mjs} +1 -1
- package/browser/esm/index.mjs +14 -3
- package/browser/esm/kt7ehOAWy04YbZVO.mjs +264 -0
- package/licenses/dependencies.txt +1 -41
- package/node/esm/{BjJ6c6-OmWgy9fH5.mjs → BElWStkjofHi3IR4.mjs} +2 -2
- package/node/esm/{DmKkzjlUwfDMAhOe.mjs → Bck_wdMsD2o1wOt4.mjs} +1 -1
- package/node/esm/{B1020q1KSEfMetOp.mjs → BfTNWkHHn2IJRtmX.mjs} +1 -1
- package/node/esm/CEe-0FgejjCYrijW.mjs +264 -0
- package/node/esm/{pdknADguX1D6ZV5d.mjs → DGcLty7atLj7aQX7.mjs} +4 -4
- package/node/esm/index.mjs +13 -814
- package/package.json +3 -3
- package/browser/cjs/BcOKbXMoKun0MQJd.cjs +0 -32
- package/browser/cjs/CyXlz-ksXq_Q90pj.cjs +0 -13
- package/browser/esm/BzTIAPLpZ0_RLUjG.mjs +0 -820
- package/browser/esm/D-Gkinm8ldWd91vj.mjs +0 -476
- package/node/esm/DRVkmriLQu8-iBY6.mjs +0 -476
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";/**
|
|
2
|
-
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.4.
|
|
2
|
+
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.4.21
|
|
3
3
|
*
|
|
4
4
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
6
|
*/Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});let c=class{constructor(e){this._worker=null,this._nextId=1,this._pendingRequests=new Map,this._workerFactory=e}start(){if(typeof Worker>"u")throw new Error("Web Workers are not supported in this environment.");return this._worker||(this._worker=this._workerFactory(),this._worker.onmessage=e=>{const{id:n,result:t,error:r}=e.data,o=this._pendingRequests.get(n);if(o)if(this._pendingRequests.delete(n),r){const i=new Error(r.message);i.stack=r.stack,r.cause&&(i.cause=r.cause),o.reject(i)}else o.resolve(t)},this._worker.onerror=e=>{console.error("Worker error:",e),this._pendingRequests.forEach(n=>{n.reject(new Error(`Worker failed: ${e.message}`))}),this._pendingRequests.clear(),this._worker=null}),Promise.resolve()}execute(e){if(!this._worker)throw new Error("Worker is not initialized. Call start() first.");const n=this._nextId++;return new Promise((t,r)=>{this._pendingRequests.set(n,{resolve:t,reject:r}),this._worker.postMessage({id:n,params:e})})}terminate(){this._worker&&(this._worker.terminate(),this._worker=null)}};class u{constructor(n){this._onExecute=n}execute(n){return this._onExecute(n)}start(){return Promise.resolve()}terminate(){}}const s=`/**
|
|
7
|
-
* @license @sheetxl/primitives - Primitives - Base types for SheetXL functions. - v0.4.
|
|
7
|
+
* @license @sheetxl/primitives - Primitives - Base types for SheetXL functions. - v0.4.21
|
|
8
8
|
*
|
|
9
9
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
10
10
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
@@ -223,7 +223,7 @@ var v;
|
|
|
223
223
|
return n = typeof e == "string" ? tt.get(e) : rt.get(e), n || (n = v.Unknown), new n(t, r);
|
|
224
224
|
}, v.getBuiltInById = (e) => Te.get(e) || Et;
|
|
225
225
|
/**
|
|
226
|
-
* @license @sheetxl/utils - Utils - Utilities used by most SheetXL components. - v0.4.
|
|
226
|
+
* @license @sheetxl/utils - Utils - Utilities used by most SheetXL components. - v0.4.21
|
|
227
227
|
*
|
|
228
228
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
229
229
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
@@ -1498,4 +1498,4 @@ var or = /* @__PURE__ */ Object.freeze({
|
|
|
1498
1498
|
__proto__: null,
|
|
1499
1499
|
initialize: nr
|
|
1500
1500
|
});
|
|
1501
|
-
`,a=typeof self<"u"&&self.Blob&&new Blob(["URL.revokeObjectURL(import.meta.url);",s],{type:"text/javascript;charset=utf-8"});function d(e){let n;try{if(n=a&&(self.URL||self.webkitURL).createObjectURL(a),!n)throw"";const t=new Worker(n,{type:"module",name:e?.name});return t.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(n)}),t}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(s),{type:"module",name:e?.name})}}const l=async()=>{const{compileModule:e}=await Promise.resolve().then(()=>require("./
|
|
1501
|
+
`,a=typeof self<"u"&&self.Blob&&new Blob(["URL.revokeObjectURL(import.meta.url);",s],{type:"text/javascript;charset=utf-8"});function d(e){let n;try{if(n=a&&(self.URL||self.webkitURL).createObjectURL(a),!n)throw"";const t=new Worker(n,{type:"module",name:e?.name});return t.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(n)}),t}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(s),{type:"module",name:e?.name})}}const l=async()=>{const{compileModule:e}=await Promise.resolve().then(()=>require("./nAEbHufxERnBQ_OH.cjs")),n=new u(t=>e(t));return await n.start(),n};exports.createCompilerWorker=async function(){if(typeof process<"u"&&process.versions?.node&&typeof Worker>"u")return await l();if(typeof Worker<"u"){const e=new c(()=>new d);try{return await e.start(),e}catch(n){console.error("Failed to start TypescriptCompiler worker reverting to fallback:",n)}}return await l()};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";/**
|
|
2
|
-
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.4.
|
|
2
|
+
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.4.21
|
|
3
3
|
*
|
|
4
4
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";/**
|
|
2
|
-
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.4.
|
|
2
|
+
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.4.21
|
|
3
3
|
*
|
|
4
4
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
-
*/Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});exports.TypeScriptCompiler=class{constructor(r={}){this.workerWrapper=null}async getWorkerWrapper(){if(this.workerWrapper)return this.workerWrapper;const{createCompilerWorker:r}=await Promise.resolve().then(()=>require("./
|
|
6
|
+
*/Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});exports.TypeScriptCompiler=class{constructor(r={}){this.workerWrapper=null}async getWorkerWrapper(){if(this.workerWrapper)return this.workerWrapper;const{createCompilerWorker:r}=await Promise.resolve().then(()=>require("./B53LLicBNrtKpVyu.cjs"));return this.workerWrapper=await r(),this.workerWrapper}async compileModule(r){try{return(await this.getWorkerWrapper()).execute(r)}catch(e){throw console.error("Failed to compile using worker:",e),e}}terminate(){this.workerWrapper?.terminate(),this.workerWrapper=null}};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";/**
|
|
2
|
-
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.4.
|
|
2
|
+
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.4.21
|
|
3
3
|
*
|
|
4
4
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
package/browser/cjs/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";/**
|
|
2
|
-
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.4.
|
|
2
|
+
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.4.21
|
|
3
3
|
*
|
|
4
4
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
-
*/Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./
|
|
6
|
+
*/Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("@sheetxl/utils");let l=null,n=null,t=null;const c=Object.freeze({compileTypescript:async function(e){if(!(e?.source??null))return null;if(n&&u.CommonUtils.deepEqual(n,e))return l;const i=await async function(){if(t)return t;const{TypeScriptCompiler:o}=await Promise.resolve().then(()=>require("./CEcQ8ktGllEA9Nhd.cjs"));return t=new o,t}(),r=await i.compileModule(e);return l=r,n=e,r}});exports.ScriptingUtils=c;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";/**
|
|
2
|
+
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.4.21
|
|
3
|
+
*
|
|
4
|
+
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
|
+
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
+
*/Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $=require("@sheetxl/primitives"),ae=require("@sheetxl/utils");let L=null,I=null;const oe={compilerOptions:{target:"esnext"}};async function le(h,x,b="/script.js",w="__SHEETXL"){try{const K=await async function(){if(L)return L;if(I){if(await I,!L)throw new Error("ESBuild initialization promise resolved, but instance is not available.");return L}let p,T;I=new Promise((a,S)=>{p=a,T=S});try{const{initialize:a}=await Promise.resolve().then(()=>require("./CtQs8QmtM5734xOj.cjs"));return L=await a(),p(),L}catch(a){throw console.error("Failed to import or initialize esbuild:",a),I=null,T(a),a}}(),j="@sheetxl/primitives",n=`
|
|
7
|
+
export const FormulaContext = globalThis.${w}?.FormulaContext;
|
|
8
|
+
export const ScalarType = globalThis.${w}?.ScalarType;
|
|
9
|
+
export const Observable = globalThis.${w}?.Observable;
|
|
10
|
+
export const IRange = globalThis.${w}?.IRange;
|
|
11
|
+
export const FormulaError = globalThis.${w}?.FormulaError;
|
|
12
|
+
// Add more exports as needed
|
|
13
|
+
`,F={name:"sheetxl-esbuild-in-memory",setup(p){const T="sheetxl-"+new Date().getTime();p.onResolve({filter:new RegExp(`^(${b.replace("/","\\/")}|${j})$`)},a=>({path:a.path,namespace:T})),p.onResolve({filter:/.*/},a=>{if(a.namespace!==T)return console.warn(`esbuild: Treating import "${a.path}" as external.`),{path:a.path,external:!0}}),p.onLoad({filter:/.*/,namespace:T},a=>{let S;if(a.path===b)S=x;else{if(a.path!==j)return{errors:[{text:`Cannot load unknown path in ${T}: ${a.path}`}]};S=n}return{contents:S,loader:"ts"}})}},f=await K.build({entryPoints:[b],bundle:!0,write:!1,format:"esm",plugins:[F],sourcemap:"inline",tsconfigRaw:oe,minify:!0,platform:"neutral"});if(f.outputFiles&&f.outputFiles.length>0)return f.outputFiles[0].text;throw f.errors&&f.errors.length>0?new Error(`esbuild bundling failed: ${f.errors.map(p=>p.text).join(`
|
|
14
|
+
`)}`):new Error("esbuild did not produce an output file.")}catch(K){throw console.error("esbuild bundling process failed:",K),K}}const se=async()=>`
|
|
15
|
+
interface FirstTest {
|
|
16
|
+
isTrue?: boolean;
|
|
17
|
+
}
|
|
18
|
+
`,Y=new Map([["IReferenceRange","r"],["IRange","l"]]),Z=new Map([["IWorkbook","workbook"],["ISheet","sheet"],["ICellRanges","ranges"],["ICellRange","range"],["IFormulaContext","context"]]),V=(h,x)=>{Array.from(x.keys()).forEach(b=>{const w=x.get(b);x.set(`${h}.${b}`,w)})},ce=new Map([["Scalar","*"],["FormulaError.Known",$.ScalarType.Error],["Date","Date"],["JSON","JSON"]]),de=new Map([]),X="SheetXL";V(X,Y),V(X,Z),V(X,de);const ue=new Map([["Promise",()=>({async:!0})],["Observable",()=>({stream:!0})]]);let q=null;async function pe(){if(q)return q;try{return await(await Promise.resolve().then(()=>require("./CE-3r2WvxoJ2gGRS.cjs"))).initialize()}catch(h){throw q=null,h}finally{q=null}}exports.compileModule=async function(h){const x=h?.source??null;if(!x)return null;const b=(h.disableBundle||h.declarationsOnly)??!1,w=[se(),pe()],K=await Promise.all(w),j=K[0],n=K[1];let F="",f=null;const p=[],T={allowJs:!0,declaration:!1,sourceMap:!1,inlineSourceMap:!1,inlineSources:!1,isolatedModules:!0,preserveConstEnums:!1,module:99,noResolve:!0,emitDeclarationOnly:!1,target:n.ScriptTarget.ES2020},a="script",S=`${a}.ts`,_="lib.d.ts",H="global.d.ts",M={[S]:x,[_]:`
|
|
19
|
+
/**
|
|
20
|
+
* Represents the completion of an asynchronous operation
|
|
21
|
+
*/
|
|
22
|
+
interface Promise<T> {
|
|
23
|
+
/**
|
|
24
|
+
* Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
|
|
25
|
+
* resolved value cannot be modified from the callback.
|
|
26
|
+
* @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
|
|
27
|
+
* @returns A Promise for the completion of the callback.
|
|
28
|
+
*/
|
|
29
|
+
finally(onfinally?: (() => void) | undefined | null): Promise<T>;
|
|
30
|
+
}
|
|
31
|
+
`,[H]:j},ee={getSourceFile:(e,t,u,m)=>n.createSourceFile(e,M[e],n.ScriptTarget.Latest,!0),fileExists:e=>M[e]!==void 0,readFile:e=>M[e],writeFile:(e,t)=>{M[e]=t},getCurrentDirectory:()=>"./",getCanonicalFileName:e=>e,useCaseSensitiveFileNames:()=>!0,getDefaultLibFileName:e=>_,getNewLine:()=>`
|
|
32
|
+
`},B=n.createProgram([S,H],T,ee),O=B.getTypeChecker(),te=B.getSourceFile(S),W=B.emit();W.diagnostics.length>0&&console.warn(W.diagnostics),F=M[`${a}.js`];const A=(e,t,u,m)=>{if(e){if(e.kind===n.SyntaxKind.NumberKeyword)t.scalar=$.ScalarType.Number;else if(e.kind===n.SyntaxKind.StringKeyword)t.scalar=$.ScalarType.String;else if(e.kind===n.SyntaxKind.BooleanKeyword)t.scalar=$.ScalarType.Boolean;else if(e.kind===n.SyntaxKind.UndefinedKeyword||e.kind===n.SyntaxKind.NullKeyword||e.kind===n.SyntaxKind.VoidKeyword){if(m)return void k(e,new Error(`'undefined' is not a valid type for input: '${e?.parent?.name?.escapedText}'.`));t.scalar=$.ScalarType.Null}else if(e.kind===n.SyntaxKind.BigIntKeyword)t.scalar=$.ScalarType.Number;else if(e.kind===n.SyntaxKind.AnyKeyword)t.scalar=$.ScalarType.Null;else if(e.kind===n.SyntaxKind.ArrayType){const o=e.elementType;if(!o)return void k(e,new Error(`'Array' must be typed: '${e?.parent?.name?.escapedText}'.`));t.arrayDepth=(t.arrayDepth??0)+1,A(o,t,u,m)}else if(e.kind!==n.SyntaxKind.TupleType){if(e.kind===n.SyntaxKind.TypeReference){const o=e.typeName?.getText?.()??null,R=Y.get(o);let E=!1;R&&(t.range=R,E=!0);const z=ce.get(o);if(z&&(t.scalar=z),z!==void 0&&(E=!0),m){const r=Z.get(o);if(r)return r}else{const r=ue.get(o);if(r){const l={...t,...r()};let y=0;if(l.async&&y++,l.stream&&y++,y>1)return void k(e,new Error(`'${o}' cannot have multiple modifiers: '${e?.parent?.name?.escapedText}'.`));t=l,E=!0}}if(!E)return void k("node",new Error(`'${o}' is not a valid type: '${e?.parent?.name?.escapedText}'.`));const d=e.typeArguments;if(d){if(d.length!==1)return void k(e,new Error(`'${o}' must be typed with exactly 1 type: '${e?.parent?.name?.escapedText}'.`));A(d[0],t,u,m)}}}}else k(e,new Error(`Type is not defined for '${t?.name??"return"}'.`))},C=[],k=(e,t)=>{C.push(t)};if(n.forEachChild(te,e=>{if((t=>(n.getCombinedModifierFlags(t)&n.ModifierFlags.Export)!==0)(e)&&n.isFunctionDeclaration(e)){const t={},u={parameters:{}},m=e?.name?.getText();try{t.name=m;const o=O.getSymbolAtLocation(e.name).getDocumentationComment(O);if(o&&o.length>0&&o[0].text){let d=o[0].text;d=d.replace(/[\r\n]+/g,"\\n").trim(),u.summary=d}const R={};A(e.type,R,t,!1),t.returnType=R;const E={};(d=>(n.getCombinedModifierFlags(d)&n.ModifierFlags.Default)!==0)(e)&&(E.default=!0,f=m),Object.keys(E).length>0&&(t.behavior=E),t.parameters=[];const z=new Map;for(let d=0;d<e.parameters.length;d++){const r=e.parameters[d],l={};l.name=r.name?.getText();const y=A(r.type,l,t,!0);if(y){if(t.parameters.length!==0){const D=e?.parent,c=D?.name?.getText();return void k(e,new Error(`'${t.name}' contexts must be the first parameter: '${c}'.`))}t.context=y;continue}let g;if((r.initializer!==void 0&&r.initializer!==null||r.questionToken!==void 0&&r.questionToken!==null)&&(l.optional=!0,r.initializer))try{g=r.initializer.kind===n.SyntaxKind.StringLiteral?r.initializer.text:r.initializer.kind===n.SyntaxKind.NumericLiteral?parseFloat(r.initializer.text):r.initializer.kind===n.SyntaxKind.TrueKeyword||r.initializer.kind===n.SyntaxKind.FalseKeyword?r.initializer.kind===n.SyntaxKind.TrueKeyword:r.initializer.kind===n.SyntaxKind.NullKeyword?null:r.initializer.kind===n.SyntaxKind.ObjectLiteralExpression||r.initializer.kind===n.SyntaxKind.ArrayLiteralExpression?r.initializer.getText():r.initializer.getText?.()}catch(D){console.warn(`Couldn't extract default value for parameter '${l.name}'`,D)}r.dotDotDotToken&&(l.rest=!0),t.parameters.push(l);const s={description:""};u.parameters[l.name]=s;const i=O.getSymbolAtLocation(r.name).getDocumentationComment(O);i&&i.length>0&&i[0].text&&(s.description=i[0].text),g!==void 0&&(s.defaultValue=g),z.set(l.name,l)}if(e.jsDoc&&e.jsDoc.length>0){const d=e.jsDoc;for(let r=0;r<d.length;r++){const l=d[r]?.tags;if(l)for(let y=0;y<l.length;y++){const g=l[y];let s=g?.tagName?.text;if(!s)continue;s=s.toLowerCase();let i=g.comment;const D=s==="hidden";if((typeof i=="string"||D)&&(typeof i=="string"&&(i=i.replace(/[\r\n]+/g,"\\n").trim()),D||!i||(i=i.split(/\\n/)[0],i&&i.length!==0))){if(i&&typeof i=="string"){const c=/\{@link(code|plain)?\s+([^}|]+)(?:\s*\|\s*([^}]+))?\}/g;let v,N=i,P=[];for(;(v=c.exec(i))!==null;){const[J,U,re,Q]=v,ie=[re.trim()];Q&&ie.push(Q.trim())}i=N,P.length>0&&s==="see"&&(u.links||(u.links=[]),u.links.push(...P))}if(s==="name"){const c=i;c!==m&&(u.name=c)}else if(s!=="description"){if(s==="summary"){const c=i;c&&(u.summary=c)}else if(s==="param"){const c=g.name?.text,v=z.get(c);if(!v){C.push(new Error(`Parameter '${c}' not found in function '${m}'.`));continue}if(g.typeExpression&&g.typeExpression.type)try{const N=g.typeExpression.type;if(N.kind===n.SyntaxKind.UnionType){const P=[];v.enums=P,N.types.forEach(J=>{if(J.kind===n.SyntaxKind.LiteralType){const U=J.literal.text;U&&P.push(U)}})}}catch(N){console.warn("Error parsing JSDoc type expression:",N)}}else if(s==="returns"||s==="return")t.returnType.description=i;else if(s==="category")u.category=i;else if(s==="hidden"){let c=!0;const v=i?.toLowerCase();v==="false"?c=!1:v!=="true"&&(c=i),c!==!1&&(u.hidden=c??!0)}}}}}}Object.keys(t.returnType).length===0&&delete t.returnType,p.push([t,u])}catch(o){k(e,new Error(`'${m}': ${o.message}`))}}}),C.length>0)throw console.warn(C),new Error("There were compilation errors.",{cause:C});if(p.length===0)throw new Error("No exported functions.");const ne=`${ae.CommonUtils.uuidV4()}-script`;try{b||C.length!==0||(F=await le(0,F,a))}catch{console.warn("Error bundling script")}const G={functions:p,commitId:ne,source:x,name:"Script",language:"typescript",compiled:F};return f&&(G.autoRun=f),G};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.4.
|
|
2
|
+
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.4.21
|
|
3
3
|
*
|
|
4
4
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.4.
|
|
2
|
+
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.4.21
|
|
3
3
|
*
|
|
4
4
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
@@ -10,7 +10,7 @@ class o {
|
|
|
10
10
|
}
|
|
11
11
|
async getWorkerWrapper() {
|
|
12
12
|
if (this.workerWrapper) return this.workerWrapper;
|
|
13
|
-
const { createCompilerWorker: r } = await import("./
|
|
13
|
+
const { createCompilerWorker: r } = await import("./SVOya_s4QLh8mezD.mjs");
|
|
14
14
|
return this.workerWrapper = await r(), this.workerWrapper;
|
|
15
15
|
}
|
|
16
16
|
async compileModule(r) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.4.
|
|
2
|
+
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.4.21
|
|
3
3
|
*
|
|
4
4
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
@@ -47,7 +47,7 @@ class u {
|
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
const s = `/**
|
|
50
|
-
* @license @sheetxl/primitives - Primitives - Base types for SheetXL functions. - v0.4.
|
|
50
|
+
* @license @sheetxl/primitives - Primitives - Base types for SheetXL functions. - v0.4.21
|
|
51
51
|
*
|
|
52
52
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
53
53
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
@@ -266,7 +266,7 @@ var v;
|
|
|
266
266
|
return n = typeof e == "string" ? tt.get(e) : rt.get(e), n || (n = v.Unknown), new n(t, r);
|
|
267
267
|
}, v.getBuiltInById = (e) => Te.get(e) || Et;
|
|
268
268
|
/**
|
|
269
|
-
* @license @sheetxl/utils - Utils - Utilities used by most SheetXL components. - v0.4.
|
|
269
|
+
* @license @sheetxl/utils - Utils - Utilities used by most SheetXL components. - v0.4.21
|
|
270
270
|
*
|
|
271
271
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
272
272
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
@@ -1568,7 +1568,7 @@ async function p() {
|
|
|
1568
1568
|
return await l();
|
|
1569
1569
|
}
|
|
1570
1570
|
const l = async () => {
|
|
1571
|
-
const { compileModule: e } = await import("./
|
|
1571
|
+
const { compileModule: e } = await import("./kt7ehOAWy04YbZVO.mjs"), n = new u((t) => e(t));
|
|
1572
1572
|
return await n.start(), n;
|
|
1573
1573
|
};
|
|
1574
1574
|
export {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.4.
|
|
2
|
+
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.4.21
|
|
3
3
|
*
|
|
4
4
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
package/browser/esm/index.mjs
CHANGED
|
@@ -1,10 +1,21 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CommonUtils as u } from "@sheetxl/utils";
|
|
2
2
|
/**
|
|
3
|
-
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.4.
|
|
3
|
+
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.4.21
|
|
4
4
|
*
|
|
5
5
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
6
6
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
7
7
|
*/
|
|
8
|
+
let i = null, n = null, e = null;
|
|
9
|
+
const p = Object.freeze({ compileTypescript: async function(t) {
|
|
10
|
+
if (!(t?.source ?? null)) return null;
|
|
11
|
+
if (n && u.deepEqual(n, t)) return i;
|
|
12
|
+
const l = await async function() {
|
|
13
|
+
if (e) return e;
|
|
14
|
+
const { TypeScriptCompiler: o } = await import("./D15akh90uxgMURMn.mjs");
|
|
15
|
+
return e = new o(), e;
|
|
16
|
+
}(), r = await l.compileModule(t);
|
|
17
|
+
return i = r, n = t, r;
|
|
18
|
+
} });
|
|
8
19
|
export {
|
|
9
|
-
|
|
20
|
+
p as ScriptingUtils
|
|
10
21
|
};
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
import { ScalarType as v } from "@sheetxl/primitives";
|
|
2
|
+
import { CommonUtils as ae } from "@sheetxl/utils";
|
|
3
|
+
/**
|
|
4
|
+
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.4.21
|
|
5
|
+
*
|
|
6
|
+
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
7
|
+
* License: The license can be found at https://www.sheetxl.com/license.
|
|
8
|
+
*/
|
|
9
|
+
let L = null, P = null;
|
|
10
|
+
const oe = { compilerOptions: { target: "esnext" } };
|
|
11
|
+
async function le(h, x, S = "/script.js", w = "__SHEETXL") {
|
|
12
|
+
try {
|
|
13
|
+
const $ = await async function() {
|
|
14
|
+
if (L) return L;
|
|
15
|
+
if (P) {
|
|
16
|
+
if (await P, !L) throw new Error("ESBuild initialization promise resolved, but instance is not available.");
|
|
17
|
+
return L;
|
|
18
|
+
}
|
|
19
|
+
let p, b;
|
|
20
|
+
P = new Promise((a, T) => {
|
|
21
|
+
p = a, b = T;
|
|
22
|
+
});
|
|
23
|
+
try {
|
|
24
|
+
const { initialize: a } = await import("./BvVnGL93zPNrNW9U.mjs");
|
|
25
|
+
return L = await a(), p(), L;
|
|
26
|
+
} catch (a) {
|
|
27
|
+
throw console.error("Failed to import or initialize esbuild:", a), P = null, b(a), a;
|
|
28
|
+
}
|
|
29
|
+
}(), A = "@sheetxl/primitives", n = `
|
|
30
|
+
export const FormulaContext = globalThis.${w}?.FormulaContext;
|
|
31
|
+
export const ScalarType = globalThis.${w}?.ScalarType;
|
|
32
|
+
export const Observable = globalThis.${w}?.Observable;
|
|
33
|
+
export const IRange = globalThis.${w}?.IRange;
|
|
34
|
+
export const FormulaError = globalThis.${w}?.FormulaError;
|
|
35
|
+
// Add more exports as needed
|
|
36
|
+
`, F = { name: "sheetxl-esbuild-in-memory", setup(p) {
|
|
37
|
+
const b = "sheetxl-" + (/* @__PURE__ */ new Date()).getTime();
|
|
38
|
+
p.onResolve({ filter: new RegExp(`^(${S.replace("/", "\\/")}|${A})$`) }, (a) => ({ path: a.path, namespace: b })), p.onResolve({ filter: /.*/ }, (a) => {
|
|
39
|
+
if (a.namespace !== b) return console.warn(`esbuild: Treating import "${a.path}" as external.`), { path: a.path, external: !0 };
|
|
40
|
+
}), p.onLoad({ filter: /.*/, namespace: b }, (a) => {
|
|
41
|
+
let T;
|
|
42
|
+
if (a.path === S) T = x;
|
|
43
|
+
else {
|
|
44
|
+
if (a.path !== A) return { errors: [{ text: `Cannot load unknown path in ${b}: ${a.path}` }] };
|
|
45
|
+
T = n;
|
|
46
|
+
}
|
|
47
|
+
return { contents: T, loader: "ts" };
|
|
48
|
+
});
|
|
49
|
+
} }, f = await $.build({ entryPoints: [S], bundle: !0, write: !1, format: "esm", plugins: [F], sourcemap: "inline", tsconfigRaw: oe, minify: !0, platform: "neutral" });
|
|
50
|
+
if (f.outputFiles && f.outputFiles.length > 0) return f.outputFiles[0].text;
|
|
51
|
+
throw f.errors && f.errors.length > 0 ? new Error(`esbuild bundling failed: ${f.errors.map((p) => p.text).join(`
|
|
52
|
+
`)}`) : new Error("esbuild did not produce an output file.");
|
|
53
|
+
} catch ($) {
|
|
54
|
+
throw console.error("esbuild bundling process failed:", $), $;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
const se = async () => `
|
|
58
|
+
interface FirstTest {
|
|
59
|
+
isTrue?: boolean;
|
|
60
|
+
}
|
|
61
|
+
`, Y = /* @__PURE__ */ new Map([["IReferenceRange", "r"], ["IRange", "l"]]), Z = /* @__PURE__ */ new Map([["IWorkbook", "workbook"], ["ISheet", "sheet"], ["ICellRanges", "ranges"], ["ICellRange", "range"], ["IFormulaContext", "context"]]), q = (h, x) => {
|
|
62
|
+
Array.from(x.keys()).forEach((S) => {
|
|
63
|
+
const w = x.get(S);
|
|
64
|
+
x.set(`${h}.${S}`, w);
|
|
65
|
+
});
|
|
66
|
+
}, ce = /* @__PURE__ */ new Map([["Scalar", "*"], ["FormulaError.Known", v.Error], ["Date", "Date"], ["JSON", "JSON"]]), de = /* @__PURE__ */ new Map([]), X = "SheetXL";
|
|
67
|
+
q(X, Y), q(X, Z), q(X, de);
|
|
68
|
+
const ue = /* @__PURE__ */ new Map([["Promise", () => ({ async: !0 })], ["Observable", () => ({ stream: !0 })]]);
|
|
69
|
+
let B = null;
|
|
70
|
+
async function pe() {
|
|
71
|
+
if (B) return B;
|
|
72
|
+
try {
|
|
73
|
+
return await (await import("./Wf8wVXnq-3fmVj-F.mjs")).initialize();
|
|
74
|
+
} catch (h) {
|
|
75
|
+
throw B = null, h;
|
|
76
|
+
} finally {
|
|
77
|
+
B = null;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
async function ye(h) {
|
|
81
|
+
const x = h?.source ?? null;
|
|
82
|
+
if (!x) return null;
|
|
83
|
+
const S = (h.disableBundle || h.declarationsOnly) ?? !1, w = [se(), pe()], $ = await Promise.all(w), A = $[0], n = $[1];
|
|
84
|
+
let F = "", f = null;
|
|
85
|
+
const p = [], b = { allowJs: !0, declaration: !1, sourceMap: !1, inlineSourceMap: !1, inlineSources: !1, isolatedModules: !0, preserveConstEnums: !1, module: 99, noResolve: !0, emitDeclarationOnly: !1, target: n.ScriptTarget.ES2020 }, a = "script", T = `${a}.ts`, _ = "lib.d.ts", H = "global.d.ts", R = { [T]: x, [_]: `
|
|
86
|
+
/**
|
|
87
|
+
* Represents the completion of an asynchronous operation
|
|
88
|
+
*/
|
|
89
|
+
interface Promise<T> {
|
|
90
|
+
/**
|
|
91
|
+
* Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
|
|
92
|
+
* resolved value cannot be modified from the callback.
|
|
93
|
+
* @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
|
|
94
|
+
* @returns A Promise for the completion of the callback.
|
|
95
|
+
*/
|
|
96
|
+
finally(onfinally?: (() => void) | undefined | null): Promise<T>;
|
|
97
|
+
}
|
|
98
|
+
`, [H]: A }, ee = { getSourceFile: (e, t, u, m) => n.createSourceFile(e, R[e], n.ScriptTarget.Latest, !0), fileExists: (e) => R[e] !== void 0, readFile: (e) => R[e], writeFile: (e, t) => {
|
|
99
|
+
R[e] = t;
|
|
100
|
+
}, getCurrentDirectory: () => "./", getCanonicalFileName: (e) => e, useCaseSensitiveFileNames: () => !0, getDefaultLibFileName: (e) => _, getNewLine: () => `
|
|
101
|
+
` }, J = n.createProgram([T, H], b, ee), I = J.getTypeChecker(), te = J.getSourceFile(T), W = J.emit();
|
|
102
|
+
W.diagnostics.length > 0 && console.warn(W.diagnostics), F = R[`${a}.js`];
|
|
103
|
+
const O = (e, t, u, m) => {
|
|
104
|
+
if (e) {
|
|
105
|
+
if (e.kind === n.SyntaxKind.NumberKeyword) t.scalar = v.Number;
|
|
106
|
+
else if (e.kind === n.SyntaxKind.StringKeyword) t.scalar = v.String;
|
|
107
|
+
else if (e.kind === n.SyntaxKind.BooleanKeyword) t.scalar = v.Boolean;
|
|
108
|
+
else if (e.kind === n.SyntaxKind.UndefinedKeyword || e.kind === n.SyntaxKind.NullKeyword || e.kind === n.SyntaxKind.VoidKeyword) {
|
|
109
|
+
if (m) return void k(e, new Error(`'undefined' is not a valid type for input: '${e?.parent?.name?.escapedText}'.`));
|
|
110
|
+
t.scalar = v.Null;
|
|
111
|
+
} else if (e.kind === n.SyntaxKind.BigIntKeyword) t.scalar = v.Number;
|
|
112
|
+
else if (e.kind === n.SyntaxKind.AnyKeyword) t.scalar = v.Null;
|
|
113
|
+
else if (e.kind === n.SyntaxKind.ArrayType) {
|
|
114
|
+
const o = e.elementType;
|
|
115
|
+
if (!o) return void k(e, new Error(`'Array' must be typed: '${e?.parent?.name?.escapedText}'.`));
|
|
116
|
+
t.arrayDepth = (t.arrayDepth ?? 0) + 1, O(o, t, u, m);
|
|
117
|
+
} else if (e.kind !== n.SyntaxKind.TupleType) {
|
|
118
|
+
if (e.kind === n.SyntaxKind.TypeReference) {
|
|
119
|
+
const o = e.typeName?.getText?.() ?? null, M = Y.get(o);
|
|
120
|
+
let E = !1;
|
|
121
|
+
M && (t.range = M, E = !0);
|
|
122
|
+
const z = ce.get(o);
|
|
123
|
+
if (z && (t.scalar = z), z !== void 0 && (E = !0), m) {
|
|
124
|
+
const r = Z.get(o);
|
|
125
|
+
if (r) return r;
|
|
126
|
+
} else {
|
|
127
|
+
const r = ue.get(o);
|
|
128
|
+
if (r) {
|
|
129
|
+
const l = { ...t, ...r() };
|
|
130
|
+
let y = 0;
|
|
131
|
+
if (l.async && y++, l.stream && y++, y > 1) return void k(e, new Error(`'${o}' cannot have multiple modifiers: '${e?.parent?.name?.escapedText}'.`));
|
|
132
|
+
t = l, E = !0;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
if (!E) return void k("node", new Error(`'${o}' is not a valid type: '${e?.parent?.name?.escapedText}'.`));
|
|
136
|
+
const d = e.typeArguments;
|
|
137
|
+
if (d) {
|
|
138
|
+
if (d.length !== 1) return void k(e, new Error(`'${o}' must be typed with exactly 1 type: '${e?.parent?.name?.escapedText}'.`));
|
|
139
|
+
O(d[0], t, u, m);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
} else k(e, new Error(`Type is not defined for '${t?.name ?? "return"}'.`));
|
|
144
|
+
}, C = [], k = (e, t) => {
|
|
145
|
+
C.push(t);
|
|
146
|
+
};
|
|
147
|
+
if (n.forEachChild(te, (e) => {
|
|
148
|
+
if (((t) => (n.getCombinedModifierFlags(t) & n.ModifierFlags.Export) !== 0)(e) && n.isFunctionDeclaration(e)) {
|
|
149
|
+
const t = {}, u = { parameters: {} }, m = e?.name?.getText();
|
|
150
|
+
try {
|
|
151
|
+
t.name = m;
|
|
152
|
+
const o = I.getSymbolAtLocation(e.name).getDocumentationComment(I);
|
|
153
|
+
if (o && o.length > 0 && o[0].text) {
|
|
154
|
+
let d = o[0].text;
|
|
155
|
+
d = d.replace(/[\r\n]+/g, "\\n").trim(), u.summary = d;
|
|
156
|
+
}
|
|
157
|
+
const M = {};
|
|
158
|
+
O(e.type, M, t, !1), t.returnType = M;
|
|
159
|
+
const E = {};
|
|
160
|
+
((d) => (n.getCombinedModifierFlags(d) & n.ModifierFlags.Default) !== 0)(e) && (E.default = !0, f = m), Object.keys(E).length > 0 && (t.behavior = E), t.parameters = [];
|
|
161
|
+
const z = /* @__PURE__ */ new Map();
|
|
162
|
+
for (let d = 0; d < e.parameters.length; d++) {
|
|
163
|
+
const r = e.parameters[d], l = {};
|
|
164
|
+
l.name = r.name?.getText();
|
|
165
|
+
const y = O(r.type, l, t, !0);
|
|
166
|
+
if (y) {
|
|
167
|
+
if (t.parameters.length !== 0) {
|
|
168
|
+
const D = e?.parent, c = D?.name?.getText();
|
|
169
|
+
return void k(e, new Error(`'${t.name}' contexts must be the first parameter: '${c}'.`));
|
|
170
|
+
}
|
|
171
|
+
t.context = y;
|
|
172
|
+
continue;
|
|
173
|
+
}
|
|
174
|
+
let g;
|
|
175
|
+
if ((r.initializer !== void 0 && r.initializer !== null || r.questionToken !== void 0 && r.questionToken !== null) && (l.optional = !0, r.initializer)) try {
|
|
176
|
+
g = r.initializer.kind === n.SyntaxKind.StringLiteral ? r.initializer.text : r.initializer.kind === n.SyntaxKind.NumericLiteral ? parseFloat(r.initializer.text) : r.initializer.kind === n.SyntaxKind.TrueKeyword || r.initializer.kind === n.SyntaxKind.FalseKeyword ? r.initializer.kind === n.SyntaxKind.TrueKeyword : r.initializer.kind === n.SyntaxKind.NullKeyword ? null : r.initializer.kind === n.SyntaxKind.ObjectLiteralExpression || r.initializer.kind === n.SyntaxKind.ArrayLiteralExpression ? r.initializer.getText() : r.initializer.getText?.();
|
|
177
|
+
} catch (D) {
|
|
178
|
+
console.warn(`Couldn't extract default value for parameter '${l.name}'`, D);
|
|
179
|
+
}
|
|
180
|
+
r.dotDotDotToken && (l.rest = !0), t.parameters.push(l);
|
|
181
|
+
const s = { description: "" };
|
|
182
|
+
u.parameters[l.name] = s;
|
|
183
|
+
const i = I.getSymbolAtLocation(r.name).getDocumentationComment(I);
|
|
184
|
+
i && i.length > 0 && i[0].text && (s.description = i[0].text), g !== void 0 && (s.defaultValue = g), z.set(l.name, l);
|
|
185
|
+
}
|
|
186
|
+
if (e.jsDoc && e.jsDoc.length > 0) {
|
|
187
|
+
const d = e.jsDoc;
|
|
188
|
+
for (let r = 0; r < d.length; r++) {
|
|
189
|
+
const l = d[r]?.tags;
|
|
190
|
+
if (l) for (let y = 0; y < l.length; y++) {
|
|
191
|
+
const g = l[y];
|
|
192
|
+
let s = g?.tagName?.text;
|
|
193
|
+
if (!s) continue;
|
|
194
|
+
s = s.toLowerCase();
|
|
195
|
+
let i = g.comment;
|
|
196
|
+
const D = s === "hidden";
|
|
197
|
+
if ((typeof i == "string" || D) && (typeof i == "string" && (i = i.replace(/[\r\n]+/g, "\\n").trim()), D || !i || (i = i.split(/\\n/)[0], i && i.length !== 0))) {
|
|
198
|
+
if (i && typeof i == "string") {
|
|
199
|
+
const c = /\{@link(code|plain)?\s+([^}|]+)(?:\s*\|\s*([^}]+))?\}/g;
|
|
200
|
+
let K, N = i, j = [];
|
|
201
|
+
for (; (K = c.exec(i)) !== null; ) {
|
|
202
|
+
const [U, V, re, Q] = K, ie = [re.trim()];
|
|
203
|
+
Q && ie.push(Q.trim());
|
|
204
|
+
}
|
|
205
|
+
i = N, j.length > 0 && s === "see" && (u.links || (u.links = []), u.links.push(...j));
|
|
206
|
+
}
|
|
207
|
+
if (s === "name") {
|
|
208
|
+
const c = i;
|
|
209
|
+
c !== m && (u.name = c);
|
|
210
|
+
} else if (s !== "description") {
|
|
211
|
+
if (s === "summary") {
|
|
212
|
+
const c = i;
|
|
213
|
+
c && (u.summary = c);
|
|
214
|
+
} else if (s === "param") {
|
|
215
|
+
const c = g.name?.text, K = z.get(c);
|
|
216
|
+
if (!K) {
|
|
217
|
+
C.push(new Error(`Parameter '${c}' not found in function '${m}'.`));
|
|
218
|
+
continue;
|
|
219
|
+
}
|
|
220
|
+
if (g.typeExpression && g.typeExpression.type) try {
|
|
221
|
+
const N = g.typeExpression.type;
|
|
222
|
+
if (N.kind === n.SyntaxKind.UnionType) {
|
|
223
|
+
const j = [];
|
|
224
|
+
K.enums = j, N.types.forEach((U) => {
|
|
225
|
+
if (U.kind === n.SyntaxKind.LiteralType) {
|
|
226
|
+
const V = U.literal.text;
|
|
227
|
+
V && j.push(V);
|
|
228
|
+
}
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
} catch (N) {
|
|
232
|
+
console.warn("Error parsing JSDoc type expression:", N);
|
|
233
|
+
}
|
|
234
|
+
} else if (s === "returns" || s === "return") t.returnType.description = i;
|
|
235
|
+
else if (s === "category") u.category = i;
|
|
236
|
+
else if (s === "hidden") {
|
|
237
|
+
let c = !0;
|
|
238
|
+
const K = i?.toLowerCase();
|
|
239
|
+
K === "false" ? c = !1 : K !== "true" && (c = i), c !== !1 && (u.hidden = c ?? !0);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
Object.keys(t.returnType).length === 0 && delete t.returnType, p.push([t, u]);
|
|
247
|
+
} catch (o) {
|
|
248
|
+
k(e, new Error(`'${m}': ${o.message}`));
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}), C.length > 0) throw console.warn(C), new Error("There were compilation errors.", { cause: C });
|
|
252
|
+
if (p.length === 0) throw new Error("No exported functions.");
|
|
253
|
+
const ne = `${ae.uuidV4()}-script`;
|
|
254
|
+
try {
|
|
255
|
+
S || C.length !== 0 || (F = await le(0, F, a));
|
|
256
|
+
} catch {
|
|
257
|
+
console.warn("Error bundling script");
|
|
258
|
+
}
|
|
259
|
+
const G = { functions: p, commitId: ne, source: x, name: "Script", language: "typescript", compiled: F };
|
|
260
|
+
return f && (G.autoRun = f), G;
|
|
261
|
+
}
|
|
262
|
+
export {
|
|
263
|
+
ye as compileModule
|
|
264
|
+
};
|
|
@@ -1,41 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Version: 0.4.20
|
|
3
|
-
License: SEE LICENSE IN <LICENSE>
|
|
4
|
-
Private: false
|
|
5
|
-
Description: Primitives - Base types for SheetXL functions.
|
|
6
|
-
License Copyright:
|
|
7
|
-
===
|
|
8
|
-
|
|
9
|
-
# Repository Licensing
|
|
10
|
-
|
|
11
|
-
SheetXL contains a mix of open-source and commercially licensed packages. Each package is individually licensed and contains its own license file.
|
|
12
|
-
|
|
13
|
-
For the specific terms and conditions applicable to a package, please see the `LICENSE.md` file located in that package's root directory.
|
|
14
|
-
|
|
15
|
-
Generally, packages intended for public distribution (such as CLIs, adapters, and vanilla wrappers) are licensed under the MIT license. All other core packages are proprietary and require a commercial license for use.
|
|
16
|
-
|
|
17
|
-
For more details on commercial licensing, please visit our website:
|
|
18
|
-
|
|
19
|
-
https://www.sheetxl.com/licensing-pricing
|
|
20
|
-
|
|
21
|
-
---
|
|
22
|
-
|
|
23
|
-
Name: @sheetxl/utils
|
|
24
|
-
Version: 0.4.20
|
|
25
|
-
License: SEE LICENSE IN <LICENSE>
|
|
26
|
-
Private: false
|
|
27
|
-
Description: Utils - Utilities used by most SheetXL components.
|
|
28
|
-
License Copyright:
|
|
29
|
-
===
|
|
30
|
-
|
|
31
|
-
# Repository Licensing
|
|
32
|
-
|
|
33
|
-
SheetXL contains a mix of open-source and commercially licensed packages. Each package is individually licensed and contains its own license file.
|
|
34
|
-
|
|
35
|
-
For the specific terms and conditions applicable to a package, please see the `LICENSE.md` file located in that package's root directory.
|
|
36
|
-
|
|
37
|
-
Generally, packages intended for public distribution (such as CLIs, adapters, and vanilla wrappers) are licensed under the MIT license. All other core packages are proprietary and require a commercial license for use.
|
|
38
|
-
|
|
39
|
-
For more details on commercial licensing, please visit our website:
|
|
40
|
-
|
|
41
|
-
https://www.sheetxl.com/licensing-pricing
|
|
1
|
+
No third parties dependencies
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.4.
|
|
2
|
+
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.4.21
|
|
3
3
|
*
|
|
4
4
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
@@ -10,7 +10,7 @@ class o {
|
|
|
10
10
|
}
|
|
11
11
|
async getWorkerWrapper() {
|
|
12
12
|
if (this.workerWrapper) return this.workerWrapper;
|
|
13
|
-
const { createCompilerWorker: r } = await import("./
|
|
13
|
+
const { createCompilerWorker: r } = await import("./DGcLty7atLj7aQX7.mjs");
|
|
14
14
|
return this.workerWrapper = await r(), this.workerWrapper;
|
|
15
15
|
}
|
|
16
16
|
async compileModule(r) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.4.
|
|
2
|
+
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.4.21
|
|
3
3
|
*
|
|
4
4
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as s from "esbuild-wasm";
|
|
2
2
|
/**
|
|
3
|
-
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.4.
|
|
3
|
+
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.4.21
|
|
4
4
|
*
|
|
5
5
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
6
6
|
* License: The license can be found at https://www.sheetxl.com/license.
|