@sectui/operations 0.0.0-stage → 0.1.0

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 (147) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +50 -2
  3. package/dist/args.d.ts +8 -0
  4. package/dist/args.js +47 -0
  5. package/dist/args.js.map +1 -0
  6. package/dist/cli-flags.d.ts +7 -0
  7. package/dist/cli-flags.js +28 -0
  8. package/dist/cli-flags.js.map +1 -0
  9. package/dist/cli.d.ts +2 -0
  10. package/dist/cli.js +185 -0
  11. package/dist/cli.js.map +1 -0
  12. package/dist/completions.d.ts +3 -0
  13. package/dist/completions.js +113 -0
  14. package/dist/completions.js.map +1 -0
  15. package/dist/display.d.ts +4 -0
  16. package/dist/display.js +29 -0
  17. package/dist/display.js.map +1 -0
  18. package/dist/errors.d.ts +6 -0
  19. package/dist/errors.js +7 -0
  20. package/dist/errors.js.map +1 -0
  21. package/dist/index.d.ts +4 -0
  22. package/dist/index.js +5 -0
  23. package/dist/index.js.map +1 -0
  24. package/dist/operation.d.ts +64 -0
  25. package/dist/operation.js +5 -0
  26. package/dist/operation.js.map +1 -0
  27. package/dist/operations/base/alphabets.d.ts +28 -0
  28. package/dist/operations/base/alphabets.js +27 -0
  29. package/dist/operations/base/alphabets.js.map +1 -0
  30. package/dist/operations/base/base32.d.ts +33 -0
  31. package/dist/operations/base/base32.js +85 -0
  32. package/dist/operations/base/base32.js.map +1 -0
  33. package/dist/operations/base/base58.d.ts +34 -0
  34. package/dist/operations/base/base58.js +43 -0
  35. package/dist/operations/base/base58.js.map +1 -0
  36. package/dist/operations/base/base62.d.ts +28 -0
  37. package/dist/operations/base/base62.js +43 -0
  38. package/dist/operations/base/base62.js.map +1 -0
  39. package/dist/operations/base/base64.d.ts +19 -0
  40. package/dist/operations/base/base64.js +72 -0
  41. package/dist/operations/base/base64.js.map +1 -0
  42. package/dist/operations/base/base64url.d.ts +15 -0
  43. package/dist/operations/base/base64url.js +44 -0
  44. package/dist/operations/base/base64url.js.map +1 -0
  45. package/dist/operations/base/big-number.d.ts +6 -0
  46. package/dist/operations/base/big-number.js +54 -0
  47. package/dist/operations/base/big-number.js.map +1 -0
  48. package/dist/operations/color/hex-to-rgb.d.ts +14 -0
  49. package/dist/operations/color/hex-to-rgb.js +41 -0
  50. package/dist/operations/color/hex-to-rgb.js.map +1 -0
  51. package/dist/operations/data/json-format.d.ts +20 -0
  52. package/dist/operations/data/json-format.js +33 -0
  53. package/dist/operations/data/json-format.js.map +1 -0
  54. package/dist/operations/data/json.d.ts +20 -0
  55. package/dist/operations/data/json.js +59 -0
  56. package/dist/operations/data/json.js.map +1 -0
  57. package/dist/operations/data/yaml.d.ts +21 -0
  58. package/dist/operations/data/yaml.js +54 -0
  59. package/dist/operations/data/yaml.js.map +1 -0
  60. package/dist/operations/extract/extract.d.ts +55 -0
  61. package/dist/operations/extract/extract.js +129 -0
  62. package/dist/operations/extract/extract.js.map +1 -0
  63. package/dist/operations/hash/bcrypt.d.ts +16 -0
  64. package/dist/operations/hash/bcrypt.js +45 -0
  65. package/dist/operations/hash/bcrypt.js.map +1 -0
  66. package/dist/operations/hash/hashes.d.ts +10 -0
  67. package/dist/operations/hash/hashes.js +29 -0
  68. package/dist/operations/hash/hashes.js.map +1 -0
  69. package/dist/operations/hex/from-hex.d.ts +1 -0
  70. package/dist/operations/hex/from-hex.js +31 -0
  71. package/dist/operations/hex/from-hex.js.map +1 -0
  72. package/dist/operations/hex/to-hex.d.ts +31 -0
  73. package/dist/operations/hex/to-hex.js +44 -0
  74. package/dist/operations/hex/to-hex.js.map +1 -0
  75. package/dist/operations/html/entities.d.ts +2 -0
  76. package/dist/operations/html/entities.js +69 -0
  77. package/dist/operations/html/entities.js.map +1 -0
  78. package/dist/operations/html/html-decode.d.ts +1 -0
  79. package/dist/operations/html/html-decode.js +36 -0
  80. package/dist/operations/html/html-decode.js.map +1 -0
  81. package/dist/operations/html/html-encode.d.ts +8 -0
  82. package/dist/operations/html/html-encode.js +30 -0
  83. package/dist/operations/html/html-encode.js.map +1 -0
  84. package/dist/operations/text/case.d.ts +14 -0
  85. package/dist/operations/text/case.js +85 -0
  86. package/dist/operations/text/case.js.map +1 -0
  87. package/dist/operations/text/count.d.ts +19 -0
  88. package/dist/operations/text/count.js +59 -0
  89. package/dist/operations/text/count.js.map +1 -0
  90. package/dist/operations/text/line-operations.d.ts +48 -0
  91. package/dist/operations/text/line-operations.js +134 -0
  92. package/dist/operations/text/line-operations.js.map +1 -0
  93. package/dist/operations/text/lines.d.ts +13 -0
  94. package/dist/operations/text/lines.js +22 -0
  95. package/dist/operations/text/lines.js.map +1 -0
  96. package/dist/operations/text/text-operations.d.ts +37 -0
  97. package/dist/operations/text/text-operations.js +79 -0
  98. package/dist/operations/text/text-operations.js.map +1 -0
  99. package/dist/operations/url/url-decode.d.ts +8 -0
  100. package/dist/operations/url/url-decode.js +56 -0
  101. package/dist/operations/url/url-decode.js.map +1 -0
  102. package/dist/operations/url/url-encode.d.ts +8 -0
  103. package/dist/operations/url/url-encode.js +37 -0
  104. package/dist/operations/url/url-encode.js.map +1 -0
  105. package/dist/registry.d.ts +395 -0
  106. package/dist/registry.js +131 -0
  107. package/dist/registry.js.map +1 -0
  108. package/dist/template.d.ts +23 -0
  109. package/dist/template.js +198 -0
  110. package/dist/template.js.map +1 -0
  111. package/package.json +67 -4
  112. package/src/args.ts +47 -0
  113. package/src/cli-flags.ts +29 -0
  114. package/src/cli.ts +189 -0
  115. package/src/completions.ts +129 -0
  116. package/src/display.ts +29 -0
  117. package/src/errors.ts +6 -0
  118. package/src/index.ts +4 -0
  119. package/src/operation.ts +62 -0
  120. package/src/operations/base/alphabets.ts +33 -0
  121. package/src/operations/base/base32.ts +84 -0
  122. package/src/operations/base/base58.ts +45 -0
  123. package/src/operations/base/base62.ts +44 -0
  124. package/src/operations/base/base64.ts +76 -0
  125. package/src/operations/base/base64url.ts +45 -0
  126. package/src/operations/base/big-number.ts +54 -0
  127. package/src/operations/color/hex-to-rgb.ts +42 -0
  128. package/src/operations/data/json-format.ts +33 -0
  129. package/src/operations/data/json.ts +53 -0
  130. package/src/operations/data/yaml.ts +56 -0
  131. package/src/operations/extract/extract.ts +135 -0
  132. package/src/operations/hash/bcrypt.ts +44 -0
  133. package/src/operations/hash/hashes.ts +64 -0
  134. package/src/operations/hex/from-hex.ts +31 -0
  135. package/src/operations/hex/to-hex.ts +46 -0
  136. package/src/operations/html/entities.ts +71 -0
  137. package/src/operations/html/html-decode.ts +36 -0
  138. package/src/operations/html/html-encode.ts +31 -0
  139. package/src/operations/text/case.ts +140 -0
  140. package/src/operations/text/count.ts +61 -0
  141. package/src/operations/text/line-operations.ts +144 -0
  142. package/src/operations/text/lines.ts +22 -0
  143. package/src/operations/text/text-operations.ts +85 -0
  144. package/src/operations/url/url-decode.ts +55 -0
  145. package/src/operations/url/url-encode.ts +38 -0
  146. package/src/registry.ts +152 -0
  147. package/src/template.ts +214 -0
@@ -0,0 +1,54 @@
1
+ import { OperationError } from "../../errors.js";
2
+ /**
3
+ * Encodes bytes as a big number in the given base. Each leading zero byte becomes the alphabet's
4
+ * first character, so they survive a round trip (as in Bitcoin's Base58).
5
+ */
6
+ export function encodeBaseX(input, alphabet) {
7
+ const base = alphabet.length;
8
+ let zeros = 0;
9
+ while (zeros < input.length && input[zeros] === 0)
10
+ zeros++;
11
+ // Little-endian digits of the number.
12
+ const digits = [];
13
+ for (let i = zeros; i < input.length; i++) {
14
+ let carry = input[i];
15
+ for (let j = 0; j < digits.length; j++) {
16
+ carry += digits[j] << 8;
17
+ digits[j] = carry % base;
18
+ carry = Math.floor(carry / base);
19
+ }
20
+ while (carry > 0) {
21
+ digits.push(carry % base);
22
+ carry = Math.floor(carry / base);
23
+ }
24
+ }
25
+ return (alphabet[0].repeat(zeros) +
26
+ digits
27
+ .reverse()
28
+ .map((d) => alphabet[d])
29
+ .join(""));
30
+ }
31
+ export function decodeBaseX(text, alphabet, name) {
32
+ const base = alphabet.length;
33
+ let zeros = 0;
34
+ while (zeros < text.length && text[zeros] === alphabet[0])
35
+ zeros++;
36
+ // Little-endian bytes of the number.
37
+ const bytes = [];
38
+ for (let i = zeros; i < text.length; i++) {
39
+ let carry = alphabet.indexOf(text[i]);
40
+ if (carry < 0)
41
+ throw new OperationError(`Invalid ${name}: unexpected character "${text[i]}"`);
42
+ for (let j = 0; j < bytes.length; j++) {
43
+ carry += bytes[j] * base;
44
+ bytes[j] = carry & 0xff;
45
+ carry >>= 8;
46
+ }
47
+ while (carry > 0) {
48
+ bytes.push(carry & 0xff);
49
+ carry >>= 8;
50
+ }
51
+ }
52
+ return new Uint8Array([...new Array(zeros).fill(0), ...bytes.reverse()]);
53
+ }
54
+ //# sourceMappingURL=big-number.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"big-number.js","sourceRoot":"","sources":["../../../src/operations/base/big-number.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,KAAiB,EAAE,QAAgB;IAC7D,MAAM,IAAI,GAAG,QAAQ,CAAC,MAAM,CAAC;IAC7B,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,OAAO,KAAK,GAAG,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC;QAAE,KAAK,EAAE,CAAC;IAC3D,sCAAsC;IACtC,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,KAAK,IAAI,CAAC,GAAG,KAAK,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAC1C,IAAI,KAAK,GAAG,KAAK,CAAC,CAAC,CAAE,CAAC;QACtB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACvC,KAAK,IAAI,MAAM,CAAC,CAAC,CAAE,IAA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KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACtC,KAAK,IAAI,KAAK,CAAC,CAAC,CAAE,GAAG,IAAI,CAAC;YAC1B,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,GAAG,IAAI,CAAC;YACxB,KAAK,KAAK,CAAC,CAAC;QACd,CAAC;QACD,OAAO,KAAK,GAAG,CAAC,EAAE,CAAC;YACjB,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC;YACzB,KAAK,KAAK,CAAC,CAAC;QACd,CAAC;IACH,CAAC;IACD,OAAO,IAAI,UAAU,CAAC,CAAC,GAAG,IAAI,KAAK,CAAS,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;AACnF,CAAC"}
@@ -0,0 +1,14 @@
1
+ export declare const hexToRgb: import("../../operation.ts").Operation<"hex-to-rgb", {
2
+ readonly format: {
3
+ readonly type: "select";
4
+ readonly name: "Format";
5
+ readonly options: readonly [{
6
+ readonly value: "css";
7
+ readonly label: "CSS: rgb(255, 136, 0) or rgba(255, 136, 0, 0.5)";
8
+ }, {
9
+ readonly value: "values";
10
+ readonly label: "Values: 255, 136, 0";
11
+ }];
12
+ readonly default: "css";
13
+ };
14
+ }, never>;
@@ -0,0 +1,41 @@
1
+ import { OperationError } from "../../errors.js";
2
+ import { defineOperation } from "../../operation.js";
3
+ import { mapLines, mapText } from "../text/lines.js";
4
+ const FORMATS = [
5
+ { value: "css", label: "CSS: rgb(255, 136, 0) or rgba(255, 136, 0, 0.5)" },
6
+ { value: "values", label: "Values: 255, 136, 0" },
7
+ ];
8
+ function toRgb(color, format) {
9
+ const hex = color.trim().replace(/^#/, "");
10
+ if (!/^(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i.test(hex)) {
11
+ throw new OperationError(`Invalid hex color "${color.trim()}": expected #rgb, #rgba, #rrggbb or #rrggbbaa`);
12
+ }
13
+ const full = hex.length <= 4 ? [...hex].map((c) => c + c).join("") : hex;
14
+ const [r, g, b, a] = full.match(/../g).map((pair) => parseInt(pair, 16));
15
+ const values = [r, g, b];
16
+ // Alpha as a fraction, rounded to what 8 bits can tell apart.
17
+ if (a !== undefined)
18
+ values.push(Math.round((a / 255) * 1000) / 1000);
19
+ if (format === "values")
20
+ return values.join(", ");
21
+ return `${a === undefined ? "rgb" : "rgba"}(${values.join(", ")})`;
22
+ }
23
+ export const hexToRgb = defineOperation({
24
+ id: "hex-to-rgb",
25
+ name: "Hex to RGB",
26
+ description: 'Converts hex colors (one per line) to RGB. e.g. "#ff8800" becomes "rgb(255, 136, 0)".',
27
+ category: "Data format",
28
+ output: "binary",
29
+ aliases: ["color", "colour", "css color"],
30
+ infoUrl: "https://developer.mozilla.org/docs/Web/CSS/hex-color",
31
+ args: {
32
+ format: { type: "select", name: "Format", options: FORMATS, default: "css" },
33
+ },
34
+ examples: [
35
+ { input: "#ff8800", output: "rgb(255, 136, 0)" },
36
+ { input: "#f80\n#FF880080", output: "rgb(255, 136, 0)\nrgba(255, 136, 0, 0.502)" },
37
+ { input: "ff8800", args: { format: "values" }, output: "255, 136, 0" },
38
+ ],
39
+ run: (input, { format }) => mapText(input, (text) => mapLines(text, (lines) => lines.map((line) => (line.trim() ? toRgb(line, format) : line)))),
40
+ });
41
+ //# sourceMappingURL=hex-to-rgb.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hex-to-rgb.js","sourceRoot":"","sources":["../../../src/operations/color/hex-to-rgb.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAErD,MAAM,OAAO,GAAG;IACd,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operation<"json-format", {
2
+ readonly indent: {
3
+ readonly type: "select";
4
+ readonly name: "Indentation";
5
+ readonly options: readonly [{
6
+ readonly value: "2";
7
+ readonly label: "2 spaces";
8
+ }, {
9
+ readonly value: "4";
10
+ readonly label: "4 spaces";
11
+ }, {
12
+ readonly value: "tab";
13
+ readonly label: "Tab";
14
+ }, {
15
+ readonly value: "minify";
16
+ readonly label: "None, on a single line";
17
+ }];
18
+ readonly default: "2";
19
+ };
20
+ }, never>;
@@ -0,0 +1,33 @@
1
+ import { defineOperation } from "../../operation.js";
2
+ import { mapText } from "../text/lines.js";
3
+ import { formatJson, INDENT_STRINGS, JSON_INDENTS } from "./json.js";
4
+ export const jsonFormat = defineOperation({
5
+ id: "json-format",
6
+ name: "JSON format",
7
+ description: "Pretty-prints or minifies JSON. Numbers are kept digit for digit, and keys in their original order.",
8
+ category: "Data format",
9
+ output: "binary",
10
+ aliases: ["json beautify", "json prettify", "json minify", "jq"],
11
+ infoUrl: "https://www.json.org",
12
+ args: {
13
+ indent: {
14
+ type: "select",
15
+ name: "Indentation",
16
+ options: JSON_INDENTS,
17
+ default: "2",
18
+ },
19
+ },
20
+ examples: [
21
+ {
22
+ input: '{"a":1,"b":[true,null],"c":{}}',
23
+ output: '{\n "a": 1,\n "b": [\n true,\n null\n ],\n "c": {}\n}',
24
+ },
25
+ {
26
+ input: '{ "id": 12345678901234567890,\n "tags": [ "x" ] }',
27
+ args: { indent: "minify" },
28
+ output: '{"id":12345678901234567890,"tags":["x"]}',
29
+ },
30
+ ],
31
+ run: (input, { indent }) => mapText(input, (text) => formatJson(text, INDENT_STRINGS[indent])),
32
+ });
33
+ //# sourceMappingURL=json-format.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json-format.js","sourceRoot":"","sources":["../../../src/operations/data/json-format.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAErE,MAAM,CAAC,MAAM,UAAU,GAAG,eAAe,CAAC;IACxC,EAAE,EAAE,aAAa;IACjB,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,qGAAqG;IAClH,QAAQ,EAAE,aAAa;IACvB,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,CAAC,eAAe,EAAE,eAAe,EAAE,aAAa,EAAE,IAAI,CAAC;IAChE,OAAO,EAAE,sBAAsB;IAC/B,IAAI,EAAE;QACJ,MAAM,EAAE;YACN,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,aAAa;YACnB,OAAO,EAAE,YAAY;YACrB,OAAO,EAAE,GAAG;SACb;KACF;IACD,QAAQ,EAAE;QACR;YACE,KAAK,EAAE,gCAAgC;YACvC,MAAM,EAAE,iEAAiE;SAC1E;QACD;YACE,KAAK,EAAE,oDAAoD;YAC3D,IAAI,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE;YAC1B,MAAM,EAAE,0CAA0C;SACnD;KACF;IACD,GAAG,EAAE,CAAC,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;CAC/F,CAAC,CAAC"}
@@ -0,0 +1,20 @@
1
+ export declare function parseJson(text: string): unknown;
2
+ /**
3
+ * Re-indents valid JSON without parsing values, so numbers keep their exact digits (no precision
4
+ * loss on large integers) and key order and duplicate keys are preserved. An empty `indent` minifies.
5
+ */
6
+ export declare function formatJson(text: string, indent: string): string;
7
+ export declare const JSON_INDENTS: readonly [{
8
+ readonly value: "2";
9
+ readonly label: "2 spaces";
10
+ }, {
11
+ readonly value: "4";
12
+ readonly label: "4 spaces";
13
+ }, {
14
+ readonly value: "tab";
15
+ readonly label: "Tab";
16
+ }, {
17
+ readonly value: "minify";
18
+ readonly label: "None, on a single line";
19
+ }];
20
+ export declare const INDENT_STRINGS: Record<(typeof JSON_INDENTS)[number]["value"], string>;
@@ -0,0 +1,59 @@
1
+ import { OperationError } from "../../errors.js";
2
+ export function parseJson(text) {
3
+ try {
4
+ return JSON.parse(text);
5
+ }
6
+ catch (error) {
7
+ throw new OperationError(`Invalid JSON: ${error.message}`);
8
+ }
9
+ }
10
+ // Strings, or runs of anything else that is not whitespace or punctuation (numbers, literals).
11
+ const TOKEN = /"(?:[^"\\]|\\.)*"|[{}[\],:]|[^\s{}[\],:"]+/g;
12
+ /**
13
+ * Re-indents valid JSON without parsing values, so numbers keep their exact digits (no precision
14
+ * loss on large integers) and key order and duplicate keys are preserved. An empty `indent` minifies.
15
+ */
16
+ export function formatJson(text, indent) {
17
+ parseJson(text);
18
+ const tokens = text.match(TOKEN) ?? [];
19
+ const newline = (depth) => (indent ? "\n" + indent.repeat(depth) : "");
20
+ let out = "";
21
+ let depth = 0;
22
+ for (const [i, token] of tokens.entries()) {
23
+ const next = tokens[i + 1];
24
+ if (token === "{" || token === "[") {
25
+ // Keep empty objects and arrays on one line.
26
+ if (next === "}" || next === "]")
27
+ out += token;
28
+ else
29
+ out += token + newline(++depth);
30
+ }
31
+ else if (token === "}" || token === "]") {
32
+ const previous = tokens[i - 1];
33
+ if (previous === "{" || previous === "[")
34
+ out += token;
35
+ else
36
+ out += newline(--depth) + token;
37
+ }
38
+ else if (token === ",")
39
+ out += "," + newline(depth);
40
+ else if (token === ":")
41
+ out += indent ? ": " : ":";
42
+ else
43
+ out += token;
44
+ }
45
+ return out;
46
+ }
47
+ export const JSON_INDENTS = [
48
+ { value: "2", label: "2 spaces" },
49
+ { value: "4", label: "4 spaces" },
50
+ { value: "tab", label: "Tab" },
51
+ { value: "minify", label: "None, on a single line" },
52
+ ];
53
+ export const INDENT_STRINGS = {
54
+ "2": " ",
55
+ "4": " ",
56
+ tab: "\t",
57
+ minify: "",
58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,KAAK,GAAG,OAAO,CAAC,EAAE,KAAK,CAAC,CAAC;QACvC,CAAC;aAAM,IAAI,KAAK,KAAK,GAAG,IAAI,KAAK,KAAK,GAAG,EAAE,CAAC;YAC1C,MAAM,QAAQ,GAAG,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;YAC/B,IAAI,QAAQ,KAAK,GAAG,IAAI,QAAQ,KAAK,GAAG;gBAAE,GAAG,IAAI,KAAK,CAAC;;gBAClD,GAAG,IAAI,OAAO,CAAC,EAAE,KAAK,CAAC,GAAG,KAAK,CAAC;QACvC,CAAC;aAAM,IAAI,KAAK,KAAK,GAAG;YAAE,GAAG,IAAI,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;aACjD,IAAI,KAAK,KAAK,GAAG;YAAE,GAAG,IAAI,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC;;YAC9C,GAAG,IAAI,KAAK,CAAC;IACpB,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,UAAU,EAAE;IACjC,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,UAAU,EAAE;IACjC,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE;IAC9B,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,wBAAwB,EAAE;CAC5C,CAAC;AAEX,MAAM,CAAC,MAAM,cAAc,GAA2D;IACpF,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,MAAM;IACX,GAAG,EAAE,IAAI;IACT,MAAM,EAAE,EAAE;CACX,CAAC"}
@@ -0,0 +1,21 @@
1
+ export declare const jsonToYaml: import("../../operation.ts").Operation<"json-to-yaml", {}, "yaml-to-json">;
2
+ export declare const yamlToJson: import("../../operation.ts").Operation<"yaml-to-json", {
3
+ readonly indent: {
4
+ readonly type: "select";
5
+ readonly name: "Indentation";
6
+ readonly options: readonly [{
7
+ readonly value: "2";
8
+ readonly label: "2 spaces";
9
+ }, {
10
+ readonly value: "4";
11
+ readonly label: "4 spaces";
12
+ }, {
13
+ readonly value: "tab";
14
+ readonly label: "Tab";
15
+ }, {
16
+ readonly value: "minify";
17
+ readonly label: "None, on a single line";
18
+ }];
19
+ readonly default: "2";
20
+ };
21
+ }, "json-to-yaml">;
@@ -0,0 +1,54 @@
1
+ import YAML from "yaml";
2
+ import { OperationError } from "../../errors.js";
3
+ import { defineOperation } from "../../operation.js";
4
+ import { mapText } from "../text/lines.js";
5
+ import { INDENT_STRINGS, JSON_INDENTS, parseJson } from "./json.js";
6
+ export const jsonToYaml = defineOperation({
7
+ id: "json-to-yaml",
8
+ name: "JSON to YAML",
9
+ description: 'Converts JSON to YAML. Strings that some YAML parsers would read as another type, such as "yes", are quoted.',
10
+ category: "Data format",
11
+ output: "binary",
12
+ aliases: ["yaml"],
13
+ inverse: "yaml-to-json",
14
+ infoUrl: "https://yaml.org",
15
+ args: {},
16
+ examples: [
17
+ { input: '{"name":"ops","tags":["a","b"],"count":1}', output: "name: ops\ntags:\n - a\n - b\ncount: 1\n" },
18
+ { input: '{"enabled":"yes"}', output: 'enabled: "yes"\n' },
19
+ ],
20
+ run: (input) => mapText(input, (text) => {
21
+ parseJson(text);
22
+ // JSON is valid YAML: parsing it as such keeps large integers exact.
23
+ // YAML 1.1 rules quote strings like "yes" or "off" that older parsers would read as booleans.
24
+ return YAML.stringify(YAML.parse(text, { intAsBigInt: true }), { version: "1.1" });
25
+ }),
26
+ });
27
+ export const yamlToJson = defineOperation({
28
+ id: "yaml-to-json",
29
+ name: "YAML to JSON",
30
+ description: "Converts a YAML document to JSON.",
31
+ category: "Data format",
32
+ output: "binary",
33
+ aliases: ["yml", "yaml"],
34
+ inverse: "json-to-yaml",
35
+ infoUrl: "https://yaml.org",
36
+ args: {
37
+ indent: { type: "select", name: "Indentation", options: JSON_INDENTS, default: "2" },
38
+ },
39
+ examples: [
40
+ { input: "name: ops\ntags: [a, b]\nn: 1\n", args: { indent: "minify" }, output: '{"name":"ops","tags":["a","b"],"n":1}' },
41
+ { input: "a:\n - true\n - ~\n", output: '{\n "a": [\n true,\n null\n ]\n}' },
42
+ ],
43
+ run: (input, { indent }) => mapText(input, (text) => {
44
+ let value;
45
+ try {
46
+ value = YAML.parse(text);
47
+ }
48
+ catch (error) {
49
+ throw new OperationError(`Invalid YAML: ${error.message}`);
50
+ }
51
+ return JSON.stringify(value ?? null, null, INDENT_STRINGS[indent]);
52
+ }),
53
+ });
54
+ //# sourceMappingURL=yaml.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"yaml.js","sourceRoot":"","sources":["../../../src/operations/data/yaml.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEpE,MAAM,CAAC,MAAM,UAAU,GAAG,eAAe,CAAC;IACxC,EAAE,EAAE,cAAc;IAClB,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,8GAA8G;IAC3H,QAAQ,EAAE,aAAa;IACvB,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,CAAC,MAAM,CAAC;IACjB,OAAO,EAAE,cAAc;IACvB,OAAO,EAAE,kBAAkB;IAC3B,IAAI,EAAE,EAAE;IACR,QAAQ,EAAE;QACR,EAAE,KAAK,EAAE,2CAA2C,EAAE,MAAM,EAAE,4CAA4C,EAAE;QAC5G,EAAE,KAAK,EAAE,mBAAmB,EAAE,MAAM,EAAE,kBAAkB,EAAE;KAC3D;IACD,GAAG,EAAE,CAAC,KAAK,EAAE,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AAkB,KAAe,CAAC,OAAO,EAAE,CAAC,CAAC;QACxE,CAAC;QACD,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,IAAI,IAAI,EAAE,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;IACrE,CAAC,CAAC;CACL,CAAC,CAAC"}
@@ -0,0 +1,55 @@
1
+ export declare function isIPv6(text: string): boolean;
2
+ export declare const extractIps: import("../../operation.ts").Operation<"extract-ips", {
3
+ readonly unique: {
4
+ readonly type: "boolean";
5
+ readonly name: "Unique";
6
+ readonly description: "Only list each value once.";
7
+ readonly default: false;
8
+ };
9
+ readonly sort: {
10
+ readonly type: "boolean";
11
+ readonly name: "Sort";
12
+ readonly default: false;
13
+ };
14
+ readonly version: {
15
+ readonly type: "select";
16
+ readonly name: "Version";
17
+ readonly options: readonly [{
18
+ readonly value: "both";
19
+ readonly label: "IPv4 and IPv6";
20
+ }, {
21
+ readonly value: "ipv4";
22
+ readonly label: "IPv4 only";
23
+ }, {
24
+ readonly value: "ipv6";
25
+ readonly label: "IPv6 only";
26
+ }];
27
+ readonly default: "both";
28
+ };
29
+ }, never>;
30
+ export declare const extractEmails: import("../../operation.ts").Operation<"extract-emails", {
31
+ readonly unique: {
32
+ readonly type: "boolean";
33
+ readonly name: "Unique";
34
+ readonly description: "Only list each value once.";
35
+ readonly default: false;
36
+ };
37
+ readonly sort: {
38
+ readonly type: "boolean";
39
+ readonly name: "Sort";
40
+ readonly default: false;
41
+ };
42
+ }, never>;
43
+ export declare const extractUrls: import("../../operation.ts").Operation<"extract-urls", {
44
+ readonly unique: {
45
+ readonly type: "boolean";
46
+ readonly name: "Unique";
47
+ readonly description: "Only list each value once.";
48
+ readonly default: false;
49
+ };
50
+ readonly sort: {
51
+ readonly type: "boolean";
52
+ readonly name: "Sort";
53
+ readonly default: false;
54
+ };
55
+ }, never>;
@@ -0,0 +1,129 @@
1
+ import { defineOperation } from "../../operation.js";
2
+ import { mapText } from "../text/lines.js";
3
+ const OCTET = "(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)";
4
+ // Not part of a longer dotted sequence such as a version number (1.2.3.4.5).
5
+ const IPV4 = new RegExp(`(?<![\\d.])${OCTET}(?:\\.${OCTET}){3}(?!\\.?\\d)`, "g");
6
+ // Candidates, checked by isIPv6: runs of hex digits, colons and dots with at least two colons.
7
+ const IPV6_CANDIDATE = /(?<![\w:.])[0-9a-f]*:[0-9a-f.:]*:[0-9a-f.]*(?![\w:])/gi;
8
+ const IPV4_EXACT = new RegExp(`^${OCTET}(?:\\.${OCTET}){3}$`);
9
+ export function isIPv6(text) {
10
+ const halves = text.split("::");
11
+ if (halves.length > 2)
12
+ return false;
13
+ let groups = 0;
14
+ for (const [h, half] of halves.entries()) {
15
+ if (half === "")
16
+ continue;
17
+ const parts = half.split(":");
18
+ for (const [i, part] of parts.entries()) {
19
+ // An embedded IPv4 address (::ffff:1.2.3.4) counts as two groups and must come last.
20
+ if (h === halves.length - 1 && i === parts.length - 1 && IPV4_EXACT.test(part))
21
+ groups += 2;
22
+ else if (/^[0-9a-f]{1,4}$/i.test(part))
23
+ groups++;
24
+ else
25
+ return false;
26
+ }
27
+ }
28
+ return halves.length === 2 ? groups < 8 : groups === 8;
29
+ }
30
+ function* matches(text, pattern) {
31
+ for (const m of text.matchAll(pattern))
32
+ yield { index: m.index, value: m[0] };
33
+ }
34
+ const listArgs = {
35
+ unique: { type: "boolean", name: "Unique", description: "Only list each value once.", default: false },
36
+ sort: { type: "boolean", name: "Sort", default: false },
37
+ };
38
+ function list(found, { unique, sort }) {
39
+ let values = [...found].sort((a, b) => a.index - b.index).map((m) => m.value);
40
+ if (unique)
41
+ values = [...new Set(values)];
42
+ if (sort)
43
+ values.sort();
44
+ return values.join("\n");
45
+ }
46
+ const IP_VERSIONS = [
47
+ { value: "both", label: "IPv4 and IPv6" },
48
+ { value: "ipv4", label: "IPv4 only" },
49
+ { value: "ipv6", label: "IPv6 only" },
50
+ ];
51
+ export const extractIps = defineOperation({
52
+ id: "extract-ips",
53
+ name: "Extract IP addresses",
54
+ description: "Lists the IPv4 and IPv6 addresses found in the text, one per line.",
55
+ category: "Extractors",
56
+ output: "binary",
57
+ aliases: ["ipv4", "ipv6", "find ip", "grep ip"],
58
+ args: {
59
+ version: { type: "select", name: "Version", options: IP_VERSIONS, default: "both" },
60
+ ...listArgs,
61
+ },
62
+ examples: [
63
+ { input: "from 10.0.0.1 to 2001:db8::1, not 1.2.3.4.5 or 256.1.1.1", output: "10.0.0.1\n2001:db8::1" },
64
+ { input: "::1 ::ffff:192.168.1.1 8.8.8.8", args: { version: "ipv4" }, output: "8.8.8.8" },
65
+ ],
66
+ run(input, { version, unique, sort }) {
67
+ return mapText(input, (text) => {
68
+ const v6 = [...matches(text, IPV6_CANDIDATE)]
69
+ // Drop the final dot of a sentence.
70
+ .map((m) => ({ index: m.index, value: m.value.replace(/\.$/, "") }))
71
+ .filter((m) => isIPv6(m.value));
72
+ // IPv4 addresses embedded in an IPv6 one are not listed on their own.
73
+ const v4 = [...matches(text, IPV4)].filter((m) => !v6.some((v) => m.index >= v.index && m.index < v.index + v.value.length));
74
+ const found = version === "ipv4" ? v4 : version === "ipv6" ? v6 : [...v4, ...v6];
75
+ return list(found, { unique, sort });
76
+ });
77
+ },
78
+ });
79
+ const EMAIL = /[\p{L}\p{N}!#$%&'*+/=?^_`{|}~-]+(?:\.[\p{L}\p{N}!#$%&'*+/=?^_`{|}~-]+)*@(?:[\p{L}\p{N}](?:[\p{L}\p{N}-]*[\p{L}\p{N}])?\.)+\p{L}[\p{L}\p{N}-]*[\p{L}\p{N}]/gu;
80
+ export const extractEmails = defineOperation({
81
+ id: "extract-emails",
82
+ name: "Extract email addresses",
83
+ description: "Lists the email addresses found in the text, one per line.",
84
+ category: "Extractors",
85
+ output: "binary",
86
+ aliases: ["find email", "grep email"],
87
+ args: listArgs,
88
+ examples: [
89
+ { input: "Contact: <john.doe@example.com>, jane+tag@mail.example.org.", output: "john.doe@example.com\njane+tag@mail.example.org" },
90
+ { input: "b@x.io a@x.io b@x.io", args: { unique: true, sort: true }, output: "a@x.io\nb@x.io" },
91
+ ],
92
+ run: (input, args) => mapText(input, (text) => list(matches(text, EMAIL), args)),
93
+ });
94
+ // A scheme followed by "://", up to whitespace, quotes or angle brackets.
95
+ const URL_PATTERN = /\b[a-z][a-z0-9+.-]*:\/\/[^\s<>"'`]+/gi;
96
+ /** Removes punctuation that more likely ends the sentence than the URL, and unbalanced closing brackets. */
97
+ function trimUrl(url) {
98
+ for (;;) {
99
+ const last = url.at(-1);
100
+ if (/[.,;:!?*]/.test(last))
101
+ url = url.slice(0, -1);
102
+ else if (last === ")" && url.split("(").length < url.split(")").length)
103
+ url = url.slice(0, -1);
104
+ else if (last === "]" && url.split("[").length < url.split("]").length)
105
+ url = url.slice(0, -1);
106
+ else
107
+ return url;
108
+ }
109
+ }
110
+ export const extractUrls = defineOperation({
111
+ id: "extract-urls",
112
+ name: "Extract URLs",
113
+ description: "Lists the URLs (anything like scheme://...) found in the text, one per line.",
114
+ category: "Extractors",
115
+ output: "binary",
116
+ aliases: ["find url", "grep url", "links"],
117
+ args: listArgs,
118
+ examples: [
119
+ {
120
+ input: "See https://example.com/a?b=1, (or http://wiki.org/A_(b)) and ftp://x.org/file.",
121
+ output: "https://example.com/a?b=1\nhttp://wiki.org/A_(b)\nftp://x.org/file",
122
+ },
123
+ ],
124
+ run: (input, args) => mapText(input, (text) => {
125
+ const urls = [...matches(text, URL_PATTERN)].map((m) => ({ index: m.index, value: trimUrl(m.value) }));
126
+ return list(urls, args);
127
+ }),
128
+ });
129
+ //# sourceMappingURL=extract.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extract.js","sourceRoot":"","sources":["../../../src/operations/extract/extract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,MAAM,KAAK,GAAG,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ACnB,OAAO,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE;QACtB,MAAM,IAAI,GAAG,CAAC,GAAG,OAAO,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;QACvG,OAAO,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC1B,CAAC,CAAC;CACL,CAAC,CAAC"}
@@ -0,0 +1,16 @@
1
+ export declare const bcrypt: import("../../operation.ts").Operation<"bcrypt", {
2
+ readonly rounds: {
3
+ readonly type: "number";
4
+ readonly name: "Cost";
5
+ readonly description: "Log2 of the number of rounds: each step doubles the computing time.";
6
+ readonly min: 4;
7
+ readonly max: 31;
8
+ readonly default: 10;
9
+ };
10
+ readonly salt: {
11
+ readonly type: "string";
12
+ readonly name: "Salt";
13
+ readonly description: "22 characters from ./A-Za-z0-9. Leave empty for a random salt.";
14
+ readonly default: "";
15
+ };
16
+ }, never>;
@@ -0,0 +1,45 @@
1
+ import bcryptjs from "bcryptjs";
2
+ import { OperationError } from "../../errors.js";
3
+ import { defineOperation } from "../../operation.js";
4
+ const SALT = /^[./A-Za-z0-9]{22}$/;
5
+ export const bcrypt = defineOperation({
6
+ id: "bcrypt",
7
+ name: "Bcrypt",
8
+ description: "Hashes the input (a password) with bcrypt, using a random salt unless one is given. Only the first 72 bytes are used.",
9
+ category: "Hashing",
10
+ output: "text",
11
+ aliases: ["password hash", "blowfish"],
12
+ infoUrl: "https://wikipedia.org/wiki/Bcrypt",
13
+ args: {
14
+ rounds: {
15
+ type: "number",
16
+ name: "Cost",
17
+ description: "Log2 of the number of rounds: each step doubles the computing time.",
18
+ min: 4,
19
+ max: 31,
20
+ default: 10,
21
+ },
22
+ salt: {
23
+ type: "string",
24
+ name: "Salt",
25
+ description: "22 characters from ./A-Za-z0-9. Leave empty for a random salt.",
26
+ default: "",
27
+ },
28
+ },
29
+ examples: [
30
+ {
31
+ input: "hello",
32
+ args: { rounds: 4, salt: "abcdefghijklmnopqrstuu" },
33
+ output: "$2b$04$abcdefghijklmnopqrstuuwHJMEGjfAzmL1lWmUmlphguIbWfjYey",
34
+ },
35
+ ],
36
+ run(input, { rounds, salt }) {
37
+ if (!Number.isInteger(rounds))
38
+ throw new OperationError(`Invalid cost: ${rounds} is not an integer`);
39
+ if (salt && !SALT.test(salt))
40
+ throw new OperationError("Invalid salt: expected 22 characters from ./A-Za-z0-9");
41
+ const fullSalt = salt ? `$2b$${String(rounds).padStart(2, "0")}$${salt}` : bcryptjs.genSaltSync(rounds);
42
+ return new TextEncoder().encode(bcryptjs.hashSync(new TextDecoder().decode(input), fullSalt));
43
+ },
44
+ });
45
+ //# sourceMappingURL=bcrypt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bcrypt.js","sourceRoot":"","sources":["../../../src/operations/hash/bcrypt.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,MAAM,IAAI,GAAG,qBAAqB,CAAC;AAEnC,MAAM,CAAC,MAAM,MAAM,GAAG,eAAe,CAAC;IACpC,EAAE,EAAE,QAAQ;IACZ,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,uHAAuH;IACpI,QAAQ,EAAE,SAAS;IACnB,MAAM,EAAE,MAAM;IACd,OAAO,EAAE,CAAC,eAAe,EAAE,UAAU,CAAC;IACtC,OAAO,EAAE,mCAAmC;IAC5C,IAAI,EAAE;QACJ,MAAM,EAAE;YACN,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,qEAAqE;YAClF,GAAG,EAAE,CAAC;YACN,GAAG,EAAE,EAAE;YACP,OAAO,EAAE,EAAE;SACZ;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,gEAAgE;YAC7E,OAAO,EAAE,EAAE;SACZ;KACF;IACD,QAAQ,EAAE;QACR;YACE,KAAK,EAAE,OAAO;YACd,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,wBAAwB,EAAE;YACnD,MAAM,EAAE,8DAA8D;SACvE;KACF;IACD,GAAG,CAAC,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;QACzB,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC;YAAE,MAAM,IAAI,cAAc,CAAC,iBAAiB,MAAM,oBAAoB,CAAC,CAAC;QACrG,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;YAAE,MAAM,IAAI,cAAc,CAAC,uDAAuD,CAAC,CAAC;QAChH,MAAM,QAAQ,GAAG,IAAI,CAAC,CAAC,CAAC,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QACxG,OAAO,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC;IAChG,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,10 @@
1
+ export declare const md5: import("../../operation.ts").Operation<"md5", {}, never>;
2
+ export declare const sha1: import("../../operation.ts").Operation<"sha1", {}, never>;
3
+ export declare const sha224: import("../../operation.ts").Operation<"sha224", {}, never>;
4
+ export declare const sha256: import("../../operation.ts").Operation<"sha256", {}, never>;
5
+ export declare const sha384: import("../../operation.ts").Operation<"sha384", {}, never>;
6
+ export declare const sha512: import("../../operation.ts").Operation<"sha512", {}, never>;
7
+ export declare const sha3_224: import("../../operation.ts").Operation<"sha3-224", {}, never>;
8
+ export declare const sha3_256: import("../../operation.ts").Operation<"sha3-256", {}, never>;
9
+ export declare const sha3_384: import("../../operation.ts").Operation<"sha3-384", {}, never>;
10
+ export declare const sha3_512: import("../../operation.ts").Operation<"sha3-512", {}, never>;