@stryke/convert 0.6.13 → 0.6.21

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 (154) hide show
  1. package/CHANGELOG.md +287 -0
  2. package/README.md +18 -9
  3. package/dist/array-buffer-to-string-C11aVDDi.cjs +1 -0
  4. package/dist/array-buffer-to-string-Ck1wKcim.mjs +2 -0
  5. package/dist/array-buffer-to-string-Ck1wKcim.mjs.map +1 -0
  6. package/dist/array-buffer-to-string-CyitIedv.d.cts +11 -0
  7. package/dist/array-buffer-to-string-CyitIedv.d.cts.map +1 -0
  8. package/dist/array-buffer-to-string-DeEBcG3B.d.mts +11 -0
  9. package/dist/array-buffer-to-string-DeEBcG3B.d.mts.map +1 -0
  10. package/dist/array-buffer-to-string.cjs +1 -14
  11. package/dist/array-buffer-to-string.d.cts +2 -0
  12. package/dist/array-buffer-to-string.d.mts +2 -0
  13. package/dist/array-buffer-to-string.mjs +1 -1
  14. package/dist/buffer-to-string-BM0gdjtH.d.cts +14 -0
  15. package/dist/buffer-to-string-BM0gdjtH.d.cts.map +1 -0
  16. package/dist/buffer-to-string-C5uu2I9v.cjs +1 -0
  17. package/dist/buffer-to-string-DOBdYQzE.mjs +2 -0
  18. package/dist/buffer-to-string-DOBdYQzE.mjs.map +1 -0
  19. package/dist/buffer-to-string-KwWDaeXZ.d.mts +14 -0
  20. package/dist/buffer-to-string-KwWDaeXZ.d.mts.map +1 -0
  21. package/dist/buffer-to-string.cjs +1 -9
  22. package/dist/buffer-to-string.d.cts +2 -0
  23. package/dist/buffer-to-string.d.mts +2 -0
  24. package/dist/buffer-to-string.mjs +1 -1
  25. package/dist/index.cjs +1 -126
  26. package/dist/index.d.cts +12 -0
  27. package/dist/index.d.mts +12 -0
  28. package/dist/index.mjs +1 -1
  29. package/dist/neutral.cjs +1 -104
  30. package/dist/neutral.d.cts +10 -0
  31. package/dist/neutral.d.mts +10 -0
  32. package/dist/neutral.mjs +1 -1
  33. package/dist/parse-type-definition-2UeRPhOv.mjs +2 -0
  34. package/dist/parse-type-definition-2UeRPhOv.mjs.map +1 -0
  35. package/dist/parse-type-definition-C6ppBfCe.d.mts +36 -0
  36. package/dist/parse-type-definition-C6ppBfCe.d.mts.map +1 -0
  37. package/dist/parse-type-definition-WznwYsLX.d.cts +36 -0
  38. package/dist/parse-type-definition-WznwYsLX.d.cts.map +1 -0
  39. package/dist/parse-type-definition-tN_XNvw2.cjs +1 -0
  40. package/dist/parse-type-definition.cjs +1 -33
  41. package/dist/parse-type-definition.d.cts +2 -0
  42. package/dist/parse-type-definition.d.mts +2 -0
  43. package/dist/parse-type-definition.mjs +1 -1
  44. package/dist/{string-to-buffer.d.ts → string-to-buffer-Ct8hX_gT.d.mts} +7 -1
  45. package/dist/string-to-buffer-Ct8hX_gT.d.mts.map +1 -0
  46. package/dist/string-to-buffer-DT1hmd7E.cjs +1 -0
  47. package/dist/string-to-buffer-DWEJ2oBO.mjs +2 -0
  48. package/dist/string-to-buffer-DWEJ2oBO.mjs.map +1 -0
  49. package/dist/string-to-buffer-DgvrLU6Z.d.cts +26 -0
  50. package/dist/string-to-buffer-DgvrLU6Z.d.cts.map +1 -0
  51. package/dist/string-to-buffer.cjs +1 -10
  52. package/dist/string-to-buffer.d.cts +2 -0
  53. package/dist/string-to-buffer.d.mts +2 -0
  54. package/dist/string-to-buffer.mjs +1 -1
  55. package/dist/string-to-uint8-array-1nnn75lE.cjs +1 -0
  56. package/dist/string-to-uint8-array-Bemw-wC0.d.mts +25 -0
  57. package/dist/string-to-uint8-array-Bemw-wC0.d.mts.map +1 -0
  58. package/dist/string-to-uint8-array-BuyABRFc.d.cts +25 -0
  59. package/dist/string-to-uint8-array-BuyABRFc.d.cts.map +1 -0
  60. package/dist/string-to-uint8-array-Cp8Uy9Dd.mjs +2 -0
  61. package/dist/string-to-uint8-array-Cp8Uy9Dd.mjs.map +1 -0
  62. package/dist/string-to-uint8-array.cjs +1 -20
  63. package/dist/string-to-uint8-array.d.cts +2 -0
  64. package/dist/string-to-uint8-array.d.mts +2 -0
  65. package/dist/string-to-uint8-array.mjs +1 -1
  66. package/dist/string-to-utf8-array-BiFS1qOV.mjs +2 -0
  67. package/dist/string-to-utf8-array-BiFS1qOV.mjs.map +1 -0
  68. package/dist/string-to-utf8-array-D5Ej2ODQ.d.mts +11 -0
  69. package/dist/string-to-utf8-array-D5Ej2ODQ.d.mts.map +1 -0
  70. package/dist/string-to-utf8-array-DcnUcijD.d.cts +11 -0
  71. package/dist/string-to-utf8-array-DcnUcijD.d.cts.map +1 -0
  72. package/dist/string-to-utf8-array-DzjMX8ba.cjs +1 -0
  73. package/dist/string-to-utf8-array.cjs +1 -10
  74. package/dist/string-to-utf8-array.d.cts +2 -0
  75. package/dist/string-to-utf8-array.d.mts +2 -0
  76. package/dist/string-to-utf8-array.mjs +1 -1
  77. package/dist/to-array-B5vdSOyE.d.mts +20 -0
  78. package/dist/to-array-B5vdSOyE.d.mts.map +1 -0
  79. package/dist/to-array-DypOORLR.mjs +2 -0
  80. package/dist/to-array-DypOORLR.mjs.map +1 -0
  81. package/dist/to-array-hovilP39.d.cts +20 -0
  82. package/dist/to-array-hovilP39.d.cts.map +1 -0
  83. package/dist/to-array-lsJQeHmC.cjs +1 -0
  84. package/dist/to-array.cjs +1 -9
  85. package/dist/to-array.d.cts +2 -0
  86. package/dist/to-array.d.mts +2 -0
  87. package/dist/to-array.mjs +1 -1
  88. package/dist/to-string-key-AETeEmqn.cjs +1 -0
  89. package/dist/to-string-key-BPU8Yayu.mjs +2 -0
  90. package/dist/to-string-key-BPU8Yayu.mjs.map +1 -0
  91. package/dist/to-string-key-BsJi969H.d.cts +11 -0
  92. package/dist/to-string-key-BsJi969H.d.cts.map +1 -0
  93. package/dist/to-string-key-DepSNY9f.d.mts +11 -0
  94. package/dist/to-string-key-DepSNY9f.d.mts.map +1 -0
  95. package/dist/to-string-key.cjs +1 -9
  96. package/dist/to-string-key.d.cts +2 -0
  97. package/dist/to-string-key.d.mts +2 -0
  98. package/dist/to-string-key.mjs +1 -1
  99. package/dist/{uint8-array-to-stream.d.ts → uint8-array-to-stream-C9Mja3TP.d.cts} +7 -3
  100. package/dist/uint8-array-to-stream-C9Mja3TP.d.cts.map +1 -0
  101. package/dist/uint8-array-to-stream-Cihhs2sR.cjs +1 -0
  102. package/dist/uint8-array-to-stream-DTph8RAX.mjs +2 -0
  103. package/dist/uint8-array-to-stream-DTph8RAX.mjs.map +1 -0
  104. package/dist/uint8-array-to-stream-gy0Q2EoT.d.mts +25 -0
  105. package/dist/uint8-array-to-stream-gy0Q2EoT.d.mts.map +1 -0
  106. package/dist/uint8-array-to-stream.cjs +1 -31
  107. package/dist/uint8-array-to-stream.d.cts +2 -0
  108. package/dist/uint8-array-to-stream.d.mts +2 -0
  109. package/dist/uint8-array-to-stream.mjs +1 -1
  110. package/dist/uint8-array-to-string-B1OAtvJr.d.cts +11 -0
  111. package/dist/uint8-array-to-string-B1OAtvJr.d.cts.map +1 -0
  112. package/dist/uint8-array-to-string-CQvEdtuI.mjs +2 -0
  113. package/dist/uint8-array-to-string-CQvEdtuI.mjs.map +1 -0
  114. package/dist/uint8-array-to-string-CjA1fEXC.d.mts +11 -0
  115. package/dist/uint8-array-to-string-CjA1fEXC.d.mts.map +1 -0
  116. package/dist/uint8-array-to-string-CmUiFDa1.cjs +1 -0
  117. package/dist/uint8-array-to-string.cjs +1 -10
  118. package/dist/uint8-array-to-string.d.cts +2 -0
  119. package/dist/uint8-array-to-string.d.mts +2 -0
  120. package/dist/uint8-array-to-string.mjs +1 -1
  121. package/dist/{uint8-array-to-string.node.d.ts → uint8-array-to-string.node-BEp4mxNL.d.mts} +5 -1
  122. package/dist/uint8-array-to-string.node-BEp4mxNL.d.mts.map +1 -0
  123. package/dist/uint8-array-to-string.node-DAjOixF7.d.cts +14 -0
  124. package/dist/uint8-array-to-string.node-DAjOixF7.d.cts.map +1 -0
  125. package/dist/uint8-array-to-string.node-nB1JhZqQ.cjs +1 -0
  126. package/dist/uint8-array-to-string.node-t7NS2Zmo.mjs +2 -0
  127. package/dist/uint8-array-to-string.node-t7NS2Zmo.mjs.map +1 -0
  128. package/dist/uint8-array-to-string.node.cjs +1 -9
  129. package/dist/uint8-array-to-string.node.d.cts +2 -0
  130. package/dist/uint8-array-to-string.node.d.mts +2 -0
  131. package/dist/uint8-array-to-string.node.mjs +1 -1
  132. package/dist/utf8-array-to-string-BiFD671-.d.cts +11 -0
  133. package/dist/utf8-array-to-string-BiFD671-.d.cts.map +1 -0
  134. package/dist/utf8-array-to-string-Brda-b96.d.mts +11 -0
  135. package/dist/utf8-array-to-string-Brda-b96.d.mts.map +1 -0
  136. package/dist/utf8-array-to-string-D96sN_nr.mjs +2 -0
  137. package/dist/utf8-array-to-string-D96sN_nr.mjs.map +1 -0
  138. package/dist/utf8-array-to-string-lutucTzo.cjs +1 -0
  139. package/dist/utf8-array-to-string.cjs +1 -10
  140. package/dist/utf8-array-to-string.d.cts +2 -0
  141. package/dist/utf8-array-to-string.d.mts +2 -0
  142. package/dist/utf8-array-to-string.mjs +1 -1
  143. package/package.json +47 -238
  144. package/dist/array-buffer-to-string.d.ts +0 -7
  145. package/dist/buffer-to-string.d.ts +0 -8
  146. package/dist/index.d.ts +0 -19
  147. package/dist/neutral.d.ts +0 -9
  148. package/dist/parse-type-definition.d.ts +0 -8
  149. package/dist/string-to-uint8-array.d.ts +0 -21
  150. package/dist/string-to-utf8-array.d.ts +0 -7
  151. package/dist/to-array.d.ts +0 -9
  152. package/dist/to-string-key.d.ts +0 -7
  153. package/dist/uint8-array-to-string.d.ts +0 -7
  154. package/dist/utf8-array-to-string.d.ts +0 -7
@@ -0,0 +1,2 @@
1
+ import { t as stringToUtf8Array } from "./string-to-utf8-array-D5Ej2ODQ.mjs";
2
+ export { stringToUtf8Array };
@@ -1 +1 @@
1
- const r=new TextEncoder;export function stringToUtf8Array(n){return r.encode(n)}
1
+ import{t as e}from"./string-to-utf8-array-BiFS1qOV.mjs";export{e as stringToUtf8Array};
@@ -0,0 +1,20 @@
1
+ //#region ../types/src/array.d.ts
2
+ /**
3
+ * Matches any array or array-like object.
4
+ */
5
+ type Arrayable<T> = T | T[];
6
+ //#endregion
7
+ //#region ../types/src/utilities.d.ts
8
+ type Nullable<T> = T | null;
9
+ //#endregion
10
+ //#region src/to-array.d.ts
11
+ /**
12
+ * Convert `Arrayable<T>` to `Array<T>`
13
+ *
14
+ * @param array - The `Arrayable<T>` to convert
15
+ * @returns An `Array<T>` containing the elements of the input
16
+ */
17
+ declare function toArray<T>(array?: Nullable<Arrayable<T>>): Array<T>;
18
+ //#endregion
19
+ export { toArray as t };
20
+ //# sourceMappingURL=to-array-B5vdSOyE.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"to-array-B5vdSOyE.d.mts","names":[],"sources":["../../types/src/array.ts","../../types/src/utilities.ts","../src/to-array.ts"],"sourcesContent":[],"mappings":";;AAqBA;;KAAY,eAAe,IAAI;;;AAAnB,KCDA,QDCS,CAAA,CAAA,CAAA,GCDK,CDCL,GAAM,IAAK;;;;;;ACDhC;;;iBCOgB,mBAAmB,SAAS,UAAU,MAAM,MAAM"}
@@ -0,0 +1,2 @@
1
+ function e(e){return e??=[],Array.isArray(e)?e:[e]}export{e as t};
2
+ //# sourceMappingURL=to-array-DypOORLR.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"to-array-DypOORLR.mjs","names":[],"sources":["../src/to-array.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 type { Arrayable } from \"@stryke/types/array\";\nimport type { Nullable } from \"@stryke/types/utilities\";\n\n/**\n * Convert `Arrayable<T>` to `Array<T>`\n *\n * @param array - The `Arrayable<T>` to convert\n * @returns An `Array<T>` containing the elements of the input\n */\nexport function toArray<T>(array?: Nullable<Arrayable<T>>): Array<T> {\n array = array ?? [];\n return Array.isArray(array) ? array : [array];\n}\n"],"mappings":"AA2BA,SAAgB,EAAW,EAA0C,CAEnE,MADA,KAAiB,EAAE,CACZ,MAAM,QAAQ,EAAM,CAAG,EAAQ,CAAC,EAAM"}
@@ -0,0 +1,20 @@
1
+ //#region ../types/src/array.d.ts
2
+ /**
3
+ * Matches any array or array-like object.
4
+ */
5
+ type Arrayable<T> = T | T[];
6
+ //#endregion
7
+ //#region ../types/src/utilities.d.ts
8
+ type Nullable<T> = T | null;
9
+ //#endregion
10
+ //#region src/to-array.d.ts
11
+ /**
12
+ * Convert `Arrayable<T>` to `Array<T>`
13
+ *
14
+ * @param array - The `Arrayable<T>` to convert
15
+ * @returns An `Array<T>` containing the elements of the input
16
+ */
17
+ declare function toArray<T>(array?: Nullable<Arrayable<T>>): Array<T>;
18
+ //#endregion
19
+ export { toArray as t };
20
+ //# sourceMappingURL=to-array-hovilP39.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"to-array-hovilP39.d.cts","names":[],"sources":["../../types/src/array.ts","../../types/src/utilities.ts","../src/to-array.ts"],"sourcesContent":[],"mappings":";;AAqBA;;KAAY,eAAe,IAAI;;;AAAnB,KCDA,QDCS,CAAA,CAAA,CAAA,GCDK,CDCL,GAAM,IAAK;;;;;;ACDhC;;;iBCOgB,mBAAmB,SAAS,UAAU,MAAM,MAAM"}
@@ -0,0 +1 @@
1
+ function e(e){return e??=[],Array.isArray(e)?e:[e]}Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return e}});
package/dist/to-array.cjs CHANGED
@@ -1,9 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.toArray = toArray;
7
- function toArray(r) {
8
- return r = r ?? [], Array.isArray(r) ? r : [r];
9
- }
1
+ const e=require(`./to-array-lsJQeHmC.cjs`);exports.toArray=e.t;
@@ -0,0 +1,2 @@
1
+ import { t as toArray } from "./to-array-hovilP39.cjs";
2
+ export { toArray };
@@ -0,0 +1,2 @@
1
+ import { t as toArray } from "./to-array-B5vdSOyE.mjs";
2
+ export { toArray };
package/dist/to-array.mjs CHANGED
@@ -1 +1 @@
1
- export function toArray(r){return r=r??[],Array.isArray(r)?r:[r]}
1
+ import{t as e}from"./to-array-DypOORLR.mjs";export{e as toArray};
@@ -0,0 +1 @@
1
+ function e(e){return Object.is(e,-0)?`-0`:e.toString()}Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return e}});
@@ -0,0 +1,2 @@
1
+ function e(e){return Object.is(e,-0)?`-0`:e.toString()}export{e as t};
2
+ //# sourceMappingURL=to-string-key-BPU8Yayu.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"to-string-key-BPU8Yayu.mjs","names":[],"sources":["../src/to-string-key.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\n/**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @param value - The value to inspect.\n * @returns Returns the key.\n */\nexport function toStringKey(value: number): string | symbol {\n if (Object.is(value, -0)) {\n return \"-0\";\n }\n\n return value.toString();\n}\n"],"mappings":"AAwBA,SAAgB,EAAY,EAAgC,CAK1D,OAJI,OAAO,GAAG,EAAO,GAAG,CACf,KAGF,EAAM,UAAU"}
@@ -0,0 +1,11 @@
1
+ //#region src/to-string-key.d.ts
2
+ /**
3
+ * Converts `value` to a string key if it's not a string or symbol.
4
+ *
5
+ * @param value - The value to inspect.
6
+ * @returns Returns the key.
7
+ */
8
+ declare function toStringKey(value: number): string | symbol;
9
+ //#endregion
10
+ export { toStringKey as t };
11
+ //# sourceMappingURL=to-string-key-BsJi969H.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"to-string-key-BsJi969H.d.cts","names":[],"sources":["../src/to-string-key.ts"],"sourcesContent":[],"mappings":";;AAwBA;;;;;iBAAgB,WAAA"}
@@ -0,0 +1,11 @@
1
+ //#region src/to-string-key.d.ts
2
+ /**
3
+ * Converts `value` to a string key if it's not a string or symbol.
4
+ *
5
+ * @param value - The value to inspect.
6
+ * @returns Returns the key.
7
+ */
8
+ declare function toStringKey(value: number): string | symbol;
9
+ //#endregion
10
+ export { toStringKey as t };
11
+ //# sourceMappingURL=to-string-key-DepSNY9f.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"to-string-key-DepSNY9f.d.mts","names":[],"sources":["../src/to-string-key.ts"],"sourcesContent":[],"mappings":";;AAwBA;;;;;iBAAgB,WAAA"}
@@ -1,9 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.toStringKey = toStringKey;
7
- function toStringKey(t) {
8
- return Object.is(t, -0) ? "-0" : t.toString();
9
- }
1
+ const e=require(`./to-string-key-AETeEmqn.cjs`);exports.toStringKey=e.t;
@@ -0,0 +1,2 @@
1
+ import { t as toStringKey } from "./to-string-key-BsJi969H.cjs";
2
+ export { toStringKey };
@@ -0,0 +1,2 @@
1
+ import { t as toStringKey } from "./to-string-key-DepSNY9f.mjs";
2
+ export { toStringKey };
@@ -1 +1 @@
1
- export function toStringKey(t){return Object.is(t,-0)?"-0":t.toString()}
1
+ import{t as e}from"./to-string-key-BPU8Yayu.mjs";export{e as toStringKey};
@@ -1,21 +1,25 @@
1
+ //#region src/uint8-array-to-stream.d.ts
1
2
  /**
2
3
  * Convert a Uint8Array to a ReadableStream
3
4
  *
4
5
  * @param data - The Uint8Array to convert
5
6
  * @returns The converted ReadableStream
6
7
  */
7
- export declare function uint8ArrayToStream(data: Uint8Array): ReadableStream<Uint8Array>;
8
+ declare function uint8ArrayToStream(data: Uint8Array): ReadableStream<Uint8Array>;
8
9
  /**
9
10
  * Concatenate an array of Uint8Array chunks into a single Uint8Array
10
11
  *
11
12
  * @param chunks - Array of Uint8Array chunks to concatenate
12
13
  * @returns The concatenated Uint8Array
13
14
  */
14
- export declare function concatUint8Array(chunks: Uint8Array[]): Uint8Array;
15
+ declare function concatUint8Array(chunks: Uint8Array[]): Uint8Array;
15
16
  /**
16
17
  * Concatenate a ReadableStream of Uint8Array chunks into a single Uint8Array
17
18
  *
18
19
  * @param stream - The ReadableStream of Uint8Array chunks to concatenate
19
20
  * @returns A promise that resolves to the concatenated Uint8Array
20
21
  */
21
- export declare function concatUint8ArrayStream(stream: ReadableStream<Uint8Array>): Promise<Uint8Array>;
22
+ declare function concatUint8ArrayStream(stream: ReadableStream<Uint8Array>): Promise<Uint8Array>;
23
+ //#endregion
24
+ export { concatUint8ArrayStream as n, uint8ArrayToStream as r, concatUint8Array as t };
25
+ //# sourceMappingURL=uint8-array-to-stream-C9Mja3TP.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uint8-array-to-stream-C9Mja3TP.d.cts","names":[],"sources":["../src/uint8-array-to-stream.ts"],"sourcesContent":[],"mappings":";;AAwBA;;;;;AAiBgB,iBAjBA,kBAAA,CAiByB,IAAe,EAhBhD,UAgB0D,CAAA,EAf/D,cAe+D,CAfhD,UAegD,CAAA;AAoBlE;;;;;;iBApBgB,gBAAA,SAAyB,eAAe;;;;;;;iBAoBlC,sBAAA,SACZ,eAAe,cACtB,QAAQ"}
@@ -0,0 +1 @@
1
+ function e(e){return new ReadableStream({start(t){t.enqueue(e),t.close()}})}function t(e){let t=0;for(let n of e)t+=n.length;let n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}async function n(e){let n=[];return await e.pipeTo(new WritableStream({write(e){n.push(e)}})),t(n)}Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return e}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return t}});
@@ -0,0 +1,2 @@
1
+ function e(e){return new ReadableStream({start(t){t.enqueue(e),t.close()}})}function t(e){let t=0;for(let n of e)t+=n.length;let n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}async function n(e){let n=[];return await e.pipeTo(new WritableStream({write(e){n.push(e)}})),t(n)}export{n,e as r,t};
2
+ //# sourceMappingURL=uint8-array-to-stream-DTph8RAX.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uint8-array-to-stream-DTph8RAX.mjs","names":["chunks: Uint8Array[]"],"sources":["../src/uint8-array-to-stream.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\n/**\n * Convert a Uint8Array to a ReadableStream\n *\n * @param data - The Uint8Array to convert\n * @returns The converted ReadableStream\n */\nexport function uint8ArrayToStream(\n data: Uint8Array\n): ReadableStream<Uint8Array> {\n return new ReadableStream({\n start(controller) {\n controller.enqueue(data);\n controller.close();\n }\n });\n}\n\n/**\n * Concatenate an array of Uint8Array chunks into a single Uint8Array\n *\n * @param chunks - Array of Uint8Array chunks to concatenate\n * @returns The concatenated Uint8Array\n */\nexport function concatUint8Array(chunks: Uint8Array[]): Uint8Array {\n let total = 0;\n for (const chunk of chunks) {\n total += chunk.length;\n }\n const result = new Uint8Array(total);\n let offset = 0;\n for (const chunk of chunks) {\n result.set(chunk, offset);\n offset += chunk.length;\n }\n return result;\n}\n\n/**\n * Concatenate a ReadableStream of Uint8Array chunks into a single Uint8Array\n *\n * @param stream - The ReadableStream of Uint8Array chunks to concatenate\n * @returns A promise that resolves to the concatenated Uint8Array\n */\nexport async function concatUint8ArrayStream(\n stream: ReadableStream<Uint8Array>\n): Promise<Uint8Array> {\n const chunks: Uint8Array[] = [];\n await stream.pipeTo(\n new WritableStream({\n write(chunk) {\n chunks.push(chunk);\n }\n })\n );\n\n return concatUint8Array(chunks);\n}\n"],"mappings":"AAwBA,SAAgB,EACd,EAC4B,CAC5B,OAAO,IAAI,eAAe,CACxB,MAAM,EAAY,CAChB,EAAW,QAAQ,EAAK,CACxB,EAAW,OAAO,EAErB,CAAC,CASJ,SAAgB,EAAiB,EAAkC,CACjE,IAAI,EAAQ,EACZ,IAAK,IAAM,KAAS,EAClB,GAAS,EAAM,OAEjB,IAAM,EAAS,IAAI,WAAW,EAAM,CAChC,EAAS,EACb,IAAK,IAAM,KAAS,EAClB,EAAO,IAAI,EAAO,EAAO,CACzB,GAAU,EAAM,OAElB,OAAO,EAST,eAAsB,EACpB,EACqB,CACrB,IAAMA,EAAuB,EAAE,CAS/B,OARA,MAAM,EAAO,OACX,IAAI,eAAe,CACjB,MAAM,EAAO,CACX,EAAO,KAAK,EAAM,EAErB,CAAC,CACH,CAEM,EAAiB,EAAO"}
@@ -0,0 +1,25 @@
1
+ //#region src/uint8-array-to-stream.d.ts
2
+ /**
3
+ * Convert a Uint8Array to a ReadableStream
4
+ *
5
+ * @param data - The Uint8Array to convert
6
+ * @returns The converted ReadableStream
7
+ */
8
+ declare function uint8ArrayToStream(data: Uint8Array): ReadableStream<Uint8Array>;
9
+ /**
10
+ * Concatenate an array of Uint8Array chunks into a single Uint8Array
11
+ *
12
+ * @param chunks - Array of Uint8Array chunks to concatenate
13
+ * @returns The concatenated Uint8Array
14
+ */
15
+ declare function concatUint8Array(chunks: Uint8Array[]): Uint8Array;
16
+ /**
17
+ * Concatenate a ReadableStream of Uint8Array chunks into a single Uint8Array
18
+ *
19
+ * @param stream - The ReadableStream of Uint8Array chunks to concatenate
20
+ * @returns A promise that resolves to the concatenated Uint8Array
21
+ */
22
+ declare function concatUint8ArrayStream(stream: ReadableStream<Uint8Array>): Promise<Uint8Array>;
23
+ //#endregion
24
+ export { concatUint8ArrayStream as n, uint8ArrayToStream as r, concatUint8Array as t };
25
+ //# sourceMappingURL=uint8-array-to-stream-gy0Q2EoT.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uint8-array-to-stream-gy0Q2EoT.d.mts","names":[],"sources":["../src/uint8-array-to-stream.ts"],"sourcesContent":[],"mappings":";;AAwBA;;;;;AAiBgB,iBAjBA,kBAAA,CAiByB,IAAe,EAhBhD,UAgB0D,CAAA,EAf/D,cAe+D,CAfhD,UAegD,CAAA;AAoBlE;;;;;;iBApBgB,gBAAA,SAAyB,eAAe;;;;;;;iBAoBlC,sBAAA,SACZ,eAAe,cACtB,QAAQ"}
@@ -1,31 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.concatUint8Array = concatUint8Array;
7
- exports.concatUint8ArrayStream = concatUint8ArrayStream;
8
- exports.uint8ArrayToStream = uint8ArrayToStream;
9
- function uint8ArrayToStream(r) {
10
- return new ReadableStream({
11
- start(t) {
12
- t.enqueue(r), t.close();
13
- }
14
- });
15
- }
16
- function concatUint8Array(r) {
17
- let t = 0;
18
- for (const n of r) t += n.length;
19
- const e = new Uint8Array(t);
20
- let a = 0;
21
- for (const n of r) e.set(n, a), a += n.length;
22
- return e;
23
- }
24
- async function concatUint8ArrayStream(r) {
25
- const t = [];
26
- return await r.pipeTo(new WritableStream({
27
- write(e) {
28
- t.push(e);
29
- }
30
- })), concatUint8Array(t);
31
- }
1
+ const e=require(`./uint8-array-to-stream-Cihhs2sR.cjs`);exports.concatUint8Array=e.t,exports.concatUint8ArrayStream=e.n,exports.uint8ArrayToStream=e.r;
@@ -0,0 +1,2 @@
1
+ import { n as concatUint8ArrayStream, r as uint8ArrayToStream, t as concatUint8Array } from "./uint8-array-to-stream-C9Mja3TP.cjs";
2
+ export { concatUint8Array, concatUint8ArrayStream, uint8ArrayToStream };
@@ -0,0 +1,2 @@
1
+ import { n as concatUint8ArrayStream, r as uint8ArrayToStream, t as concatUint8Array } from "./uint8-array-to-stream-gy0Q2EoT.mjs";
2
+ export { concatUint8Array, concatUint8ArrayStream, uint8ArrayToStream };
@@ -1 +1 @@
1
- export function uint8ArrayToStream(r){return new ReadableStream({start(t){t.enqueue(r),t.close()}})}export function concatUint8Array(r){let t=0;for(const n of r)t+=n.length;const e=new Uint8Array(t);let a=0;for(const n of r)e.set(n,a),a+=n.length;return e}export async function concatUint8ArrayStream(r){const t=[];return await r.pipeTo(new WritableStream({write(e){t.push(e)}})),concatUint8Array(t)}
1
+ import{n as e,r as t,t as n}from"./uint8-array-to-stream-DTph8RAX.mjs";export{n as concatUint8Array,e as concatUint8ArrayStream,t as uint8ArrayToStream};
@@ -0,0 +1,11 @@
1
+ //#region src/uint8-array-to-string.d.ts
2
+ /**
3
+ * Convert a Uint8Array to a base64 string
4
+ *
5
+ * @param buffer - The Uint8Array to convert
6
+ * @returns The converted base64 string
7
+ */
8
+ declare function uint8ArrayToString(buffer: Uint8Array): string;
9
+ //#endregion
10
+ export { uint8ArrayToString as t };
11
+ //# sourceMappingURL=uint8-array-to-string-B1OAtvJr.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uint8-array-to-string-B1OAtvJr.d.cts","names":[],"sources":["../src/uint8-array-to-string.ts"],"sourcesContent":[],"mappings":";;AA0BA;;;;;iBAAgB,kBAAA,SAA2B"}
@@ -0,0 +1,2 @@
1
+ import{t as e}from"./array-buffer-to-string-Ck1wKcim.mjs";function t(t){return btoa(e(t))}export{t};
2
+ //# sourceMappingURL=uint8-array-to-string-CQvEdtuI.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uint8-array-to-string-CQvEdtuI.mjs","names":[],"sources":["../src/uint8-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\nimport { arrayBufferToString } from \"./array-buffer-to-string\";\n\n/**\n * Convert a Uint8Array to a base64 string\n *\n * @param buffer - The Uint8Array to convert\n * @returns The converted base64 string\n */\nexport function uint8ArrayToString(buffer: Uint8Array): string {\n return btoa(arrayBufferToString(buffer));\n}\n"],"mappings":"0DA0BA,SAAgB,EAAmB,EAA4B,CAC7D,OAAO,KAAK,EAAoB,EAAO,CAAC"}
@@ -0,0 +1,11 @@
1
+ //#region src/uint8-array-to-string.d.ts
2
+ /**
3
+ * Convert a Uint8Array to a base64 string
4
+ *
5
+ * @param buffer - The Uint8Array to convert
6
+ * @returns The converted base64 string
7
+ */
8
+ declare function uint8ArrayToString(buffer: Uint8Array): string;
9
+ //#endregion
10
+ export { uint8ArrayToString as t };
11
+ //# sourceMappingURL=uint8-array-to-string-CjA1fEXC.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uint8-array-to-string-CjA1fEXC.d.mts","names":[],"sources":["../src/uint8-array-to-string.ts"],"sourcesContent":[],"mappings":";;AA0BA;;;;;iBAAgB,kBAAA,SAA2B"}
@@ -0,0 +1 @@
1
+ const e=require(`./array-buffer-to-string-C11aVDDi.cjs`);function t(t){return btoa(e.t(t))}Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return t}});
@@ -1,10 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.uint8ArrayToString = uint8ArrayToString;
7
- var _arrayBufferToString = require("./array-buffer-to-string.cjs");
8
- function uint8ArrayToString(r) {
9
- return btoa((0, _arrayBufferToString.arrayBufferToString)(r));
10
- }
1
+ const e=require(`./uint8-array-to-string-CmUiFDa1.cjs`);exports.uint8ArrayToString=e.t;
@@ -0,0 +1,2 @@
1
+ import { t as uint8ArrayToString } from "./uint8-array-to-string-B1OAtvJr.cjs";
2
+ export { uint8ArrayToString };
@@ -0,0 +1,2 @@
1
+ import { t as uint8ArrayToString } from "./uint8-array-to-string-CjA1fEXC.mjs";
2
+ export { uint8ArrayToString };
@@ -1 +1 @@
1
- import{arrayBufferToString as t}from"./array-buffer-to-string";export function uint8ArrayToString(r){return btoa(t(r))}
1
+ import{t as e}from"./uint8-array-to-string-CQvEdtuI.mjs";export{e as uint8ArrayToString};
@@ -1,3 +1,4 @@
1
+ //#region src/uint8-array-to-string.node.d.ts
1
2
  /**
2
3
  * Convert a Uint8Array array to string
3
4
  *
@@ -7,4 +8,7 @@
7
8
  * @param arr - Uint8Array to convert
8
9
  * @returns The converted string
9
10
  */
10
- export declare const uint8ArrayToString: (arr: Uint8Array) => string;
11
+ declare const uint8ArrayToString: (arr: Uint8Array) => string;
12
+ //#endregion
13
+ export { uint8ArrayToString as t };
14
+ //# sourceMappingURL=uint8-array-to-string.node-BEp4mxNL.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uint8-array-to-string.node-BEp4mxNL.d.mts","names":[],"sources":["../src/uint8-array-to-string.node.ts"],"sourcesContent":[],"mappings":";;AA6BA;;;;;;;;cAAa,0BAA2B"}
@@ -0,0 +1,14 @@
1
+ //#region src/uint8-array-to-string.node.d.ts
2
+ /**
3
+ * Convert a Uint8Array array to string
4
+ *
5
+ * @see https://stackoverflow.com/a/41798356/1465919
6
+ * @see https://stackoverflow.com/a/36949791/1465919
7
+ *
8
+ * @param arr - Uint8Array to convert
9
+ * @returns The converted string
10
+ */
11
+ declare const uint8ArrayToString: (arr: Uint8Array) => string;
12
+ //#endregion
13
+ export { uint8ArrayToString as t };
14
+ //# sourceMappingURL=uint8-array-to-string.node-DAjOixF7.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uint8-array-to-string.node-DAjOixF7.d.cts","names":[],"sources":["../src/uint8-array-to-string.node.ts"],"sourcesContent":[],"mappings":";;AA6BA;;;;;;;;cAAa,0BAA2B"}
@@ -0,0 +1 @@
1
+ let e=require(`node:buffer`);const t=t=>decodeURIComponent(e.Buffer.from(t).toString(`utf8`));Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return t}});
@@ -0,0 +1,2 @@
1
+ import{Buffer as e}from"node:buffer";const t=t=>decodeURIComponent(e.from(t).toString(`utf8`));export{t};
2
+ //# sourceMappingURL=uint8-array-to-string.node-t7NS2Zmo.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uint8-array-to-string.node-t7NS2Zmo.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,9 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.uint8ArrayToString = void 0;
7
- var _nodeBuffer = require("node:buffer");
8
- const uint8ArrayToString = r => decodeURIComponent(_nodeBuffer.Buffer.from(r).toString("utf8"));
9
- exports.uint8ArrayToString = uint8ArrayToString;
1
+ const e=require(`./uint8-array-to-string.node-nB1JhZqQ.cjs`);exports.uint8ArrayToString=e.t;
@@ -0,0 +1,2 @@
1
+ import { t as uint8ArrayToString } from "./uint8-array-to-string.node-DAjOixF7.cjs";
2
+ export { uint8ArrayToString };
@@ -0,0 +1,2 @@
1
+ import { t as uint8ArrayToString } from "./uint8-array-to-string.node-BEp4mxNL.mjs";
2
+ export { uint8ArrayToString };
@@ -1 +1 @@
1
- import{Buffer as t}from"node:buffer";export const uint8ArrayToString=r=>decodeURIComponent(t.from(r).toString("utf8"));
1
+ import{t as e}from"./uint8-array-to-string.node-t7NS2Zmo.mjs";export{e as uint8ArrayToString};
@@ -0,0 +1,11 @@
1
+ //#region src/utf8-array-to-string.d.ts
2
+ /**
3
+ * Convert a utf-8 array to string
4
+ *
5
+ * @param input - Utf-8 Array
6
+ * @returns The converted string
7
+ */
8
+ declare function utf8ArrayToString(input: NodeJS.ArrayBufferView | ArrayBuffer): string;
9
+ //#endregion
10
+ export { utf8ArrayToString as t };
11
+ //# sourceMappingURL=utf8-array-to-string-BiFD671-.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utf8-array-to-string-BiFD671-.d.cts","names":[],"sources":["../src/utf8-array-to-string.ts"],"sourcesContent":[],"mappings":";;AA0BA;;;;;iBAAgB,iBAAA,QACP,MAAA,CAAO,kBAAkB"}
@@ -0,0 +1,11 @@
1
+ //#region src/utf8-array-to-string.d.ts
2
+ /**
3
+ * Convert a utf-8 array to string
4
+ *
5
+ * @param input - Utf-8 Array
6
+ * @returns The converted string
7
+ */
8
+ declare function utf8ArrayToString(input: NodeJS.ArrayBufferView | ArrayBuffer): string;
9
+ //#endregion
10
+ export { utf8ArrayToString as t };
11
+ //# sourceMappingURL=utf8-array-to-string-Brda-b96.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utf8-array-to-string-Brda-b96.d.mts","names":[],"sources":["../src/utf8-array-to-string.ts"],"sourcesContent":[],"mappings":";;AA0BA;;;;;iBAAgB,iBAAA,QACP,MAAA,CAAO,kBAAkB"}
@@ -0,0 +1,2 @@
1
+ const e=new TextDecoder;function t(t){return e.decode(t)}export{t};
2
+ //# sourceMappingURL=utf8-array-to-string-D96sN_nr.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utf8-array-to-string-D96sN_nr.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"}
@@ -0,0 +1 @@
1
+ const e=new TextDecoder;function t(t){return e.decode(t)}Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return t}});
@@ -1,10 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.utf8ArrayToString = utf8ArrayToString;
7
- const e = new TextDecoder();
8
- function utf8ArrayToString(r) {
9
- return e.decode(r);
10
- }
1
+ const e=require(`./utf8-array-to-string-lutucTzo.cjs`);exports.utf8ArrayToString=e.t;
@@ -0,0 +1,2 @@
1
+ import { t as utf8ArrayToString } from "./utf8-array-to-string-BiFD671-.cjs";
2
+ export { utf8ArrayToString };
@@ -0,0 +1,2 @@
1
+ import { t as utf8ArrayToString } from "./utf8-array-to-string-Brda-b96.mjs";
2
+ export { utf8ArrayToString };
@@ -1 +1 @@
1
- const e=new TextDecoder;export function utf8ArrayToString(r){return e.decode(r)}
1
+ import{t as e}from"./utf8-array-to-string-D96sN_nr.mjs";export{e as utf8ArrayToString};