@poe-platform/safe-bash 0.1.710 → 0.1.712
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/README.md +21 -1
- package/dist/safe-bash/commands/fmt/index.d.ts +2 -0
- package/dist/safe-bash/commands/fmt/index.d.ts.map +1 -0
- package/dist/safe-bash/commands/fmt/index.js +2 -0
- package/dist/safe-bash/commands/fmt/index.js.map +1 -0
- package/dist/safe-bash/commands/fmt.d.ts +1 -2
- package/dist/safe-bash/commands/fmt.d.ts.map +1 -1
- package/dist/safe-bash/commands/fmt.js +1 -838
- package/dist/safe-bash/commands/fmt.js.map +1 -1
- package/dist/safe-bash/commands/time-env/printenv.d.ts +1 -1
- package/dist/safe-bash/commands/time-env/printenv.d.ts.map +1 -1
- package/dist/safe-bash/commands/time-env/sleep.d.ts +1 -1
- package/dist/safe-bash/commands/time-env/sleep.d.ts.map +1 -1
- package/dist/safe-bash/core.browser.js +155 -2099
- package/dist/safe-bash/core.browser.js.map +3 -3
- package/dist/safe-bash/playwright/private-target-transport.d.ts.map +1 -1
- package/dist/safe-bash/playwright/private-target-transport.js +18 -2
- package/dist/safe-bash/playwright/private-target-transport.js.map +1 -1
- package/dist/safe-bash/playwright/profile.d.ts +3 -1
- package/dist/safe-bash/playwright/profile.d.ts.map +1 -1
- package/dist/safe-bash/playwright/profile.js +3 -3
- package/dist/safe-bash/playwright/profile.js.map +1 -1
- package/dist/safe-bash-command-exiftool/index.js +1401 -6
- package/dist/safe-bash-command-exiftool/index.js.map +7 -0
- package/dist/safe-bash-command-fmt/arguments.d.ts +8 -0
- package/dist/safe-bash-command-fmt/command.d.ts +20 -0
- package/dist/safe-bash-command-fmt/contracts.d.ts +42 -0
- package/dist/safe-bash-command-fmt/engine.d.ts +20 -0
- package/dist/safe-bash-command-fmt/index.d.ts +5 -0
- package/dist/safe-bash-command-fmt/index.js +2419 -0
- package/dist/safe-bash-command-fmt/index.js.map +7 -0
- package/dist/safe-bash-command-fmt/sdk.d.ts +15 -0
- package/dist/safe-bash-command-wkhtmltopdf/index.js +1458 -7
- package/dist/safe-bash-command-wkhtmltopdf/index.js.map +7 -0
- package/dist/safe-bash-contracts/index.d.ts +8 -0
- package/dist/safe-bash-contracts/index.js +8 -0
- package/dist/safe-playwright-cloudflare/browser-run-code.js +15 -1
- package/package.json +6 -2
- package/dist/safe-bash-command-exiftool/argfiles.js +0 -163
- package/dist/safe-bash-command-exiftool/arguments.js +0 -128
- package/dist/safe-bash-command-exiftool/command.js +0 -324
- package/dist/safe-bash-command-exiftool/csv.js +0 -78
- package/dist/safe-bash-command-exiftool/paths.js +0 -18
- package/dist/safe-bash-command-exiftool/png.js +0 -308
- package/dist/safe-bash-command-exiftool/publication.js +0 -80
- package/dist/safe-bash-command-exiftool/registry.js +0 -14
- package/dist/safe-bash-command-exiftool/resources.js +0 -29
- package/dist/safe-bash-command-exiftool/scalar.js +0 -103
- package/dist/safe-bash-command-exiftool/sdk.js +0 -113
- package/dist/safe-bash-command-exiftool/shifts.js +0 -29
- package/dist/safe-bash-command-wkhtmltopdf/command.js +0 -373
- package/dist/safe-bash-command-wkhtmltopdf/engine.js +0 -99
- package/dist/safe-bash-command-wkhtmltopdf/errors.js +0 -11
- package/dist/safe-bash-command-wkhtmltopdf/limits.js +0 -69
- package/dist/safe-bash-command-wkhtmltopdf/outcome.js +0 -38
- package/dist/safe-bash-command-wkhtmltopdf/parser.js +0 -146
- package/dist/safe-bash-command-wkhtmltopdf/resources.js +0 -284
- package/dist/safe-bash-command-wkhtmltopdf/settings.js +0 -35
- package/dist/safe-bash-command-wkhtmltopdf/switches.js +0 -127
- package/dist/safe-bash-command-wkhtmltopdf/values.js +0 -66
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { WkhtmltopdfError } from "./errors.js";
|
|
2
|
-
export function integer(text, min, max) {
|
|
3
|
-
const value = text.trim();
|
|
4
|
-
let index = value[0] === "+" || value[0] === "-" ? 1 : 0;
|
|
5
|
-
if (index === value.length)
|
|
6
|
-
throw new WkhtmltopdfError("INVALID_VALUE", "Expected an integer");
|
|
7
|
-
for (; index < value.length; index++) {
|
|
8
|
-
if (value[index] < "0" || value[index] > "9") {
|
|
9
|
-
throw new WkhtmltopdfError("INVALID_VALUE", "Expected a decimal integer");
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
const result = Number(value);
|
|
13
|
-
if (!Number.isSafeInteger(result) || result < min || result > max) {
|
|
14
|
-
throw new WkhtmltopdfError("INVALID_VALUE", "Integer is outside the admitted range");
|
|
15
|
-
}
|
|
16
|
-
return result;
|
|
17
|
-
}
|
|
18
|
-
export function float32(text, positive) {
|
|
19
|
-
const value = text.trim();
|
|
20
|
-
let digits = 0;
|
|
21
|
-
for (const character of value) {
|
|
22
|
-
if (character >= "0" && character <= "9")
|
|
23
|
-
digits++;
|
|
24
|
-
else if (!"+-.eE".includes(character)) {
|
|
25
|
-
throw new WkhtmltopdfError("INVALID_VALUE", "Expected a decimal float");
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
const result = Math.fround(Number(value));
|
|
29
|
-
if (!digits || !Number.isFinite(result) || (positive ? result <= 0 : result < 0)) {
|
|
30
|
-
throw new WkhtmltopdfError("INVALID_VALUE", "Float is outside the admitted finite binary32 range");
|
|
31
|
-
}
|
|
32
|
-
return result;
|
|
33
|
-
}
|
|
34
|
-
export function choice(text, values) {
|
|
35
|
-
const result = values.find(value => value.toLowerCase() === text.toLowerCase());
|
|
36
|
-
if (result === undefined)
|
|
37
|
-
throw new WkhtmltopdfError("INVALID_VALUE", "Unknown enumerated value");
|
|
38
|
-
return result;
|
|
39
|
-
}
|
|
40
|
-
export function length(text) {
|
|
41
|
-
let index = 0;
|
|
42
|
-
while (text[index] !== undefined && text[index] >= "0" && text[index] <= "9")
|
|
43
|
-
index++;
|
|
44
|
-
if (text[index] === ".")
|
|
45
|
-
index++;
|
|
46
|
-
while (text[index] !== undefined && text[index] >= "0" && text[index] <= "9")
|
|
47
|
-
index++;
|
|
48
|
-
const number = text.slice(0, index);
|
|
49
|
-
const value = Number(number);
|
|
50
|
-
if (!number || number === "." || !Number.isFinite(value)) {
|
|
51
|
-
throw new WkhtmltopdfError("INVALID_VALUE", "Expected an unsigned finite length");
|
|
52
|
-
}
|
|
53
|
-
const units = {
|
|
54
|
-
"": ["mm", 1], mm: ["mm", 1], millimeter: ["mm", 1],
|
|
55
|
-
cm: ["mm", 10], centimeter: ["mm", 10], m: ["mm", 1000], meter: ["mm", 1000],
|
|
56
|
-
in: ["in", 1], inch: ["in", 1], pt: ["pt", 1], point: ["pt", 1],
|
|
57
|
-
px: ["px", 1], pixel: ["px", 1], pc: ["pc", 1], pica: ["pc", 1],
|
|
58
|
-
didot: ["didot", 1], cicero: ["cicero", 1],
|
|
59
|
-
};
|
|
60
|
-
const suffix = text.slice(index).toLowerCase();
|
|
61
|
-
const entry = Object.hasOwn(units, suffix) ? units[suffix] : undefined;
|
|
62
|
-
if (!entry || !Number.isFinite(value * entry[1])) {
|
|
63
|
-
throw new WkhtmltopdfError("INVALID_VALUE", "Unknown or overflowing length unit");
|
|
64
|
-
}
|
|
65
|
-
return { value: value * entry[1], unit: entry[0] };
|
|
66
|
-
}
|