@ingestro/importer-react 4.0.4 → 4.0.5
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/chunk-6KU4IPD7.js +1 -0
- package/index.js +5 -5
- package/package.json +3 -2
- package/workers/javascript/index.js +1 -1
- package/chunk-QNASKSN5.js +0 -1
package/package.json
CHANGED
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ingestro/importer-react",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.5",
|
|
4
4
|
"homepage": "https://docs.ingestro.com",
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"react": "^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
7
7
|
"react-dom": "^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
+
"@babel/standalone": "7.29.1",
|
|
10
11
|
"@emotion/css": "^11.11.2",
|
|
11
12
|
"@floating-ui/react": "0.27.8",
|
|
12
13
|
"@handsontable/react-wrapper": "16.2.0",
|
|
13
14
|
"@hookform/resolvers": "^3.3.4",
|
|
14
|
-
"@nyariv/sandboxjs": "^0.8.22",
|
|
15
15
|
"axios": "1.12.0",
|
|
16
16
|
"chroma-js": "^2.1.2",
|
|
17
17
|
"comlink": "^4.3.1",
|
|
18
18
|
"date-fns": "^2.28.0",
|
|
19
19
|
"detect-file-encoding-and-language": "2.4.0",
|
|
20
20
|
"downshift": "^6.1.7",
|
|
21
|
+
"eval5": "1.4.8",
|
|
21
22
|
"file-saver": "^2.0.5",
|
|
22
23
|
"gtin": "^1.0.2",
|
|
23
24
|
"handsontable": "16.2.0",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as r}from"../../chunk-
|
|
1
|
+
import{d as r}from"../../chunk-6KU4IPD7.js";import"../../chunk-J5WOZVPO.js";import"../../chunk-EK7ODJWE.js";import{expose as m}from"comlink";m(r);
|
package/chunk-QNASKSN5.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as $}from"./chunk-J5WOZVPO.js";var E=h=>!h||typeof h!="string"?"":h.replace(/<[^>]*>/g,""),O=(h,i,d)=>{let e=h,a=[...i,{label:"rowIndex",key:"rowIndex"}];for(let u of a){let{label:g,key:o}=u,t=g.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=[],c,m=/(['"])((?:(?!\1)[^\\]|\\.)*)(\1)/g;for(;(c=m.exec(e))!==null;)r.push({start:c.index,end:c.index+c[0].length});let f=s=>r.some(n=>s>=n.start&&s<n.end),p=[new RegExp(`@${t}\\b`,"g"),new RegExp(`@${t}(?=\\W|$)`,"g")];for(let s of p){let n,l="",b=0;for(s.lastIndex=0;(n=s.exec(e))!==null;){let y=n.index;l+=e.substring(b,y),f(y)?l+=n[0]:o==="rowIndex"?l+=`row.${o}`:l+=`row["${o.trim()}"]`,b=s.lastIndex,n.index===s.lastIndex&&s.lastIndex++}for(l+=e.substring(b),e=l,r.length=0,m.lastIndex=0;(c=m.exec(e))!==null;)r.push({start:c.index,end:c.index+c[0].length})}}if(d){let u=$.getInstance().getTruthyWords(),g=$.getInstance().getFalsyWords(),o=[],t,r=/(['"])((?:(?!\1)[^\\]|\\.)*)(\1)/g;for(;(t=r.exec(e))!==null;)o.push({start:t.index,end:t.index+t[0].length});let c=f=>o.some(p=>f>=p.start&&f<p.end),m=(f,p,s)=>{let n=f;for(let l of p){let y=String(l).replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),x=new RegExp(`\\b${y}\\b`,"gi"),w="",S=0,I;for(x.lastIndex=0;(I=x.exec(n))!==null;){let F=I.index;w+=n.substring(S,F),c(F)?w+=s:w+=I[0],S=x.lastIndex,I.index===x.lastIndex&&x.lastIndex++}w+=n.substring(S),n=w}return n};e=m(e,u,"true"),e=m(e,g,"false")}return e},V=h=>h.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&").replace(/@/g,"[@]");import v from"@nyariv/sandboxjs/build/Sandbox";import k from"is-promise";var R=class{constructor(){this.formula="";this.outputData=[];this.initialize=()=>Promise.resolve();this.cleanupData=()=>{this.outputData=[]};this.setFormula=i=>(this.formula=i,Promise.resolve());this.check=()=>!0;this.parse=async(i,d,e)=>{this.outputData=[];let a=O(this.formula,d,e),u=this.generateInputValues(i,d),g=u?.[0];await this.validateFunction([g],d,a);let o=[];for(let t=0;t<u.length;t++)try{let r=async()=>{let m=await new Function("return "+a)()(u[t],t+1);return JSON.parse(JSON.stringify(m))};o.push(r())}catch{o.push(void 0);continue}return await Promise.allSettled(o).then(t=>{for(let r=0;r<t.length;r++)if(this.outputData[r]||(this.outputData[r]=[]),t[r].status==="fulfilled")this.outputData[r]=[t[r].value];else throw new Error(`Error in row ${r+1}: ${t[r].reason?.message??"Check your formula"}`)}).catch(t=>{throw new Error(t.message)}),this.outputData};this.validateFunction=async(i,d,e)=>{let a=[...d.map(p=>p.key.trim()),"rowIndex"],u=e||this.formula;if(u){let p=/row\.([a-zA-Z_][\w$]*)/g,s=u.matchAll(p);for(let n of s){let l=n[1];if(!a.includes(l))throw new Error(`Invalid variable: row.${l} is not a valid column reference`)}}let g={...v.SAFE_GLOBALS,setTimeout},o=v.SAFE_PROTOTYPES;o.set(Response,new Set);let t=new v({globals:g,prototypeWhitelist:o,executionQuota:BigInt(3e3)}),r=i[0],m=`return (${this.replaceNullishCoalescingWithLogicalOr(e||this.formula)})($$inputs)`,f={$$inputs:{...r,rowIndex:0}};try{let s=t.compileAsync(m,!0)(f),n;k(s)?n=s:n=s.run();let l=await n;this.outputData[0]=[JSON.parse(JSON.stringify(l))]}catch{throw Error("Invalid Syntax")}};this.generateInputValues=(i,d)=>{let e=[];for(let a=0;a<i.length;++a)e[a]={},d.forEach((u,g)=>{e[a][u.key.trim()]=i[a][g]??""}),e[a].rowIndex=a;return e};this.replaceNullishCoalescingWithLogicalOr=i=>i.replace(/\?\?/g,"||")}};export{E as a,O as b,V as c,R as d};
|