@stryke/convert 0.6.32 → 0.6.34

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 (64) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/array-buffer-to-string.cjs +19 -1
  3. package/dist/array-buffer-to-string.mjs +18 -1
  4. package/dist/array-buffer-to-string.mjs.map +1 -1
  5. package/dist/buffer-to-string.cjs +14 -1
  6. package/dist/buffer-to-string.mjs +13 -1
  7. package/dist/buffer-to-string.mjs.map +1 -1
  8. package/dist/index.cjs +27 -1
  9. package/dist/index.mjs +13 -1
  10. package/dist/neutral.cjs +23 -1
  11. package/dist/neutral.mjs +11 -1
  12. package/dist/parse-type-definition.cjs +37 -1
  13. package/dist/parse-type-definition.mjs +37 -1
  14. package/dist/parse-type-definition.mjs.map +1 -1
  15. package/dist/string-to-buffer.cjs +27 -1
  16. package/dist/string-to-buffer.mjs +27 -1
  17. package/dist/string-to-buffer.mjs.map +1 -1
  18. package/dist/string-to-uint8-array.cjs +37 -1
  19. package/dist/string-to-uint8-array.mjs +34 -1
  20. package/dist/string-to-uint8-array.mjs.map +1 -1
  21. package/dist/string-to-utf8-array.cjs +15 -1
  22. package/dist/string-to-utf8-array.mjs +14 -1
  23. package/dist/string-to-utf8-array.mjs.map +1 -1
  24. package/dist/to-array.cjs +15 -1
  25. package/dist/to-array.mjs +14 -1
  26. package/dist/to-array.mjs.map +1 -1
  27. package/dist/to-string-key.cjs +15 -1
  28. package/dist/to-string-key.mjs +14 -1
  29. package/dist/to-string-key.mjs.map +1 -1
  30. package/dist/type-checks/src/get-object-tag.cjs +15 -1
  31. package/dist/type-checks/src/get-object-tag.mjs +14 -1
  32. package/dist/type-checks/src/get-object-tag.mjs.map +1 -1
  33. package/dist/type-checks/src/index.cjs +7 -1
  34. package/dist/type-checks/src/index.mjs +9 -1
  35. package/dist/type-checks/src/is-buffer.cjs +12 -1
  36. package/dist/type-checks/src/is-buffer.mjs +11 -1
  37. package/dist/type-checks/src/is-buffer.mjs.map +1 -1
  38. package/dist/type-checks/src/is-collection.cjs +1 -1
  39. package/dist/type-checks/src/is-collection.mjs +3 -1
  40. package/dist/type-checks/src/is-object.cjs +19 -1
  41. package/dist/type-checks/src/is-object.mjs +19 -1
  42. package/dist/type-checks/src/is-object.mjs.map +1 -1
  43. package/dist/type-checks/src/is-plain-object.cjs +64 -1
  44. package/dist/type-checks/src/is-plain-object.mjs +63 -1
  45. package/dist/type-checks/src/is-plain-object.mjs.map +1 -1
  46. package/dist/type-checks/src/is-string.cjs +12 -1
  47. package/dist/type-checks/src/is-string.mjs +11 -1
  48. package/dist/type-checks/src/is-string.mjs.map +1 -1
  49. package/dist/type-checks/src/type-detect.cjs +15 -1
  50. package/dist/type-checks/src/type-detect.mjs +16 -1
  51. package/dist/type-checks/src/type-detect.mjs.map +1 -1
  52. package/dist/uint8-array-to-stream.cjs +49 -1
  53. package/dist/uint8-array-to-stream.mjs +46 -1
  54. package/dist/uint8-array-to-stream.mjs.map +1 -1
  55. package/dist/uint8-array-to-string.cjs +15 -1
  56. package/dist/uint8-array-to-string.mjs +15 -1
  57. package/dist/uint8-array-to-string.mjs.map +1 -1
  58. package/dist/uint8-array-to-string.node.cjs +16 -1
  59. package/dist/uint8-array-to-string.node.mjs +16 -1
  60. package/dist/uint8-array-to-string.node.mjs.map +1 -1
  61. package/dist/utf8-array-to-string.cjs +15 -1
  62. package/dist/utf8-array-to-string.mjs +14 -1
  63. package/dist/utf8-array-to-string.mjs.map +1 -1
  64. package/package.json +3 -3
@@ -1,2 +1,17 @@
1
- import{Buffer as e}from"node:buffer";const t=t=>decodeURIComponent(e.from(t).toString(`utf8`));export{t as uint8ArrayToString};
1
+ import { Buffer } from "node:buffer";
2
+
3
+ //#region src/uint8-array-to-string.node.ts
4
+ /**
5
+ * Convert a Uint8Array array to string
6
+ *
7
+ * @see https://stackoverflow.com/a/41798356/1465919
8
+ * @see https://stackoverflow.com/a/36949791/1465919
9
+ *
10
+ * @param arr - Uint8Array to convert
11
+ * @returns The converted string
12
+ */
13
+ const uint8ArrayToString = (arr) => decodeURIComponent(Buffer.from(arr).toString("utf8"));
14
+
15
+ //#endregion
16
+ export { uint8ArrayToString };
2
17
  //# sourceMappingURL=uint8-array-to-string.node.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"uint8-array-to-string.node.mjs","names":[],"sources":["../src/uint8-array-to-string.node.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { Buffer } from \"node:buffer\";\n\n/**\n * Convert a Uint8Array array to string\n *\n * @see https://stackoverflow.com/a/41798356/1465919\n * @see https://stackoverflow.com/a/36949791/1465919\n *\n * @param arr - Uint8Array to convert\n * @returns The converted string\n */\nexport const uint8ArrayToString = (arr: Uint8Array): string =>\n decodeURIComponent(Buffer.from(arr).toString(\"utf8\"));\n"],"mappings":"qCA6BA,MAAa,EAAsB,GACjC,mBAAmB,EAAO,KAAK,EAAI,CAAC,SAAS,OAAO,CAAC"}
1
+ {"version":3,"file":"uint8-array-to-string.node.mjs","names":[],"sources":["../src/uint8-array-to-string.node.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { Buffer } from \"node:buffer\";\n\n/**\n * Convert a Uint8Array array to string\n *\n * @see https://stackoverflow.com/a/41798356/1465919\n * @see https://stackoverflow.com/a/36949791/1465919\n *\n * @param arr - Uint8Array to convert\n * @returns The converted string\n */\nexport const uint8ArrayToString = (arr: Uint8Array): string =>\n decodeURIComponent(Buffer.from(arr).toString(\"utf8\"));\n"],"mappings":";;;;;;;;;;;;AA6BA,MAAa,sBAAsB,QACjC,mBAAmB,OAAO,KAAK,IAAI,CAAC,SAAS,OAAO,CAAC"}
@@ -1 +1,15 @@
1
- const e=new TextDecoder;function t(t){return e.decode(t)}exports.utf8ArrayToString=t;
1
+
2
+ //#region src/utf8-array-to-string.ts
3
+ const decoder = new TextDecoder();
4
+ /**
5
+ * Convert a utf-8 array to string
6
+ *
7
+ * @param input - Utf-8 Array
8
+ * @returns The converted string
9
+ */
10
+ function utf8ArrayToString(input) {
11
+ return decoder.decode(input);
12
+ }
13
+
14
+ //#endregion
15
+ exports.utf8ArrayToString = utf8ArrayToString;
@@ -1,2 +1,15 @@
1
- const e=new TextDecoder;function t(t){return e.decode(t)}export{t as utf8ArrayToString};
1
+ //#region src/utf8-array-to-string.ts
2
+ const decoder = new TextDecoder();
3
+ /**
4
+ * Convert a utf-8 array to string
5
+ *
6
+ * @param input - Utf-8 Array
7
+ * @returns The converted string
8
+ */
9
+ function utf8ArrayToString(input) {
10
+ return decoder.decode(input);
11
+ }
12
+
13
+ //#endregion
14
+ export { utf8ArrayToString };
2
15
  //# sourceMappingURL=utf8-array-to-string.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"utf8-array-to-string.mjs","names":[],"sources":["../src/utf8-array-to-string.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nconst decoder = new TextDecoder();\n\n/**\n * Convert a utf-8 array to string\n *\n * @param input - Utf-8 Array\n * @returns The converted string\n */\nexport function utf8ArrayToString(\n input: NodeJS.ArrayBufferView | ArrayBuffer\n): string {\n return decoder.decode(input);\n}\n"],"mappings":"AAkBA,MAAM,EAAU,IAAI,YAQpB,SAAgB,EACd,EACQ,CACR,OAAO,EAAQ,OAAO,EAAM"}
1
+ {"version":3,"file":"utf8-array-to-string.mjs","names":[],"sources":["../src/utf8-array-to-string.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nconst decoder = new TextDecoder();\n\n/**\n * Convert a utf-8 array to string\n *\n * @param input - Utf-8 Array\n * @returns The converted string\n */\nexport function utf8ArrayToString(\n input: NodeJS.ArrayBufferView | ArrayBuffer\n): string {\n return decoder.decode(input);\n}\n"],"mappings":";AAkBA,MAAM,UAAU,IAAI,aAAa;;;;;;;AAQjC,SAAgB,kBACd,OACQ;AACR,QAAO,QAAQ,OAAO,MAAM"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stryke/convert",
3
- "version": "0.6.32",
3
+ "version": "0.6.34",
4
4
  "type": "module",
5
5
  "description": "A utility package that helps convert between different data types.",
6
6
  "repository": {
@@ -68,7 +68,7 @@
68
68
  "./*": "./*"
69
69
  },
70
70
  "types": "./dist/index.d.cts",
71
- "devDependencies": { "@types/node": "^24.10.8", "tsdown": "^0.17.2" },
71
+ "devDependencies": { "@types/node": "^24.10.9", "tsdown": "^0.17.2" },
72
72
  "publishConfig": { "access": "public" },
73
- "gitHead": "ea722ff737bfe75d31084e879303a61fc748758e"
73
+ "gitHead": "9c02f25b3bf83a1228a94fc2ef3fcd816dc0f707"
74
74
  }