@fangzhongya/utils 0.0.26 → 0.0.28
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/dist/basic/array/index.cjs +4 -4
- package/dist/basic/array/index.js +4 -4
- package/dist/basic/index.cjs +11 -10
- package/dist/basic/index.d.cts +2 -1
- package/dist/basic/index.d.ts +2 -1
- package/dist/basic/index.js +10 -9
- package/dist/basic/object/index.cjs +7 -7
- package/dist/basic/object/index.js +7 -7
- package/dist/basic/string/index.cjs +12 -8
- package/dist/basic/string/index.d.cts +1 -0
- package/dist/basic/string/index.d.ts +1 -0
- package/dist/basic/string/index.js +14 -10
- package/dist/basic/string/toStringParse.cjs +8 -0
- package/dist/basic/string/toStringParse.d.cts +6 -0
- package/dist/basic/string/toStringParse.d.ts +6 -0
- package/dist/basic/string/toStringParse.js +8 -0
- package/dist/{chunk-DIMR6F5X.cjs → chunk-5J5H4CQI.cjs} +11 -7
- package/dist/chunk-CS3E5UZ2.cjs +24 -0
- package/dist/{chunk-JS4O3XRD.js → chunk-FROL42SM.js} +3 -3
- package/dist/chunk-GHJWTV6H.js +41 -0
- package/dist/chunk-HMAAC5QA.cjs +41 -0
- package/dist/{chunk-T4SE6BE6.cjs → chunk-JZQA6OH4.cjs} +7 -3
- package/dist/chunk-MGK5PCGH.js +191 -0
- package/dist/{chunk-O7FRG555.js → chunk-SOHG7BA5.js} +13 -9
- package/dist/{chunk-TAWTCLBM.js → chunk-TQGXHFVK.js} +7 -3
- package/dist/chunk-XG44HG5N.cjs +191 -0
- package/dist/{index-C__Goqn1.d.cts → index--yFTfMpc.d.cts} +3 -1
- package/dist/{index-VbgOqtuF.d.ts → index-Br7o4Zbz.d.ts} +1 -1
- package/dist/{index-IJlghj8j.d.ts → index-CLnASTZ5.d.ts} +3 -1
- package/dist/{index-CVrzXZU0.d.ts → index-CmiMKPSL.d.ts} +3 -1
- package/dist/{index-5Gw-pdd1.d.cts → index-DaryquSt.d.cts} +3 -1
- package/dist/{index-ClzD7A8u.d.cts → index-Dmv6PGiQ.d.cts} +1 -1
- package/dist/index.cjs +14 -12
- package/dist/index.d.cts +5 -3
- package/dist/index.d.ts +5 -3
- package/dist/index.js +13 -11
- package/dist/urls/getReplaceUrls.cjs +11 -0
- package/dist/urls/getReplaceUrls.d.cts +9 -0
- package/dist/urls/getReplaceUrls.d.ts +9 -0
- package/dist/urls/getReplaceUrls.js +11 -0
- package/dist/urls/index.cjs +9 -5
- package/dist/urls/index.d.cts +1 -0
- package/dist/urls/index.d.ts +1 -0
- package/dist/urls/index.js +8 -4
- package/package.json +11 -1
- package/dist/chunk-NRG3V6TH.cjs +0 -24
- package/dist/{chunk-EGM54DV6.js → chunk-3MPKAL6Z.js} +3 -3
- package/dist/{chunk-S5SLR7IL.cjs → chunk-4K5L3QJW.cjs} +3 -3
- package/dist/{chunk-5AAUEW6L.js → chunk-MECBPLFH.js} +6 -6
- package/dist/{chunk-6N2DOMCK.cjs → chunk-UKUXUB64.cjs} +6 -6
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import {
|
|
2
|
+
toFunction
|
|
3
|
+
} from "./chunk-7O4MJOHM.js";
|
|
4
|
+
|
|
5
|
+
// packages/basic/string/toStringParse.ts
|
|
6
|
+
var arrayBufferUtils = {
|
|
7
|
+
// 将ArrayBuffer编码为Base64字符串
|
|
8
|
+
encode: (buffer) => {
|
|
9
|
+
if (typeof Buffer !== "undefined") {
|
|
10
|
+
const bytes = new Uint8Array(buffer);
|
|
11
|
+
let binary = "";
|
|
12
|
+
bytes.forEach((byte) => binary += String.fromCharCode(byte));
|
|
13
|
+
return btoa(binary);
|
|
14
|
+
}
|
|
15
|
+
if (typeof btoa === "function") {
|
|
16
|
+
const bytes = new Uint8Array(buffer);
|
|
17
|
+
let binary = "";
|
|
18
|
+
for (let i = 0; i < bytes.byteLength; i++) {
|
|
19
|
+
binary += String.fromCharCode(bytes[i]);
|
|
20
|
+
}
|
|
21
|
+
return btoa(binary);
|
|
22
|
+
}
|
|
23
|
+
throw new Error(
|
|
24
|
+
"ArrayBuffer encoding not supported in this environment"
|
|
25
|
+
);
|
|
26
|
+
},
|
|
27
|
+
// 将Base64字符串解码为ArrayBuffer
|
|
28
|
+
decode: (base64Str) => {
|
|
29
|
+
if (typeof Buffer !== "undefined") {
|
|
30
|
+
const binaryString = atob(base64Str);
|
|
31
|
+
const bytes = new Uint8Array(binaryString.length);
|
|
32
|
+
for (let i = 0; i < binaryString.length; i++) {
|
|
33
|
+
bytes[i] = binaryString.charCodeAt(i);
|
|
34
|
+
}
|
|
35
|
+
return bytes.buffer;
|
|
36
|
+
}
|
|
37
|
+
if (typeof atob === "function") {
|
|
38
|
+
const binaryString = atob(base64Str);
|
|
39
|
+
const bytes = new Uint8Array(binaryString.length);
|
|
40
|
+
for (let i = 0; i < binaryString.length; i++) {
|
|
41
|
+
bytes[i] = binaryString.charCodeAt(i);
|
|
42
|
+
}
|
|
43
|
+
return bytes.buffer;
|
|
44
|
+
}
|
|
45
|
+
throw new Error(
|
|
46
|
+
"ArrayBuffer decoding not supported in this environment"
|
|
47
|
+
);
|
|
48
|
+
},
|
|
49
|
+
// 获取ArrayBuffer的字节数组表示
|
|
50
|
+
toByteArray: (buffer) => {
|
|
51
|
+
return Array.from(new Uint8Array(buffer));
|
|
52
|
+
},
|
|
53
|
+
// 从字节数组创建ArrayBuffer
|
|
54
|
+
fromByteArray: (array) => {
|
|
55
|
+
const buffer = new ArrayBuffer(array.length);
|
|
56
|
+
const view = new Uint8Array(buffer);
|
|
57
|
+
array.forEach((value, index) => view[index] = value);
|
|
58
|
+
return buffer;
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
function toStringParse(str, type, split = ",") {
|
|
62
|
+
try {
|
|
63
|
+
type = type.toLowerCase();
|
|
64
|
+
switch (type) {
|
|
65
|
+
case "string":
|
|
66
|
+
return str;
|
|
67
|
+
case "number":
|
|
68
|
+
return Number(str);
|
|
69
|
+
case "null":
|
|
70
|
+
return null;
|
|
71
|
+
case "boolean":
|
|
72
|
+
return Boolean(str);
|
|
73
|
+
case "function":
|
|
74
|
+
return toFunction(str) || function() {
|
|
75
|
+
};
|
|
76
|
+
case "undefined":
|
|
77
|
+
return void 0;
|
|
78
|
+
case "array":
|
|
79
|
+
return JSON.parse(str);
|
|
80
|
+
case "map": {
|
|
81
|
+
const v = JSON.parse(str);
|
|
82
|
+
const map = /* @__PURE__ */ new Map();
|
|
83
|
+
if (v instanceof Array) {
|
|
84
|
+
for (let value of v) {
|
|
85
|
+
map.set(value[0], value[1]);
|
|
86
|
+
}
|
|
87
|
+
} else {
|
|
88
|
+
Object.keys(v).forEach((k) => {
|
|
89
|
+
map.set(k, v[k]);
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
return map;
|
|
93
|
+
}
|
|
94
|
+
case "set": {
|
|
95
|
+
const v = JSON.parse(str);
|
|
96
|
+
return new Set(...v);
|
|
97
|
+
}
|
|
98
|
+
case "object":
|
|
99
|
+
return JSON.parse(str);
|
|
100
|
+
case "symbol":
|
|
101
|
+
return Symbol(str);
|
|
102
|
+
case "nan":
|
|
103
|
+
return NaN;
|
|
104
|
+
case "date":
|
|
105
|
+
return new Date(str);
|
|
106
|
+
case "regexp": {
|
|
107
|
+
const e = str.split(split);
|
|
108
|
+
return new RegExp(e[0], e[1]);
|
|
109
|
+
}
|
|
110
|
+
case "infinity":
|
|
111
|
+
return Infinity;
|
|
112
|
+
case "-infinity":
|
|
113
|
+
return -Infinity;
|
|
114
|
+
case "bigint":
|
|
115
|
+
return BigInt(str);
|
|
116
|
+
case "arraybuffer":
|
|
117
|
+
return arrayBufferUtils.decode(str);
|
|
118
|
+
case "error": {
|
|
119
|
+
const e = str.split(split);
|
|
120
|
+
const error = new Error(e[0]);
|
|
121
|
+
error.name = e[1];
|
|
122
|
+
error.stack = e[2];
|
|
123
|
+
return error;
|
|
124
|
+
}
|
|
125
|
+
case "url":
|
|
126
|
+
return new URL(str);
|
|
127
|
+
// 处理所有TypedArray类型
|
|
128
|
+
case "int8array": {
|
|
129
|
+
const arr = str.split(split).map((o) => Number(o));
|
|
130
|
+
return new Int8Array(arrayBufferUtils.fromByteArray(arr));
|
|
131
|
+
}
|
|
132
|
+
case "uint8array": {
|
|
133
|
+
const arr = str.split(split).map((o) => Number(o));
|
|
134
|
+
return new Uint8Array(arrayBufferUtils.fromByteArray(arr));
|
|
135
|
+
}
|
|
136
|
+
case "uint8clampedarray": {
|
|
137
|
+
const arr = str.split(split).map((o) => Number(o));
|
|
138
|
+
return new Uint8ClampedArray(
|
|
139
|
+
arrayBufferUtils.fromByteArray(arr)
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
case "int16array": {
|
|
143
|
+
const arr = str.split(split).map((o) => Number(o));
|
|
144
|
+
return new Int16Array(arrayBufferUtils.fromByteArray(arr));
|
|
145
|
+
}
|
|
146
|
+
case "bigint64array": {
|
|
147
|
+
const arr = str.split(split).map((o) => Number(o));
|
|
148
|
+
return new BigInt64Array(arrayBufferUtils.fromByteArray(arr));
|
|
149
|
+
}
|
|
150
|
+
case "biguint64array": {
|
|
151
|
+
const arr = str.split(split).map((o) => Number(o));
|
|
152
|
+
return new BigUint64Array(arrayBufferUtils.fromByteArray(arr));
|
|
153
|
+
}
|
|
154
|
+
case "float64array": {
|
|
155
|
+
const arr = str.split(split).map((o) => Number(o));
|
|
156
|
+
return new Float64Array(arrayBufferUtils.fromByteArray(arr));
|
|
157
|
+
}
|
|
158
|
+
case "float32array": {
|
|
159
|
+
const arr = str.split(split).map((o) => Number(o));
|
|
160
|
+
return new Float32Array(arrayBufferUtils.fromByteArray(arr));
|
|
161
|
+
}
|
|
162
|
+
case "uint32array": {
|
|
163
|
+
const arr = str.split(split).map((o) => Number(o));
|
|
164
|
+
return new Uint32Array(arrayBufferUtils.fromByteArray(arr));
|
|
165
|
+
}
|
|
166
|
+
case "int32array": {
|
|
167
|
+
const arr = str.split(split).map((o) => Number(o));
|
|
168
|
+
return new Int32Array(arrayBufferUtils.fromByteArray(arr));
|
|
169
|
+
}
|
|
170
|
+
case "uint16array": {
|
|
171
|
+
const arr = str.split(split).map((o) => Number(o));
|
|
172
|
+
return new Uint16Array(arrayBufferUtils.fromByteArray(arr));
|
|
173
|
+
}
|
|
174
|
+
case "dataview": {
|
|
175
|
+
const d = str.split(split);
|
|
176
|
+
const buffer = arrayBufferUtils.decode(d[0]);
|
|
177
|
+
return new DataView(buffer, Number(d[1]), Number(d[2]));
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
} catch (error) {
|
|
181
|
+
console.error("JSON parse error:", {
|
|
182
|
+
str: str.slice(0, 200) + "...",
|
|
183
|
+
error
|
|
184
|
+
});
|
|
185
|
+
return str;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export {
|
|
190
|
+
toStringParse
|
|
191
|
+
};
|
|
@@ -1,27 +1,30 @@
|
|
|
1
|
+
import {
|
|
2
|
+
toJSONParse,
|
|
3
|
+
toJSONStringify
|
|
4
|
+
} from "./chunk-U3PZBQ6G.js";
|
|
1
5
|
import {
|
|
2
6
|
serializeCodeBlock,
|
|
3
7
|
serializeFunctionRef,
|
|
4
8
|
toJSONSParse,
|
|
5
9
|
toJSONSStringify
|
|
6
10
|
} from "./chunk-5HC662VK.js";
|
|
11
|
+
import {
|
|
12
|
+
toStringParse
|
|
13
|
+
} from "./chunk-MGK5PCGH.js";
|
|
14
|
+
import {
|
|
15
|
+
getImports,
|
|
16
|
+
getImportss
|
|
17
|
+
} from "./chunk-DILPRD5C.js";
|
|
7
18
|
import {
|
|
8
19
|
getStartSame
|
|
9
20
|
} from "./chunk-7DTHADVK.js";
|
|
10
21
|
import {
|
|
11
22
|
splitUpper
|
|
12
23
|
} from "./chunk-VKE5JARB.js";
|
|
13
|
-
import {
|
|
14
|
-
toJSONParse,
|
|
15
|
-
toJSONStringify
|
|
16
|
-
} from "./chunk-U3PZBQ6G.js";
|
|
17
24
|
import {
|
|
18
25
|
getFunctionFormat,
|
|
19
26
|
toFunction
|
|
20
27
|
} from "./chunk-7O4MJOHM.js";
|
|
21
|
-
import {
|
|
22
|
-
getImports,
|
|
23
|
-
getImportss
|
|
24
|
-
} from "./chunk-DILPRD5C.js";
|
|
25
28
|
import {
|
|
26
29
|
deComment
|
|
27
30
|
} from "./chunk-FS4JPT23.js";
|
|
@@ -72,7 +75,8 @@ __export(string_exports, {
|
|
|
72
75
|
toJSONParse: () => toJSONParse,
|
|
73
76
|
toJSONSParse: () => toJSONSParse,
|
|
74
77
|
toJSONSStringify: () => toJSONSStringify,
|
|
75
|
-
toJSONStringify: () => toJSONStringify
|
|
78
|
+
toJSONStringify: () => toJSONStringify,
|
|
79
|
+
toStringParse: () => toStringParse
|
|
76
80
|
});
|
|
77
81
|
|
|
78
82
|
export {
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getUrlCatalogueLast
|
|
3
|
+
} from "./chunk-BDJORZRC.js";
|
|
1
4
|
import {
|
|
2
5
|
getImportUrlSuffix
|
|
3
6
|
} from "./chunk-XBZX5YZW.js";
|
|
@@ -16,15 +19,15 @@ import {
|
|
|
16
19
|
import {
|
|
17
20
|
getReplaceUrl
|
|
18
21
|
} from "./chunk-SE7A43WC.js";
|
|
22
|
+
import {
|
|
23
|
+
getReplaceUrls
|
|
24
|
+
} from "./chunk-GHJWTV6H.js";
|
|
19
25
|
import {
|
|
20
26
|
getSuffix
|
|
21
27
|
} from "./chunk-UOADEBDH.js";
|
|
22
28
|
import {
|
|
23
29
|
getUrlCatalogue
|
|
24
30
|
} from "./chunk-YWL2IWBT.js";
|
|
25
|
-
import {
|
|
26
|
-
getUrlCatalogueLast
|
|
27
|
-
} from "./chunk-BDJORZRC.js";
|
|
28
31
|
import {
|
|
29
32
|
getImportUrl
|
|
30
33
|
} from "./chunk-AWC672JW.js";
|
|
@@ -41,6 +44,7 @@ __export(urls_exports, {
|
|
|
41
44
|
getReplaceCompleteUrl: () => getReplaceCompleteUrl,
|
|
42
45
|
getReplaceImportUrl: () => getReplaceImportUrl,
|
|
43
46
|
getReplaceUrl: () => getReplaceUrl,
|
|
47
|
+
getReplaceUrls: () => getReplaceUrls,
|
|
44
48
|
getSuffix: () => getSuffix,
|
|
45
49
|
getUrlCatalogue: () => getUrlCatalogue,
|
|
46
50
|
getUrlCatalogueLast: () => getUrlCatalogueLast,
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunkQXK4IUBIcjs = require('./chunk-QXK4IUBI.cjs');
|
|
4
|
+
|
|
5
|
+
// packages/basic/string/toStringParse.ts
|
|
6
|
+
var arrayBufferUtils = {
|
|
7
|
+
// 将ArrayBuffer编码为Base64字符串
|
|
8
|
+
encode: (buffer) => {
|
|
9
|
+
if (typeof Buffer !== "undefined") {
|
|
10
|
+
const bytes = new Uint8Array(buffer);
|
|
11
|
+
let binary = "";
|
|
12
|
+
bytes.forEach((byte) => binary += String.fromCharCode(byte));
|
|
13
|
+
return btoa(binary);
|
|
14
|
+
}
|
|
15
|
+
if (typeof btoa === "function") {
|
|
16
|
+
const bytes = new Uint8Array(buffer);
|
|
17
|
+
let binary = "";
|
|
18
|
+
for (let i = 0; i < bytes.byteLength; i++) {
|
|
19
|
+
binary += String.fromCharCode(bytes[i]);
|
|
20
|
+
}
|
|
21
|
+
return btoa(binary);
|
|
22
|
+
}
|
|
23
|
+
throw new Error(
|
|
24
|
+
"ArrayBuffer encoding not supported in this environment"
|
|
25
|
+
);
|
|
26
|
+
},
|
|
27
|
+
// 将Base64字符串解码为ArrayBuffer
|
|
28
|
+
decode: (base64Str) => {
|
|
29
|
+
if (typeof Buffer !== "undefined") {
|
|
30
|
+
const binaryString = atob(base64Str);
|
|
31
|
+
const bytes = new Uint8Array(binaryString.length);
|
|
32
|
+
for (let i = 0; i < binaryString.length; i++) {
|
|
33
|
+
bytes[i] = binaryString.charCodeAt(i);
|
|
34
|
+
}
|
|
35
|
+
return bytes.buffer;
|
|
36
|
+
}
|
|
37
|
+
if (typeof atob === "function") {
|
|
38
|
+
const binaryString = atob(base64Str);
|
|
39
|
+
const bytes = new Uint8Array(binaryString.length);
|
|
40
|
+
for (let i = 0; i < binaryString.length; i++) {
|
|
41
|
+
bytes[i] = binaryString.charCodeAt(i);
|
|
42
|
+
}
|
|
43
|
+
return bytes.buffer;
|
|
44
|
+
}
|
|
45
|
+
throw new Error(
|
|
46
|
+
"ArrayBuffer decoding not supported in this environment"
|
|
47
|
+
);
|
|
48
|
+
},
|
|
49
|
+
// 获取ArrayBuffer的字节数组表示
|
|
50
|
+
toByteArray: (buffer) => {
|
|
51
|
+
return Array.from(new Uint8Array(buffer));
|
|
52
|
+
},
|
|
53
|
+
// 从字节数组创建ArrayBuffer
|
|
54
|
+
fromByteArray: (array) => {
|
|
55
|
+
const buffer = new ArrayBuffer(array.length);
|
|
56
|
+
const view = new Uint8Array(buffer);
|
|
57
|
+
array.forEach((value, index) => view[index] = value);
|
|
58
|
+
return buffer;
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
function toStringParse(str, type, split = ",") {
|
|
62
|
+
try {
|
|
63
|
+
type = type.toLowerCase();
|
|
64
|
+
switch (type) {
|
|
65
|
+
case "string":
|
|
66
|
+
return str;
|
|
67
|
+
case "number":
|
|
68
|
+
return Number(str);
|
|
69
|
+
case "null":
|
|
70
|
+
return null;
|
|
71
|
+
case "boolean":
|
|
72
|
+
return Boolean(str);
|
|
73
|
+
case "function":
|
|
74
|
+
return _chunkQXK4IUBIcjs.toFunction.call(void 0, str) || function() {
|
|
75
|
+
};
|
|
76
|
+
case "undefined":
|
|
77
|
+
return void 0;
|
|
78
|
+
case "array":
|
|
79
|
+
return JSON.parse(str);
|
|
80
|
+
case "map": {
|
|
81
|
+
const v = JSON.parse(str);
|
|
82
|
+
const map = /* @__PURE__ */ new Map();
|
|
83
|
+
if (v instanceof Array) {
|
|
84
|
+
for (let value of v) {
|
|
85
|
+
map.set(value[0], value[1]);
|
|
86
|
+
}
|
|
87
|
+
} else {
|
|
88
|
+
Object.keys(v).forEach((k) => {
|
|
89
|
+
map.set(k, v[k]);
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
return map;
|
|
93
|
+
}
|
|
94
|
+
case "set": {
|
|
95
|
+
const v = JSON.parse(str);
|
|
96
|
+
return new Set(...v);
|
|
97
|
+
}
|
|
98
|
+
case "object":
|
|
99
|
+
return JSON.parse(str);
|
|
100
|
+
case "symbol":
|
|
101
|
+
return Symbol(str);
|
|
102
|
+
case "nan":
|
|
103
|
+
return NaN;
|
|
104
|
+
case "date":
|
|
105
|
+
return new Date(str);
|
|
106
|
+
case "regexp": {
|
|
107
|
+
const e = str.split(split);
|
|
108
|
+
return new RegExp(e[0], e[1]);
|
|
109
|
+
}
|
|
110
|
+
case "infinity":
|
|
111
|
+
return Infinity;
|
|
112
|
+
case "-infinity":
|
|
113
|
+
return -Infinity;
|
|
114
|
+
case "bigint":
|
|
115
|
+
return BigInt(str);
|
|
116
|
+
case "arraybuffer":
|
|
117
|
+
return arrayBufferUtils.decode(str);
|
|
118
|
+
case "error": {
|
|
119
|
+
const e = str.split(split);
|
|
120
|
+
const error = new Error(e[0]);
|
|
121
|
+
error.name = e[1];
|
|
122
|
+
error.stack = e[2];
|
|
123
|
+
return error;
|
|
124
|
+
}
|
|
125
|
+
case "url":
|
|
126
|
+
return new URL(str);
|
|
127
|
+
// 处理所有TypedArray类型
|
|
128
|
+
case "int8array": {
|
|
129
|
+
const arr = str.split(split).map((o) => Number(o));
|
|
130
|
+
return new Int8Array(arrayBufferUtils.fromByteArray(arr));
|
|
131
|
+
}
|
|
132
|
+
case "uint8array": {
|
|
133
|
+
const arr = str.split(split).map((o) => Number(o));
|
|
134
|
+
return new Uint8Array(arrayBufferUtils.fromByteArray(arr));
|
|
135
|
+
}
|
|
136
|
+
case "uint8clampedarray": {
|
|
137
|
+
const arr = str.split(split).map((o) => Number(o));
|
|
138
|
+
return new Uint8ClampedArray(
|
|
139
|
+
arrayBufferUtils.fromByteArray(arr)
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
case "int16array": {
|
|
143
|
+
const arr = str.split(split).map((o) => Number(o));
|
|
144
|
+
return new Int16Array(arrayBufferUtils.fromByteArray(arr));
|
|
145
|
+
}
|
|
146
|
+
case "bigint64array": {
|
|
147
|
+
const arr = str.split(split).map((o) => Number(o));
|
|
148
|
+
return new BigInt64Array(arrayBufferUtils.fromByteArray(arr));
|
|
149
|
+
}
|
|
150
|
+
case "biguint64array": {
|
|
151
|
+
const arr = str.split(split).map((o) => Number(o));
|
|
152
|
+
return new BigUint64Array(arrayBufferUtils.fromByteArray(arr));
|
|
153
|
+
}
|
|
154
|
+
case "float64array": {
|
|
155
|
+
const arr = str.split(split).map((o) => Number(o));
|
|
156
|
+
return new Float64Array(arrayBufferUtils.fromByteArray(arr));
|
|
157
|
+
}
|
|
158
|
+
case "float32array": {
|
|
159
|
+
const arr = str.split(split).map((o) => Number(o));
|
|
160
|
+
return new Float32Array(arrayBufferUtils.fromByteArray(arr));
|
|
161
|
+
}
|
|
162
|
+
case "uint32array": {
|
|
163
|
+
const arr = str.split(split).map((o) => Number(o));
|
|
164
|
+
return new Uint32Array(arrayBufferUtils.fromByteArray(arr));
|
|
165
|
+
}
|
|
166
|
+
case "int32array": {
|
|
167
|
+
const arr = str.split(split).map((o) => Number(o));
|
|
168
|
+
return new Int32Array(arrayBufferUtils.fromByteArray(arr));
|
|
169
|
+
}
|
|
170
|
+
case "uint16array": {
|
|
171
|
+
const arr = str.split(split).map((o) => Number(o));
|
|
172
|
+
return new Uint16Array(arrayBufferUtils.fromByteArray(arr));
|
|
173
|
+
}
|
|
174
|
+
case "dataview": {
|
|
175
|
+
const d = str.split(split);
|
|
176
|
+
const buffer = arrayBufferUtils.decode(d[0]);
|
|
177
|
+
return new DataView(buffer, Number(d[1]), Number(d[2]));
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
} catch (error) {
|
|
181
|
+
console.error("JSON parse error:", {
|
|
182
|
+
str: str.slice(0, 200) + "...",
|
|
183
|
+
error
|
|
184
|
+
});
|
|
185
|
+
return str;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
exports.toStringParse = toStringParse;
|
|
@@ -4,6 +4,7 @@ import { getNewFileName } from './urls/getNewFileName.cjs';
|
|
|
4
4
|
import { getReplaceCompleteUrl } from './urls/getReplaceCompleteUrl.cjs';
|
|
5
5
|
import { getReplaceImportUrl } from './urls/getReplaceImportUrl.cjs';
|
|
6
6
|
import { getReplaceUrl } from './urls/getReplaceUrl.cjs';
|
|
7
|
+
import { getReplaceUrls } from './urls/getReplaceUrls.cjs';
|
|
7
8
|
import { getSuffix } from './urls/getSuffix.cjs';
|
|
8
9
|
import { getUrlCatalogue } from './urls/getUrlCatalogue.cjs';
|
|
9
10
|
import { getUrlCatalogueLast } from './urls/getUrlCatalogueLast.cjs';
|
|
@@ -16,12 +17,13 @@ declare const index_getNewFileName: typeof getNewFileName;
|
|
|
16
17
|
declare const index_getReplaceCompleteUrl: typeof getReplaceCompleteUrl;
|
|
17
18
|
declare const index_getReplaceImportUrl: typeof getReplaceImportUrl;
|
|
18
19
|
declare const index_getReplaceUrl: typeof getReplaceUrl;
|
|
20
|
+
declare const index_getReplaceUrls: typeof getReplaceUrls;
|
|
19
21
|
declare const index_getSuffix: typeof getSuffix;
|
|
20
22
|
declare const index_getUrlCatalogue: typeof getUrlCatalogue;
|
|
21
23
|
declare const index_getUrlCatalogueLast: typeof getUrlCatalogueLast;
|
|
22
24
|
declare const index_getUrlCatalogueObj: typeof getUrlCatalogueObj;
|
|
23
25
|
declare namespace index {
|
|
24
|
-
export { index_UrlCatalogue as UrlCatalogue, index_getImportUrl as getImportUrl, index_getImportUrlSuffix as getImportUrlSuffix, index_getNewFileName as getNewFileName, index_getReplaceCompleteUrl as getReplaceCompleteUrl, index_getReplaceImportUrl as getReplaceImportUrl, index_getReplaceUrl as getReplaceUrl, index_getSuffix as getSuffix, index_getUrlCatalogue as getUrlCatalogue, index_getUrlCatalogueLast as getUrlCatalogueLast, index_getUrlCatalogueObj as getUrlCatalogueObj };
|
|
26
|
+
export { index_UrlCatalogue as UrlCatalogue, index_getImportUrl as getImportUrl, index_getImportUrlSuffix as getImportUrlSuffix, index_getNewFileName as getNewFileName, index_getReplaceCompleteUrl as getReplaceCompleteUrl, index_getReplaceImportUrl as getReplaceImportUrl, index_getReplaceUrl as getReplaceUrl, index_getReplaceUrls as getReplaceUrls, index_getSuffix as getSuffix, index_getUrlCatalogue as getUrlCatalogue, index_getUrlCatalogueLast as getUrlCatalogueLast, index_getUrlCatalogueObj as getUrlCatalogueObj };
|
|
25
27
|
}
|
|
26
28
|
|
|
27
29
|
export { index as i };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as index$1 } from './index-C29DFVeC.js';
|
|
2
2
|
import { i as index$2 } from './index-DOq59RNr.js';
|
|
3
|
-
import { i as index$3 } from './index-
|
|
3
|
+
import { i as index$3 } from './index-CmiMKPSL.js';
|
|
4
4
|
|
|
5
5
|
declare namespace index {
|
|
6
6
|
export { index$1 as array, index$2 as object, index$3 as string };
|
|
@@ -4,6 +4,7 @@ import { getNewFileName } from './urls/getNewFileName.js';
|
|
|
4
4
|
import { getReplaceCompleteUrl } from './urls/getReplaceCompleteUrl.js';
|
|
5
5
|
import { getReplaceImportUrl } from './urls/getReplaceImportUrl.js';
|
|
6
6
|
import { getReplaceUrl } from './urls/getReplaceUrl.js';
|
|
7
|
+
import { getReplaceUrls } from './urls/getReplaceUrls.js';
|
|
7
8
|
import { getSuffix } from './urls/getSuffix.js';
|
|
8
9
|
import { getUrlCatalogue } from './urls/getUrlCatalogue.js';
|
|
9
10
|
import { getUrlCatalogueLast } from './urls/getUrlCatalogueLast.js';
|
|
@@ -16,12 +17,13 @@ declare const index_getNewFileName: typeof getNewFileName;
|
|
|
16
17
|
declare const index_getReplaceCompleteUrl: typeof getReplaceCompleteUrl;
|
|
17
18
|
declare const index_getReplaceImportUrl: typeof getReplaceImportUrl;
|
|
18
19
|
declare const index_getReplaceUrl: typeof getReplaceUrl;
|
|
20
|
+
declare const index_getReplaceUrls: typeof getReplaceUrls;
|
|
19
21
|
declare const index_getSuffix: typeof getSuffix;
|
|
20
22
|
declare const index_getUrlCatalogue: typeof getUrlCatalogue;
|
|
21
23
|
declare const index_getUrlCatalogueLast: typeof getUrlCatalogueLast;
|
|
22
24
|
declare const index_getUrlCatalogueObj: typeof getUrlCatalogueObj;
|
|
23
25
|
declare namespace index {
|
|
24
|
-
export { index_UrlCatalogue as UrlCatalogue, index_getImportUrl as getImportUrl, index_getImportUrlSuffix as getImportUrlSuffix, index_getNewFileName as getNewFileName, index_getReplaceCompleteUrl as getReplaceCompleteUrl, index_getReplaceImportUrl as getReplaceImportUrl, index_getReplaceUrl as getReplaceUrl, index_getSuffix as getSuffix, index_getUrlCatalogue as getUrlCatalogue, index_getUrlCatalogueLast as getUrlCatalogueLast, index_getUrlCatalogueObj as getUrlCatalogueObj };
|
|
26
|
+
export { index_UrlCatalogue as UrlCatalogue, index_getImportUrl as getImportUrl, index_getImportUrlSuffix as getImportUrlSuffix, index_getNewFileName as getNewFileName, index_getReplaceCompleteUrl as getReplaceCompleteUrl, index_getReplaceImportUrl as getReplaceImportUrl, index_getReplaceUrl as getReplaceUrl, index_getReplaceUrls as getReplaceUrls, index_getSuffix as getSuffix, index_getUrlCatalogue as getUrlCatalogue, index_getUrlCatalogueLast as getUrlCatalogueLast, index_getUrlCatalogueObj as getUrlCatalogueObj };
|
|
25
27
|
}
|
|
26
28
|
|
|
27
29
|
export { index as i };
|
|
@@ -12,6 +12,7 @@ import { startsNum } from './basic/string/startsNum.js';
|
|
|
12
12
|
import { getFunctionFormat, toFunction } from './basic/string/toFunction.js';
|
|
13
13
|
import { toJSONParse, toJSONStringify } from './basic/string/toJson.js';
|
|
14
14
|
import { CodeBlock, serializeCodeBlock, serializeFunctionRef, toJSONSParse, toJSONSStringify } from './basic/string/toJsons.js';
|
|
15
|
+
import { toStringParse } from './basic/string/toStringParse.js';
|
|
15
16
|
|
|
16
17
|
declare const index_CodeBlock: typeof CodeBlock;
|
|
17
18
|
declare const index_appearNum: typeof appearNum;
|
|
@@ -34,8 +35,9 @@ declare const index_toJSONParse: typeof toJSONParse;
|
|
|
34
35
|
declare const index_toJSONSParse: typeof toJSONSParse;
|
|
35
36
|
declare const index_toJSONSStringify: typeof toJSONSStringify;
|
|
36
37
|
declare const index_toJSONStringify: typeof toJSONStringify;
|
|
38
|
+
declare const index_toStringParse: typeof toStringParse;
|
|
37
39
|
declare namespace index {
|
|
38
|
-
export { index_CodeBlock as CodeBlock, index_appearNum as appearNum, index_appearNumSeat as appearNumSeat, index_deComment as deComment, index_firstLower as firstLower, index_firstUpper as firstUpper, index_getFunctionFormat as getFunctionFormat, index_getImports as getImports, index_getImportss as getImportss, index_getStartSame as getStartSame, index_getStartSames as getStartSames, index_getStrNunPosit as getStrNunPosit, index_serializeCodeBlock as serializeCodeBlock, index_serializeFunctionRef as serializeFunctionRef, index_splitUpper as splitUpper, index_startsNum as startsNum, index_toFunction as toFunction, index_toJSONParse as toJSONParse, index_toJSONSParse as toJSONSParse, index_toJSONSStringify as toJSONSStringify, index_toJSONStringify as toJSONStringify };
|
|
40
|
+
export { index_CodeBlock as CodeBlock, index_appearNum as appearNum, index_appearNumSeat as appearNumSeat, index_deComment as deComment, index_firstLower as firstLower, index_firstUpper as firstUpper, index_getFunctionFormat as getFunctionFormat, index_getImports as getImports, index_getImportss as getImportss, index_getStartSame as getStartSame, index_getStartSames as getStartSames, index_getStrNunPosit as getStrNunPosit, index_serializeCodeBlock as serializeCodeBlock, index_serializeFunctionRef as serializeFunctionRef, index_splitUpper as splitUpper, index_startsNum as startsNum, index_toFunction as toFunction, index_toJSONParse as toJSONParse, index_toJSONSParse as toJSONSParse, index_toJSONSStringify as toJSONSStringify, index_toJSONStringify as toJSONStringify, index_toStringParse as toStringParse };
|
|
39
41
|
}
|
|
40
42
|
|
|
41
43
|
export { index as i };
|
|
@@ -12,6 +12,7 @@ import { startsNum } from './basic/string/startsNum.cjs';
|
|
|
12
12
|
import { getFunctionFormat, toFunction } from './basic/string/toFunction.cjs';
|
|
13
13
|
import { toJSONParse, toJSONStringify } from './basic/string/toJson.cjs';
|
|
14
14
|
import { CodeBlock, serializeCodeBlock, serializeFunctionRef, toJSONSParse, toJSONSStringify } from './basic/string/toJsons.cjs';
|
|
15
|
+
import { toStringParse } from './basic/string/toStringParse.cjs';
|
|
15
16
|
|
|
16
17
|
declare const index_CodeBlock: typeof CodeBlock;
|
|
17
18
|
declare const index_appearNum: typeof appearNum;
|
|
@@ -34,8 +35,9 @@ declare const index_toJSONParse: typeof toJSONParse;
|
|
|
34
35
|
declare const index_toJSONSParse: typeof toJSONSParse;
|
|
35
36
|
declare const index_toJSONSStringify: typeof toJSONSStringify;
|
|
36
37
|
declare const index_toJSONStringify: typeof toJSONStringify;
|
|
38
|
+
declare const index_toStringParse: typeof toStringParse;
|
|
37
39
|
declare namespace index {
|
|
38
|
-
export { index_CodeBlock as CodeBlock, index_appearNum as appearNum, index_appearNumSeat as appearNumSeat, index_deComment as deComment, index_firstLower as firstLower, index_firstUpper as firstUpper, index_getFunctionFormat as getFunctionFormat, index_getImports as getImports, index_getImportss as getImportss, index_getStartSame as getStartSame, index_getStartSames as getStartSames, index_getStrNunPosit as getStrNunPosit, index_serializeCodeBlock as serializeCodeBlock, index_serializeFunctionRef as serializeFunctionRef, index_splitUpper as splitUpper, index_startsNum as startsNum, index_toFunction as toFunction, index_toJSONParse as toJSONParse, index_toJSONSParse as toJSONSParse, index_toJSONSStringify as toJSONSStringify, index_toJSONStringify as toJSONStringify };
|
|
40
|
+
export { index_CodeBlock as CodeBlock, index_appearNum as appearNum, index_appearNumSeat as appearNumSeat, index_deComment as deComment, index_firstLower as firstLower, index_firstUpper as firstUpper, index_getFunctionFormat as getFunctionFormat, index_getImports as getImports, index_getImportss as getImportss, index_getStartSame as getStartSame, index_getStartSames as getStartSames, index_getStrNunPosit as getStrNunPosit, index_serializeCodeBlock as serializeCodeBlock, index_serializeFunctionRef as serializeFunctionRef, index_splitUpper as splitUpper, index_startsNum as startsNum, index_toFunction as toFunction, index_toJSONParse as toJSONParse, index_toJSONSParse as toJSONSParse, index_toJSONSStringify as toJSONSStringify, index_toJSONStringify as toJSONStringify, index_toStringParse as toStringParse };
|
|
39
41
|
}
|
|
40
42
|
|
|
41
43
|
export { index as i };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as index$1 } from './index-qUiGxoy_.cjs';
|
|
2
2
|
import { i as index$2 } from './index-BU0xla6v.cjs';
|
|
3
|
-
import { i as index$3 } from './index-
|
|
3
|
+
import { i as index$3 } from './index-DaryquSt.cjs';
|
|
4
4
|
|
|
5
5
|
declare namespace index {
|
|
6
6
|
export { index$1 as array, index$2 as object, index$3 as string };
|
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkJZQA6OH4cjs = require('./chunk-JZQA6OH4.cjs');
|
|
4
|
+
require('./chunk-3ERQHPTD.cjs');
|
|
4
5
|
|
|
5
6
|
|
|
6
7
|
var _chunkVCQOLLVKcjs = require('./chunk-VCQOLLVK.cjs');
|
|
@@ -12,9 +13,9 @@ require('./chunk-NESVPZNF.cjs');
|
|
|
12
13
|
require('./chunk-77SI5VSS.cjs');
|
|
13
14
|
require('./chunk-RFUD3TOQ.cjs');
|
|
14
15
|
require('./chunk-3DD7YCN2.cjs');
|
|
16
|
+
require('./chunk-HMAAC5QA.cjs');
|
|
15
17
|
require('./chunk-6A6EAFGL.cjs');
|
|
16
18
|
require('./chunk-CP2ZSRMU.cjs');
|
|
17
|
-
require('./chunk-3ERQHPTD.cjs');
|
|
18
19
|
|
|
19
20
|
|
|
20
21
|
var _chunkV6PYRA4Acjs = require('./chunk-V6PYRA4A.cjs');
|
|
@@ -79,32 +80,33 @@ var _chunkFVQTU3A7cjs = require('./chunk-FVQTU3A7.cjs');
|
|
|
79
80
|
require('./chunk-QDQ6QSZM.cjs');
|
|
80
81
|
|
|
81
82
|
|
|
82
|
-
var
|
|
83
|
-
require('./chunk-
|
|
83
|
+
var _chunkCS3E5UZ2cjs = require('./chunk-CS3E5UZ2.cjs');
|
|
84
|
+
require('./chunk-5J5H4CQI.cjs');
|
|
85
|
+
require('./chunk-JHV27P2Q.cjs');
|
|
84
86
|
require('./chunk-ETMYYVQJ.cjs');
|
|
87
|
+
require('./chunk-XG44HG5N.cjs');
|
|
88
|
+
require('./chunk-3GVTDRAE.cjs');
|
|
85
89
|
require('./chunk-J7S3KBHL.cjs');
|
|
86
90
|
require('./chunk-L7FSHU27.cjs');
|
|
87
|
-
require('./chunk-JHV27P2Q.cjs');
|
|
88
91
|
require('./chunk-QXK4IUBI.cjs');
|
|
89
|
-
require('./chunk-3GVTDRAE.cjs');
|
|
90
92
|
require('./chunk-XWCRGY54.cjs');
|
|
91
|
-
require('./chunk-
|
|
93
|
+
require('./chunk-UKUXUB64.cjs');
|
|
94
|
+
require('./chunk-SLXKYTEU.cjs');
|
|
92
95
|
require('./chunk-IIKQHLKT.cjs');
|
|
93
96
|
require('./chunk-3VYRYSWK.cjs');
|
|
97
|
+
require('./chunk-D3SX7OUV.cjs');
|
|
94
98
|
require('./chunk-7AIT4XSD.cjs');
|
|
95
99
|
require('./chunk-GOUC2DFA.cjs');
|
|
96
100
|
require('./chunk-NRJPCN4J.cjs');
|
|
97
101
|
require('./chunk-E4WBX6J5.cjs');
|
|
98
|
-
require('./chunk-
|
|
99
|
-
require('./chunk-
|
|
102
|
+
require('./chunk-4K5L3QJW.cjs');
|
|
103
|
+
require('./chunk-GD3OA7GU.cjs');
|
|
100
104
|
require('./chunk-MHHMXDHD.cjs');
|
|
101
105
|
require('./chunk-SOAKYJIG.cjs');
|
|
102
106
|
require('./chunk-UFYLVZNU.cjs');
|
|
103
107
|
require('./chunk-CDQONLGU.cjs');
|
|
104
|
-
require('./chunk-D3SX7OUV.cjs');
|
|
105
108
|
require('./chunk-TCMJPIRM.cjs');
|
|
106
109
|
require('./chunk-XSQOJWXL.cjs');
|
|
107
|
-
require('./chunk-GD3OA7GU.cjs');
|
|
108
110
|
require('./chunk-2H3KVSFA.cjs');
|
|
109
111
|
require('./chunk-ILJLXJ5O.cjs');
|
|
110
112
|
require('./chunk-OJBZ7UUC.cjs');
|
|
@@ -138,4 +140,4 @@ require('./chunk-75ZPJI57.cjs');
|
|
|
138
140
|
|
|
139
141
|
|
|
140
142
|
|
|
141
|
-
exports.basic =
|
|
143
|
+
exports.basic = _chunkCS3E5UZ2cjs.basic_exports; exports.css = _chunkXDTLZL44cjs.css_exports; exports.date = _chunkFVQTU3A7cjs.date_exports; exports.dom = _chunkKNTGZRPDcjs.dom_exports; exports.html = _chunkQN6KZWKMcjs.html_exports; exports.iss = _chunkIJDVZOVJcjs.iss_exports; exports.judge = _chunkUHKL2RG3cjs.judge_exports; exports.load = _chunkXXS5G6S6cjs.load_exports; exports.log = _chunkHUKQYAV6cjs.log_exports; exports.name = _chunkBG2YS767cjs.name_exports; exports.node = _chunkV6PYRA4Acjs.node_exports; exports.tree = _chunkPV2N6PF2cjs.tree_exports; exports.urls = _chunkJZQA6OH4cjs.urls_exports; exports.window = _chunkVCQOLLVKcjs.window_exports;
|