@poe-platform/safe-bash 0.1.711 → 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.
Files changed (56) hide show
  1. package/README.md +15 -1
  2. package/dist/safe-bash/commands/fmt/index.d.ts +2 -0
  3. package/dist/safe-bash/commands/fmt/index.d.ts.map +1 -0
  4. package/dist/safe-bash/commands/fmt/index.js +2 -0
  5. package/dist/safe-bash/commands/fmt/index.js.map +1 -0
  6. package/dist/safe-bash/commands/fmt.d.ts +1 -2
  7. package/dist/safe-bash/commands/fmt.d.ts.map +1 -1
  8. package/dist/safe-bash/commands/fmt.js +1 -838
  9. package/dist/safe-bash/commands/fmt.js.map +1 -1
  10. package/dist/safe-bash/commands/time-env/printenv.d.ts +1 -1
  11. package/dist/safe-bash/commands/time-env/printenv.d.ts.map +1 -1
  12. package/dist/safe-bash/commands/time-env/sleep.d.ts +1 -1
  13. package/dist/safe-bash/commands/time-env/sleep.d.ts.map +1 -1
  14. package/dist/safe-bash/core.browser.js +155 -2099
  15. package/dist/safe-bash/core.browser.js.map +3 -3
  16. package/dist/safe-bash/playwright/private-target-transport.d.ts.map +1 -1
  17. package/dist/safe-bash/playwright/private-target-transport.js +18 -2
  18. package/dist/safe-bash/playwright/private-target-transport.js.map +1 -1
  19. package/dist/safe-bash-command-exiftool/index.js +1401 -6
  20. package/dist/safe-bash-command-exiftool/index.js.map +7 -0
  21. package/dist/safe-bash-command-fmt/arguments.d.ts +8 -0
  22. package/dist/safe-bash-command-fmt/command.d.ts +20 -0
  23. package/dist/safe-bash-command-fmt/contracts.d.ts +42 -0
  24. package/dist/safe-bash-command-fmt/engine.d.ts +20 -0
  25. package/dist/safe-bash-command-fmt/index.d.ts +5 -0
  26. package/dist/safe-bash-command-fmt/index.js +2419 -0
  27. package/dist/safe-bash-command-fmt/index.js.map +7 -0
  28. package/dist/safe-bash-command-fmt/sdk.d.ts +15 -0
  29. package/dist/safe-bash-command-wkhtmltopdf/index.js +1458 -7
  30. package/dist/safe-bash-command-wkhtmltopdf/index.js.map +7 -0
  31. package/dist/safe-bash-contracts/index.d.ts +8 -0
  32. package/dist/safe-bash-contracts/index.js +8 -0
  33. package/dist/safe-playwright-cloudflare/browser-run-code.js +15 -1
  34. package/package.json +6 -2
  35. package/dist/safe-bash-command-exiftool/argfiles.js +0 -163
  36. package/dist/safe-bash-command-exiftool/arguments.js +0 -128
  37. package/dist/safe-bash-command-exiftool/command.js +0 -324
  38. package/dist/safe-bash-command-exiftool/csv.js +0 -78
  39. package/dist/safe-bash-command-exiftool/paths.js +0 -18
  40. package/dist/safe-bash-command-exiftool/png.js +0 -308
  41. package/dist/safe-bash-command-exiftool/publication.js +0 -80
  42. package/dist/safe-bash-command-exiftool/registry.js +0 -14
  43. package/dist/safe-bash-command-exiftool/resources.js +0 -29
  44. package/dist/safe-bash-command-exiftool/scalar.js +0 -103
  45. package/dist/safe-bash-command-exiftool/sdk.js +0 -113
  46. package/dist/safe-bash-command-exiftool/shifts.js +0 -29
  47. package/dist/safe-bash-command-wkhtmltopdf/command.js +0 -373
  48. package/dist/safe-bash-command-wkhtmltopdf/engine.js +0 -99
  49. package/dist/safe-bash-command-wkhtmltopdf/errors.js +0 -11
  50. package/dist/safe-bash-command-wkhtmltopdf/limits.js +0 -69
  51. package/dist/safe-bash-command-wkhtmltopdf/outcome.js +0 -38
  52. package/dist/safe-bash-command-wkhtmltopdf/parser.js +0 -146
  53. package/dist/safe-bash-command-wkhtmltopdf/resources.js +0 -284
  54. package/dist/safe-bash-command-wkhtmltopdf/settings.js +0 -35
  55. package/dist/safe-bash-command-wkhtmltopdf/switches.js +0 -127
  56. 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
- }