@poe-platform/safe-bash 0.1.750 → 0.1.752
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/dist/safe-bash/chunks/{chunk-4GK4FAT6.js → chunk-637A2MLA.js} +8 -6
- package/dist/safe-bash/chunks/{chunk-MUWJPSGN.js → chunk-B7IBQSD4.js} +7 -5
- package/dist/safe-bash/chunks/{chunk-U7DRVFRD.js → chunk-W7QHCGDH.js} +42 -9
- package/dist/safe-bash/chunks/{src-YKSQQDD3.js → src-XCSZZ35R.js} +2 -2
- package/dist/safe-bash/commands/pr/index.browser.js +1 -1
- package/dist/safe-bash/commands/text.js +11 -3
- package/dist/safe-bash/commands/time-env/shared.d.ts +1 -0
- package/dist/safe-bash/commands/time-env/shared.js +6 -5
- package/dist/safe-bash/commands/time-env/sleep.js +6 -3
- package/dist/safe-bash/core.browser.js +190 -171
- package/dist/safe-bash/shell/pattern.js +6 -1
- package/dist/safe-bash/shell/runtime.d.ts +3 -0
- package/dist/safe-bash/shell/runtime.js +246 -207
- package/dist/safe-bash-command-ssconvert/index.js +41 -8
- package/package.json +2 -2
|
@@ -1425,6 +1425,11 @@ init_platform();
|
|
|
1425
1425
|
|
|
1426
1426
|
// packages/safe-bash/src/commands/time-env/shared.ts
|
|
1427
1427
|
init_platform();
|
|
1428
|
+
var defaultSleepScheduler = {
|
|
1429
|
+
now: () => performance.now(),
|
|
1430
|
+
setTimeout: (callback, milliseconds) => setTimeout(callback, milliseconds),
|
|
1431
|
+
clearTimeout: (handle) => clearTimeout(handle)
|
|
1432
|
+
};
|
|
1428
1433
|
function settings2(options) {
|
|
1429
1434
|
const limits = {
|
|
1430
1435
|
maxArguments: Infinity,
|
|
@@ -1441,11 +1446,7 @@ function settings2(options) {
|
|
|
1441
1446
|
if (maxTimerMilliseconds !== Infinity && (!Number.isInteger(maxTimerMilliseconds) || maxTimerMilliseconds < 1 || maxTimerMilliseconds > 2147483647)) {
|
|
1442
1447
|
throw new RangeError("maxTimerMilliseconds must be between 1 and 2147483647 or Infinity");
|
|
1443
1448
|
}
|
|
1444
|
-
const scheduler = options.scheduler ??
|
|
1445
|
-
now: () => performance.now(),
|
|
1446
|
-
setTimeout: (callback, milliseconds) => setTimeout(callback, milliseconds),
|
|
1447
|
-
clearTimeout: (handle) => clearTimeout(handle)
|
|
1448
|
-
};
|
|
1449
|
+
const scheduler = options.scheduler ?? defaultSleepScheduler;
|
|
1449
1450
|
if (typeof scheduler.now !== "function" || typeof scheduler.setTimeout !== "function" || typeof scheduler.clearTimeout !== "function") {
|
|
1450
1451
|
throw new TypeError("Invalid sleep scheduler");
|
|
1451
1452
|
}
|
|
@@ -2065,6 +2066,7 @@ function prCommands(options = {}) {
|
|
|
2065
2066
|
}
|
|
2066
2067
|
|
|
2067
2068
|
export {
|
|
2069
|
+
defaultSleepScheduler,
|
|
2068
2070
|
settings2 as settings,
|
|
2069
2071
|
CommandFailure,
|
|
2070
2072
|
checkSize,
|
|
@@ -2079,4 +2081,4 @@ export {
|
|
|
2079
2081
|
createPrCommands,
|
|
2080
2082
|
prCommands
|
|
2081
2083
|
};
|
|
2082
|
-
//# sourceMappingURL=chunk-
|
|
2084
|
+
//# sourceMappingURL=chunk-637A2MLA.js.map
|
|
@@ -1425,6 +1425,11 @@ init_platform();
|
|
|
1425
1425
|
|
|
1426
1426
|
// packages/safe-bash/src/commands/time-env/shared.ts
|
|
1427
1427
|
init_platform();
|
|
1428
|
+
var defaultSleepScheduler = {
|
|
1429
|
+
now: () => performance.now(),
|
|
1430
|
+
setTimeout: (callback, milliseconds) => setTimeout(callback, milliseconds),
|
|
1431
|
+
clearTimeout: (handle) => clearTimeout(handle)
|
|
1432
|
+
};
|
|
1428
1433
|
function settings2(options) {
|
|
1429
1434
|
const limits = {
|
|
1430
1435
|
maxArguments: Infinity,
|
|
@@ -1441,11 +1446,7 @@ function settings2(options) {
|
|
|
1441
1446
|
if (maxTimerMilliseconds !== Infinity && (!Number.isInteger(maxTimerMilliseconds) || maxTimerMilliseconds < 1 || maxTimerMilliseconds > 2147483647)) {
|
|
1442
1447
|
throw new RangeError("maxTimerMilliseconds must be between 1 and 2147483647 or Infinity");
|
|
1443
1448
|
}
|
|
1444
|
-
const scheduler = options.scheduler ??
|
|
1445
|
-
now: () => performance.now(),
|
|
1446
|
-
setTimeout: (callback, milliseconds) => setTimeout(callback, milliseconds),
|
|
1447
|
-
clearTimeout: (handle) => clearTimeout(handle)
|
|
1448
|
-
};
|
|
1449
|
+
const scheduler = options.scheduler ?? defaultSleepScheduler;
|
|
1449
1450
|
if (typeof scheduler.now !== "function" || typeof scheduler.setTimeout !== "function" || typeof scheduler.clearTimeout !== "function") {
|
|
1450
1451
|
throw new TypeError("Invalid sleep scheduler");
|
|
1451
1452
|
}
|
|
@@ -2065,6 +2066,7 @@ function prCommands(options = {}) {
|
|
|
2065
2066
|
}
|
|
2066
2067
|
|
|
2067
2068
|
export {
|
|
2069
|
+
defaultSleepScheduler,
|
|
2068
2070
|
settings2 as settings,
|
|
2069
2071
|
CommandFailure,
|
|
2070
2072
|
checkSize,
|
|
@@ -52122,13 +52122,35 @@ function metadataNode(value3, charge) {
|
|
|
52122
52122
|
}
|
|
52123
52123
|
return visit(value3);
|
|
52124
52124
|
}
|
|
52125
|
+
var richUnderlines = {
|
|
52126
|
+
none: "none",
|
|
52127
|
+
single: "single",
|
|
52128
|
+
double: "double",
|
|
52129
|
+
low: "singleAccounting",
|
|
52130
|
+
error: "single",
|
|
52131
|
+
"single-line": "single",
|
|
52132
|
+
"double-line": "double",
|
|
52133
|
+
"error-line": "single",
|
|
52134
|
+
singleAccounting: "singleAccounting",
|
|
52135
|
+
doubleAccounting: "doubleAccounting"
|
|
52136
|
+
};
|
|
52125
52137
|
function writeRichString(value3, runs, xml2, charge, target = "cell") {
|
|
52126
52138
|
charge?.(value3.length);
|
|
52127
52139
|
const t2 = (text2) => xml2("t", text2.trim() !== text2 ? { "xml:space": "preserve" } : {}, escapeXlsx(encodeXlsxString(text2)));
|
|
52128
52140
|
if (!runs?.length) return t2(value3);
|
|
52129
52141
|
charge?.(runs.length);
|
|
52130
|
-
const
|
|
52131
|
-
const points = [.../* @__PURE__ */ new Set([0,
|
|
52142
|
+
const length = new TextEncoder().encode(value3).length;
|
|
52143
|
+
const points = [.../* @__PURE__ */ new Set([0, length, ...runs.flatMap((run) => [run.start, run.end])])].sort((a3, b3) => a3 - b3);
|
|
52144
|
+
let byteOffset = 0, characterOffset = 0;
|
|
52145
|
+
const characters = points.map((point) => {
|
|
52146
|
+
while (byteOffset < point && characterOffset < value3.length) {
|
|
52147
|
+
const code2 = value3.codePointAt(characterOffset);
|
|
52148
|
+
byteOffset += code2 < 128 ? 1 : code2 < 2048 ? 2 : code2 < 65536 ? 3 : 4;
|
|
52149
|
+
characterOffset += code2 > 65535 ? 2 : 1;
|
|
52150
|
+
}
|
|
52151
|
+
if (byteOffset !== point) throw new SsconvertError("invalid-request", "Invalid rich text UTF-8 boundary");
|
|
52152
|
+
return characterOffset;
|
|
52153
|
+
});
|
|
52132
52154
|
let result2 = target === "comment" ? xml2("r", {}, t2("")) : "";
|
|
52133
52155
|
for (let i4 = 0; i4 + 1 < points.length; i4++) {
|
|
52134
52156
|
charge?.(runs.length);
|
|
@@ -52144,9 +52166,11 @@ function writeRichString(value3, runs, xml2, charge, target = "cell") {
|
|
|
52144
52166
|
if (attrs.size !== void 0) properties += xml2("sz", { val: Number(attrs.size) / 1024 });
|
|
52145
52167
|
if (typeof attrs.family === "string") properties += xml2("rFont", { val: encodeXlsxString(attrs.family) });
|
|
52146
52168
|
if (typeof attrs.color === "string") properties += xml2("color", { rgb: "FF" + attrs.color.split("x").join("").toUpperCase() });
|
|
52147
|
-
if (typeof attrs.underline === "string") properties += xml2("u", {
|
|
52169
|
+
if (typeof attrs.underline === "string") properties += xml2("u", {
|
|
52170
|
+
val: Object.hasOwn(richUnderlines, attrs.underline) ? richUnderlines[attrs.underline] : "none"
|
|
52171
|
+
});
|
|
52148
52172
|
if (attrs.subscript || attrs.superscript) properties += xml2("vertAlign", { val: attrs.subscript ? "subscript" : "superscript" });
|
|
52149
|
-
result2 += xml2("r", {}, (properties || target === "comment" ? xml2("rPr", {}, properties) : "") + t2(
|
|
52173
|
+
result2 += xml2("r", {}, (properties || target === "comment" ? xml2("rPr", {}, properties) : "") + t2(value3.slice(characters[i4], characters[i4 + 1])));
|
|
52150
52174
|
}
|
|
52151
52175
|
return result2;
|
|
52152
52176
|
}
|
|
@@ -83175,7 +83199,7 @@ function createHtmlWriter(profile) {
|
|
|
83175
83199
|
closures.unshift(close);
|
|
83176
83200
|
}
|
|
83177
83201
|
}
|
|
83178
|
-
put(encoded2(new TextDecoder().decode(bytes.subarray(from, to))));
|
|
83202
|
+
put(encoded2(new TextDecoder("utf-8", { ignoreBOM: true }).decode(bytes.subarray(from, to))));
|
|
83179
83203
|
for (const closure of closures) put(closure);
|
|
83180
83204
|
}
|
|
83181
83205
|
} else if (cell) put(encoded2(await renderCellText(cell, book, context2, "preserve")));
|
|
@@ -91285,7 +91309,11 @@ function odfCellStyle(node3, parent, charge) {
|
|
|
91285
91309
|
const italic = attr4(p2, "font-style", "fo");
|
|
91286
91310
|
if (italic !== void 0) font2.Italic = italic === "italic" || italic === "oblique" ? 1 : 0;
|
|
91287
91311
|
const underline = attr4(p2, "text-underline-style", "style");
|
|
91288
|
-
if (underline !== void 0)
|
|
91312
|
+
if (underline !== void 0) {
|
|
91313
|
+
const type = attr4(p2, "text-underline-type", "style");
|
|
91314
|
+
const double = type === "double" || attr4(p2, "text-underline-width", "style") === "bold";
|
|
91315
|
+
font2.Underline = underline === "none" || type === "none" ? 0 : (double ? 2 : 1) + (attr4(p2, "text-underline-placement", "gnm") === "low" ? 2 : 0);
|
|
91316
|
+
}
|
|
91289
91317
|
const strike = attr4(p2, "text-line-through-style", "style");
|
|
91290
91318
|
if (strike !== void 0) font2.StrikeThrough = strike === "none" ? 0 : 1;
|
|
91291
91319
|
family = attr4(p2, "font-family", "fo") ?? attr4(p2, "font-name", "style") ?? family;
|
|
@@ -91798,8 +91826,13 @@ function createOdfStyles(xml2, extended, book, context2) {
|
|
|
91798
91826
|
if (f2.Bold !== void 0) text2["fo:font-weight"] = Number(f2.Bold) ? "bold" : "normal";
|
|
91799
91827
|
if (f2.Italic !== void 0) text2["fo:font-style"] = Number(f2.Italic) ? "italic" : "normal";
|
|
91800
91828
|
if (f2.Underline !== void 0) {
|
|
91801
|
-
|
|
91802
|
-
text2["style:text-underline-
|
|
91829
|
+
const underline = Number(f2.Underline), low = underline === 3 || underline === 4;
|
|
91830
|
+
text2["style:text-underline-style"] = underline ? "solid" : "none";
|
|
91831
|
+
text2["style:text-underline-type"] = underline === 2 || underline === 4 ? "double" : underline ? "single" : "none";
|
|
91832
|
+
text2["style:text-underline-width"] = "auto";
|
|
91833
|
+
text2["style:text-underline-color"] = "font-color";
|
|
91834
|
+
text2["style:text-underline-mode"] = "continuous";
|
|
91835
|
+
if (extended && low) text2["gnm:text-underline-placement"] = "low";
|
|
91803
91836
|
}
|
|
91804
91837
|
if (f2.StrikeThrough !== void 0) text2["style:text-line-through-style"] = Number(f2.StrikeThrough) ? "solid" : "none";
|
|
91805
91838
|
}
|
|
@@ -164608,4 +164641,4 @@ tslib/tslib.js:
|
|
|
164608
164641
|
@noble/ciphers/utils.js:
|
|
164609
164642
|
(*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) *)
|
|
164610
164643
|
*/
|
|
164611
|
-
//# sourceMappingURL=chunk-
|
|
164644
|
+
//# sourceMappingURL=chunk-W7QHCGDH.js.map
|
|
@@ -81,7 +81,7 @@ import {
|
|
|
81
81
|
updateWorkbook,
|
|
82
82
|
validSheetSize,
|
|
83
83
|
visitFormula
|
|
84
|
-
} from "./chunk-
|
|
84
|
+
} from "./chunk-W7QHCGDH.js";
|
|
85
85
|
import "./chunk-CVAVQZSF.js";
|
|
86
86
|
import "./chunk-RCM5PZBN.js";
|
|
87
87
|
import "./chunk-LSRHLNCR.js";
|
|
@@ -171,4 +171,4 @@ export {
|
|
|
171
171
|
validSheetSize,
|
|
172
172
|
visitFormula
|
|
173
173
|
};
|
|
174
|
-
//# sourceMappingURL=src-
|
|
174
|
+
//# sourceMappingURL=src-XCSZZ35R.js.map
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
createPrCommand,
|
|
3
3
|
createPrCommands,
|
|
4
4
|
prCommands
|
|
5
|
-
} from "../../chunks/chunk-
|
|
5
|
+
} from "../../chunks/chunk-B7IBQSD4.js";
|
|
6
6
|
import "../../chunks/chunk-BI6JV62X.js";
|
|
7
7
|
import "../../chunks/chunk-2G2T5MEM.js";
|
|
8
8
|
import "../../chunks/chunk-JYGWVGEJ.js";
|
|
@@ -2363,6 +2363,8 @@ async function executeUniqGeneral(context, preReadSource) {
|
|
|
2363
2363
|
const onlyRepeated = parsed.flags.has("d");
|
|
2364
2364
|
const onlyUnique = parsed.flags.has("u");
|
|
2365
2365
|
const identityKey = skipFields === 0 && skipCharacters === 0 && width === Infinity && !ignoreCase;
|
|
2366
|
+
const locale = context.env.LC_ALL || context.env.LC_CTYPE || context.env.LANG;
|
|
2367
|
+
const byteLocale = locale === "C" || locale === "POSIX";
|
|
2366
2368
|
const uniqDecoder = new TextDecoder("utf-8", { fatal: true, ignoreBOM: true });
|
|
2367
2369
|
const key = (bytes) => {
|
|
2368
2370
|
if (identityKey)
|
|
@@ -2376,8 +2378,14 @@ async function executeUniqGeneral(context, preReadSource) {
|
|
|
2376
2378
|
}
|
|
2377
2379
|
let result;
|
|
2378
2380
|
try {
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
+
if (byteLocale) {
|
|
2382
|
+
offset += skipCharacters;
|
|
2383
|
+
result = bytes.subarray(offset, width === Infinity ? undefined : offset + width);
|
|
2384
|
+
}
|
|
2385
|
+
else {
|
|
2386
|
+
const chars = Array.from(uniqDecoder.decode(bytes.subarray(offset)));
|
|
2387
|
+
result = encoder.encode((width === Infinity ? chars.slice(skipCharacters) : chars.slice(skipCharacters, skipCharacters + width)).join(""));
|
|
2388
|
+
}
|
|
2381
2389
|
}
|
|
2382
2390
|
catch (error) {
|
|
2383
2391
|
if (!(error instanceof TypeError))
|
|
@@ -2898,7 +2906,7 @@ export function textCommands() {
|
|
|
2898
2906
|
else {
|
|
2899
2907
|
const f1 = Number(part.slice(0, dashIdx));
|
|
2900
2908
|
const f2 = Number(part.slice(dashIdx + 1));
|
|
2901
|
-
if (f1 < 1 || f2 < f1 || f2 > 30) {
|
|
2909
|
+
if (!Number.isFinite(f2) || f1 < 1 || f2 < f1 || f2 > 30) {
|
|
2902
2910
|
okMask = false;
|
|
2903
2911
|
break;
|
|
2904
2912
|
}
|
|
@@ -4,6 +4,7 @@ export interface SleepScheduler {
|
|
|
4
4
|
setTimeout(callback: () => void, milliseconds: number): unknown;
|
|
5
5
|
clearTimeout(handle: unknown): void;
|
|
6
6
|
}
|
|
7
|
+
export declare const defaultSleepScheduler: SleepScheduler;
|
|
7
8
|
export interface TimeEnvLimits {
|
|
8
9
|
readonly maxArguments: number;
|
|
9
10
|
readonly maxArgumentBytes: number;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { writeDiagnostic } from "../../escaping.js";
|
|
2
2
|
import { FsError, writeBytes } from "../../contracts/index.js";
|
|
3
|
+
export const defaultSleepScheduler = {
|
|
4
|
+
now: () => performance.now(),
|
|
5
|
+
setTimeout: (callback, milliseconds) => setTimeout(callback, milliseconds),
|
|
6
|
+
clearTimeout: handle => clearTimeout(handle),
|
|
7
|
+
};
|
|
3
8
|
export function settings(options) {
|
|
4
9
|
const limits = { maxArguments: Infinity, maxArgumentBytes: Infinity, maxOutputBytes: Infinity,
|
|
5
10
|
maxEnvironmentEntries: Infinity, maxFormatWidth: Infinity, ...options.limits };
|
|
@@ -11,11 +16,7 @@ export function settings(options) {
|
|
|
11
16
|
if (maxTimerMilliseconds !== Infinity && (!Number.isInteger(maxTimerMilliseconds) || maxTimerMilliseconds < 1 || maxTimerMilliseconds > 2147483647)) {
|
|
12
17
|
throw new RangeError("maxTimerMilliseconds must be between 1 and 2147483647 or Infinity");
|
|
13
18
|
}
|
|
14
|
-
const scheduler = options.scheduler ??
|
|
15
|
-
now: () => performance.now(),
|
|
16
|
-
setTimeout: (callback, milliseconds) => setTimeout(callback, milliseconds),
|
|
17
|
-
clearTimeout: handle => clearTimeout(handle),
|
|
18
|
-
};
|
|
19
|
+
const scheduler = options.scheduler ?? defaultSleepScheduler;
|
|
19
20
|
if (typeof scheduler.now !== "function" || typeof scheduler.setTimeout !== "function" || typeof scheduler.clearTimeout !== "function") {
|
|
20
21
|
throw new TypeError("Invalid sleep scheduler");
|
|
21
22
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { command, CommandFailure, emit } from "./shared.js";
|
|
1
|
+
import { command, CommandFailure, defaultSleepScheduler, emit } from "./shared.js";
|
|
2
2
|
function duration(arguments_) {
|
|
3
3
|
if (!arguments_.length)
|
|
4
4
|
throw new CommandFailure("missing operand");
|
|
@@ -129,8 +129,11 @@ function delay(milliseconds, signal, configuration) {
|
|
|
129
129
|
if (!Number.isFinite(now) || Math.abs(now) > Number.MAX_SAFE_INTEGER || (previous !== undefined && now < previous)) {
|
|
130
130
|
throw new RangeError("sleep scheduler must supply finite monotonic milliseconds");
|
|
131
131
|
}
|
|
132
|
-
if (previous !== undefined)
|
|
133
|
-
|
|
132
|
+
if (previous !== undefined) {
|
|
133
|
+
// Host timers may wake early. Injected clocks can instead be coarse
|
|
134
|
+
// or frozen, so retain their scheduled-interval progress contract.
|
|
135
|
+
remaining -= scheduler === defaultSleepScheduler ? now - previous : Math.max(step, now - previous);
|
|
136
|
+
}
|
|
134
137
|
previous = now;
|
|
135
138
|
if (remaining <= 0) {
|
|
136
139
|
finish(false);
|