@poe-platform/safe-bash 0.1.778 → 0.1.779

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.
@@ -18,15 +18,15 @@ init_buffer();
18
18
  var precedence = Object.freeze({
19
19
  "|": 1,
20
20
  ",": 2,
21
- "=": 3,
22
- "|=": 3,
23
- "+=": 3,
24
- "-=": 3,
25
- "*=": 3,
26
- "/=": 3,
27
- "%=": 3,
28
- "//=": 3,
29
- "//": 4,
21
+ "//": 3,
22
+ "=": 4,
23
+ "|=": 4,
24
+ "+=": 4,
25
+ "-=": 4,
26
+ "*=": 4,
27
+ "/=": 4,
28
+ "%=": 4,
29
+ "//=": 4,
30
30
  or: 5,
31
31
  and: 6,
32
32
  "==": 7,
@@ -461,7 +461,7 @@ jq: 1 compile error`, 3);
461
461
  if (priority < minimum || stopComma && operator === ",")
462
462
  break;
463
463
  take();
464
- const assignment = priority === 3;
464
+ const assignment = priority === 4;
465
465
  if (assignment && !isPath(left))
466
466
  fail("unsupported assignment path");
467
467
  const right = expression(priority + (assignment ? 0 : 1), stopComma);
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-DC52GWRK.js";
4
4
  import {
5
5
  parse
6
- } from "./chunk-ACRMXIQC.js";
6
+ } from "./chunk-JUMF6JDJ.js";
7
7
  import {
8
8
  Budget,
9
9
  JqLimitError,
@@ -83892,7 +83892,23 @@ ${prefix2} line ${offset + line}: \`${source.split("\n")[line - 1] ?? ""}'
83892
83892
  if (patSpec.length === 0 || patSpec.includes("[.") || patSpec.includes("[=") || /\\[1-9]/.test(patSpec)) return void 0;
83893
83893
  const normPat = syncPosixRegexSource(patSpec);
83894
83894
  if (normPat === void 0) return void 0;
83895
- const jsPat = isExtended ? normPat : normPat.replace(/\\([+?()|])/g, "$1");
83895
+ let jsPat = normPat;
83896
+ if (!isExtended) {
83897
+ jsPat = "";
83898
+ let inBracket = false;
83899
+ for (let i = 0; i < normPat.length; i++) {
83900
+ const ch = normPat[i];
83901
+ if (ch === "\\") {
83902
+ const next = normPat[++i];
83903
+ if (next === void 0) return void 0;
83904
+ jsPat += !inBracket && "+?(){}|".includes(next) ? next : "\\" + next;
83905
+ } else {
83906
+ if (ch === "[") inBracket = true;
83907
+ else if (ch === "]") inBracket = false;
83908
+ jsPat += !inBracket && "+?(){}|".includes(ch) ? "\\" + ch : ch;
83909
+ }
83910
+ }
83911
+ }
83896
83912
  try {
83897
83913
  return new RegExp(jsPat);
83898
83914
  } catch {
@@ -85213,23 +85229,6 @@ ${prefix2} line ${offset + line}: \`${source.split("\n")[line - 1] ?? ""}'
85213
85229
  let l = rawLines[li];
85214
85230
  let fields2 = awkSep === void 0 || awkSep === " " ? l.split(/[ \t]+/).filter(Boolean) : l.length === 0 ? [] : l.split(awkSep);
85215
85231
  if (rowPred && !rowPred(l, fields2, li + 1)) continue;
85216
- if (subRe) {
85217
- if (subTarget === "0") {
85218
- l = l.replace(subRe, (matched) => subRep.split("&").join(matched));
85219
- fields2 = awkSep === void 0 || awkSep === " " ? l.split(/[ \t]+/).filter(Boolean) : l.length === 0 ? [] : l.split(awkSep);
85220
- } else {
85221
- const tIdx = subTarget === "NF" ? fields2.length : Number(subTarget);
85222
- if (tIdx >= 1 && tIdx <= fields2.length) {
85223
- fields2 = [...fields2];
85224
- let replaced = false;
85225
- fields2[tIdx - 1] = fields2[tIdx - 1].replace(subRe, (matched) => {
85226
- replaced = true;
85227
- return subRep.split("&").join(matched);
85228
- });
85229
- if (replaced) l = fields2.join(ofs);
85230
- }
85231
- }
85232
- }
85233
85232
  if (preAssigns.length > 0) {
85234
85233
  for (let ai = 0; ai < preAssigns.length; ai++) {
85235
85234
  const pa = preAssigns[ai];
@@ -85297,6 +85296,23 @@ ${prefix2} line ${offset + line}: \`${source.split("\n")[line - 1] ?? ""}'
85297
85296
  }
85298
85297
  }
85299
85298
  }
85299
+ if (subRe) {
85300
+ if (subTarget === "0") {
85301
+ l = l.replace(subRe, (matched) => subRep.split("&").join(matched));
85302
+ fields2 = awkSep === void 0 || awkSep === " " ? l.split(/[ \t]+/).filter(Boolean) : l.length === 0 ? [] : l.split(awkSep);
85303
+ } else {
85304
+ const tIdx = subTarget === "NF" ? fields2.length : Number(subTarget);
85305
+ if (tIdx >= 1 && tIdx <= fields2.length) {
85306
+ fields2 = [...fields2];
85307
+ let replaced = false;
85308
+ fields2[tIdx - 1] = fields2[tIdx - 1].replace(subRe, (matched) => {
85309
+ replaced = true;
85310
+ return subRep.split("&").join(matched);
85311
+ });
85312
+ if (replaced) l = fields2.join(ofs);
85313
+ }
85314
+ }
85315
+ }
85300
85316
  if (parts.length === 1 && parts[0].kind === "field" && parts[0].token === "0") {
85301
85317
  outLines.push(l);
85302
85318
  continue;
@@ -29678,9 +29678,27 @@ export class Runtime {
29678
29678
  const normPat = syncPosixRegexSource(patSpec);
29679
29679
  if (normPat === undefined)
29680
29680
  return undefined;
29681
- const jsPat = isExtended
29682
- ? normPat
29683
- : normPat.replace(/\\([+?()|])/g, "$1");
29681
+ let jsPat = normPat;
29682
+ if (!isExtended) {
29683
+ jsPat = "";
29684
+ let inBracket = false;
29685
+ for (let i = 0; i < normPat.length; i++) {
29686
+ const ch = normPat[i];
29687
+ if (ch === "\\") {
29688
+ const next = normPat[++i];
29689
+ if (next === undefined)
29690
+ return undefined;
29691
+ jsPat += !inBracket && "+?(){}|".includes(next) ? next : "\\" + next;
29692
+ }
29693
+ else {
29694
+ if (ch === "[")
29695
+ inBracket = true;
29696
+ else if (ch === "]")
29697
+ inBracket = false;
29698
+ jsPat += !inBracket && "+?(){}|".includes(ch) ? "\\" + ch : ch;
29699
+ }
29700
+ }
29701
+ }
29684
29702
  try {
29685
29703
  return new RegExp(jsPat);
29686
29704
  }
@@ -31321,27 +31339,6 @@ export class Runtime {
31321
31339
  : (l.length === 0 ? [] : l.split(awkSep));
31322
31340
  if (rowPred && !rowPred(l, fields, li + 1))
31323
31341
  continue;
31324
- if (subRe) {
31325
- if (subTarget === "0") {
31326
- l = l.replace(subRe, matched => subRep.split("&").join(matched));
31327
- fields = awkSep === undefined || awkSep === " "
31328
- ? l.split(/[ \t]+/).filter(Boolean)
31329
- : (l.length === 0 ? [] : l.split(awkSep));
31330
- }
31331
- else {
31332
- const tIdx = subTarget === "NF" ? fields.length : Number(subTarget);
31333
- if (tIdx >= 1 && tIdx <= fields.length) {
31334
- fields = [...fields];
31335
- let replaced = false;
31336
- fields[tIdx - 1] = fields[tIdx - 1].replace(subRe, matched => {
31337
- replaced = true;
31338
- return subRep.split("&").join(matched);
31339
- });
31340
- if (replaced)
31341
- l = fields.join(ofs);
31342
- }
31343
- }
31344
- }
31345
31342
  if (preAssigns.length > 0) {
31346
31343
  for (let ai = 0; ai < preAssigns.length; ai++) {
31347
31344
  const pa = preAssigns[ai];
@@ -31422,6 +31419,27 @@ export class Runtime {
31422
31419
  }
31423
31420
  }
31424
31421
  }
31422
+ if (subRe) {
31423
+ if (subTarget === "0") {
31424
+ l = l.replace(subRe, matched => subRep.split("&").join(matched));
31425
+ fields = awkSep === undefined || awkSep === " "
31426
+ ? l.split(/[ \t]+/).filter(Boolean)
31427
+ : (l.length === 0 ? [] : l.split(awkSep));
31428
+ }
31429
+ else {
31430
+ const tIdx = subTarget === "NF" ? fields.length : Number(subTarget);
31431
+ if (tIdx >= 1 && tIdx <= fields.length) {
31432
+ fields = [...fields];
31433
+ let replaced = false;
31434
+ fields[tIdx - 1] = fields[tIdx - 1].replace(subRe, matched => {
31435
+ replaced = true;
31436
+ return subRep.split("&").join(matched);
31437
+ });
31438
+ if (replaced)
31439
+ l = fields.join(ofs);
31440
+ }
31441
+ }
31442
+ }
31425
31443
  if (parts.length === 1 && parts[0].kind === "field" && parts[0].token === "0") {
31426
31444
  outLines.push(l);
31427
31445
  continue;
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  YqValueFailure,
3
3
  createYqQuerySession
4
- } from "../safe-bash/command-chunks/chunk-CUFCNL6G.js";
4
+ } from "../safe-bash/command-chunks/chunk-MTKXVRXL.js";
5
5
  import "../safe-bash/command-chunks/chunk-DC52GWRK.js";
6
6
  import "../safe-bash/command-chunks/chunk-NSEUBSOD.js";
7
7
  import "../safe-bash/command-chunks/chunk-WVWWRMFD.js";
8
8
  import "../safe-bash/command-chunks/chunk-Z47EO74H.js";
9
- import "../safe-bash/command-chunks/chunk-ACRMXIQC.js";
9
+ import "../safe-bash/command-chunks/chunk-JUMF6JDJ.js";
10
10
  import "../safe-bash/command-chunks/chunk-5PM5TEPM.js";
11
11
  import "../safe-bash/command-chunks/chunk-GZOUGVVV.js";
12
12
  import "../safe-bash/command-chunks/chunk-SNXWY3KV.js";
@@ -2,7 +2,7 @@ import {
2
2
  functions,
3
3
  moduleProgram,
4
4
  parse
5
- } from "../safe-bash/command-chunks/chunk-ACRMXIQC.js";
5
+ } from "../safe-bash/command-chunks/chunk-JUMF6JDJ.js";
6
6
  import "../safe-bash/command-chunks/chunk-UPOI7O7Y.js";
7
7
  import "../safe-bash/command-chunks/chunk-744EDSWN.js";
8
8
  import "../safe-bash/command-chunks/chunk-W3UCANZ3.js";
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  YqValueFailure,
3
3
  createYqQuerySession
4
- } from "../safe-bash/command-chunks/chunk-CUFCNL6G.js";
4
+ } from "../safe-bash/command-chunks/chunk-MTKXVRXL.js";
5
5
  import "../safe-bash/command-chunks/chunk-DC52GWRK.js";
6
6
  import "../safe-bash/command-chunks/chunk-NSEUBSOD.js";
7
7
  import "../safe-bash/command-chunks/chunk-WVWWRMFD.js";
8
8
  import "../safe-bash/command-chunks/chunk-Z47EO74H.js";
9
- import "../safe-bash/command-chunks/chunk-ACRMXIQC.js";
9
+ import "../safe-bash/command-chunks/chunk-JUMF6JDJ.js";
10
10
  import "../safe-bash/command-chunks/chunk-5PM5TEPM.js";
11
11
  import "../safe-bash/command-chunks/chunk-GZOUGVVV.js";
12
12
  import "../safe-bash/command-chunks/chunk-SNXWY3KV.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@poe-platform/safe-bash",
3
- "version": "0.1.778",
3
+ "version": "0.1.779",
4
4
  "description": "Extensible virtual shell with pluggable filesystems and streaming commands",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -841,7 +841,7 @@
841
841
  "access": "public"
842
842
  },
843
843
  "dependencies": {
844
- "@poe-platform/safe-fs": "0.1.778",
844
+ "@poe-platform/safe-fs": "0.1.779",
845
845
  "pdf-lib": "1.17.1",
846
846
  "@noble/hashes": "2.4.0",
847
847
  "pako": "3.0.1",