@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.
- package/CHANGELOG.md +14 -0
- package/dist/array-buffer-to-string.cjs +19 -1
- package/dist/array-buffer-to-string.mjs +18 -1
- package/dist/array-buffer-to-string.mjs.map +1 -1
- package/dist/buffer-to-string.cjs +14 -1
- package/dist/buffer-to-string.mjs +13 -1
- package/dist/buffer-to-string.mjs.map +1 -1
- package/dist/index.cjs +27 -1
- package/dist/index.mjs +13 -1
- package/dist/neutral.cjs +23 -1
- package/dist/neutral.mjs +11 -1
- package/dist/parse-type-definition.cjs +37 -1
- package/dist/parse-type-definition.mjs +37 -1
- package/dist/parse-type-definition.mjs.map +1 -1
- package/dist/string-to-buffer.cjs +27 -1
- package/dist/string-to-buffer.mjs +27 -1
- package/dist/string-to-buffer.mjs.map +1 -1
- package/dist/string-to-uint8-array.cjs +37 -1
- package/dist/string-to-uint8-array.mjs +34 -1
- package/dist/string-to-uint8-array.mjs.map +1 -1
- package/dist/string-to-utf8-array.cjs +15 -1
- package/dist/string-to-utf8-array.mjs +14 -1
- package/dist/string-to-utf8-array.mjs.map +1 -1
- package/dist/to-array.cjs +15 -1
- package/dist/to-array.mjs +14 -1
- package/dist/to-array.mjs.map +1 -1
- package/dist/to-string-key.cjs +15 -1
- package/dist/to-string-key.mjs +14 -1
- package/dist/to-string-key.mjs.map +1 -1
- package/dist/type-checks/src/get-object-tag.cjs +15 -1
- package/dist/type-checks/src/get-object-tag.mjs +14 -1
- package/dist/type-checks/src/get-object-tag.mjs.map +1 -1
- package/dist/type-checks/src/index.cjs +7 -1
- package/dist/type-checks/src/index.mjs +9 -1
- package/dist/type-checks/src/is-buffer.cjs +12 -1
- package/dist/type-checks/src/is-buffer.mjs +11 -1
- package/dist/type-checks/src/is-buffer.mjs.map +1 -1
- package/dist/type-checks/src/is-collection.cjs +1 -1
- package/dist/type-checks/src/is-collection.mjs +3 -1
- package/dist/type-checks/src/is-object.cjs +19 -1
- package/dist/type-checks/src/is-object.mjs +19 -1
- package/dist/type-checks/src/is-object.mjs.map +1 -1
- package/dist/type-checks/src/is-plain-object.cjs +64 -1
- package/dist/type-checks/src/is-plain-object.mjs +63 -1
- package/dist/type-checks/src/is-plain-object.mjs.map +1 -1
- package/dist/type-checks/src/is-string.cjs +12 -1
- package/dist/type-checks/src/is-string.mjs +11 -1
- package/dist/type-checks/src/is-string.mjs.map +1 -1
- package/dist/type-checks/src/type-detect.cjs +15 -1
- package/dist/type-checks/src/type-detect.mjs +16 -1
- package/dist/type-checks/src/type-detect.mjs.map +1 -1
- package/dist/uint8-array-to-stream.cjs +49 -1
- package/dist/uint8-array-to-stream.mjs +46 -1
- package/dist/uint8-array-to-stream.mjs.map +1 -1
- package/dist/uint8-array-to-string.cjs +15 -1
- package/dist/uint8-array-to-string.mjs +15 -1
- package/dist/uint8-array-to-string.mjs.map +1 -1
- package/dist/uint8-array-to-string.node.cjs +16 -1
- package/dist/uint8-array-to-string.node.mjs +16 -1
- package/dist/uint8-array-to-string.node.mjs.map +1 -1
- package/dist/utf8-array-to-string.cjs +15 -1
- package/dist/utf8-array-to-string.mjs +14 -1
- package/dist/utf8-array-to-string.mjs.map +1 -1
- package/package.json +3 -3
|
@@ -1,2 +1,17 @@
|
|
|
1
|
-
import{Buffer
|
|
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":"
|
|
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
|
-
|
|
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
|
-
|
|
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,
|
|
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.
|
|
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.
|
|
71
|
+
"devDependencies": { "@types/node": "^24.10.9", "tsdown": "^0.17.2" },
|
|
72
72
|
"publishConfig": { "access": "public" },
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "9c02f25b3bf83a1228a94fc2ef3fcd816dc0f707"
|
|
74
74
|
}
|