@opentiny/tiny-robot 0.4.1 → 0.4.2-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +47 -62
- package/dist/index5.js +62 -62
- package/dist/index6.js +61 -61
- package/dist/sender/index.js +782 -783
- package/dist/style.css +1 -1
- package/package.json +6 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AllowedComponentProps } from 'vue';
|
|
2
2
|
import { App } from 'vue';
|
|
3
|
+
import { Attrs } from 'vue';
|
|
3
4
|
import { Component } from 'vue';
|
|
4
5
|
import { ComponentCustomProperties } from 'vue';
|
|
5
6
|
import { ComponentCustomProps } from 'vue';
|
|
@@ -116,9 +117,7 @@ readonly show?: boolean | undefined;
|
|
|
116
117
|
readonly transitionProps?: TransitionProps | undefined;
|
|
117
118
|
readonly triggerEvents?: Partial<Record<`on${Capitalize<string>}`, (...args: any[]) => void>> | undefined;
|
|
118
119
|
} & VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
119
|
-
$attrs:
|
|
120
|
-
[x: string]: unknown;
|
|
121
|
-
};
|
|
120
|
+
$attrs: Attrs;
|
|
122
121
|
$refs: {
|
|
123
122
|
[x: string]: unknown;
|
|
124
123
|
};
|
|
@@ -180,11 +179,11 @@ preventOverflow?: boolean;
|
|
|
180
179
|
show?: boolean;
|
|
181
180
|
transitionProps?: TransitionProps;
|
|
182
181
|
triggerEvents?: Partial<Record<`on${Capitalize<string>}`, (...args: any[]) => void>>;
|
|
183
|
-
}> & Readonly<{}>, "placement" | "popperRef" | "update" | "triggerRef"> &
|
|
184
|
-
triggerRef:
|
|
185
|
-
popperRef:
|
|
182
|
+
}> & Readonly<{}>, "placement" | "popperRef" | "update" | "triggerRef"> & {
|
|
183
|
+
triggerRef: HTMLElement | SVGElement | null | undefined;
|
|
184
|
+
popperRef: HTMLDivElement | null;
|
|
186
185
|
update: () => void;
|
|
187
|
-
}
|
|
186
|
+
} & {} & ComponentCustomProperties & {} & {
|
|
188
187
|
$slots: Readonly<{
|
|
189
188
|
trigger?: () => VNode[];
|
|
190
189
|
content?: () => VNode[];
|
|
@@ -378,9 +377,7 @@ readonly show?: boolean | undefined;
|
|
|
378
377
|
readonly transitionProps?: TransitionProps | undefined;
|
|
379
378
|
readonly triggerEvents?: Partial<Record<`on${Capitalize<string>}`, (...args: any[]) => void>> | undefined;
|
|
380
379
|
} & VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
381
|
-
$attrs:
|
|
382
|
-
[x: string]: unknown;
|
|
383
|
-
};
|
|
380
|
+
$attrs: Attrs;
|
|
384
381
|
$refs: {
|
|
385
382
|
[x: string]: unknown;
|
|
386
383
|
};
|
|
@@ -442,11 +439,11 @@ preventOverflow?: boolean;
|
|
|
442
439
|
show?: boolean;
|
|
443
440
|
transitionProps?: TransitionProps;
|
|
444
441
|
triggerEvents?: Partial<Record<`on${Capitalize<string>}`, (...args: any[]) => void>>;
|
|
445
|
-
}> & Readonly<{}>, "placement" | "popperRef" | "update" | "triggerRef"> &
|
|
446
|
-
triggerRef:
|
|
447
|
-
popperRef:
|
|
442
|
+
}> & Readonly<{}>, "placement" | "popperRef" | "update" | "triggerRef"> & {
|
|
443
|
+
triggerRef: HTMLElement | SVGElement | null | undefined;
|
|
444
|
+
popperRef: HTMLDivElement | null;
|
|
448
445
|
update: () => void;
|
|
449
|
-
}
|
|
446
|
+
} & {} & ComponentCustomProperties & {} & {
|
|
450
447
|
$slots: Readonly<{
|
|
451
448
|
trigger?: () => VNode[];
|
|
452
449
|
content?: () => VNode[];
|
|
@@ -537,9 +534,7 @@ readonly onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
|
537
534
|
readonly onSubmit?: ((textContent: string, structuredData?: StructuredData | undefined) => any) | undefined;
|
|
538
535
|
readonly "onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
539
536
|
} & VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
540
|
-
$attrs:
|
|
541
|
-
[x: string]: unknown;
|
|
542
|
-
};
|
|
537
|
+
$attrs: Attrs;
|
|
543
538
|
$refs: {
|
|
544
539
|
[x: string]: unknown;
|
|
545
540
|
};
|
|
@@ -620,7 +615,7 @@ onCancel?: (() => any) | undefined;
|
|
|
620
615
|
onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
621
616
|
onSubmit?: ((textContent: string, structuredData?: StructuredData | undefined) => any) | undefined;
|
|
622
617
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
623
|
-
}>, "clear" | "blur" | "cancel" | "focus" | "submit" | "editor" | "setContent" | ("size" | "placeholder" | "mode" | "enterkeyhint" | "autoSize" | "extensions" | "submitType") | "getContent"> &
|
|
618
|
+
}>, "clear" | "blur" | "cancel" | "focus" | "submit" | "editor" | "setContent" | ("size" | "placeholder" | "mode" | "enterkeyhint" | "autoSize" | "extensions" | "submitType") | "getContent"> & {
|
|
624
619
|
submit: () => void;
|
|
625
620
|
clear: () => void;
|
|
626
621
|
cancel: () => void;
|
|
@@ -628,8 +623,8 @@ focus: () => void;
|
|
|
628
623
|
blur: () => void;
|
|
629
624
|
setContent: (content: string) => void;
|
|
630
625
|
getContent: () => string;
|
|
631
|
-
editor:
|
|
632
|
-
}
|
|
626
|
+
editor: Editor | undefined;
|
|
627
|
+
} & {} & ComponentCustomProperties & {} & {
|
|
633
628
|
$slots: {
|
|
634
629
|
header?(_: {}): any;
|
|
635
630
|
header?(_: {}): any;
|
|
@@ -665,9 +660,7 @@ readonly "onSpeech-final"?: ((transcript: string) => any) | undefined;
|
|
|
665
660
|
readonly "onSpeech-end"?: ((transcript?: string | undefined) => any) | undefined;
|
|
666
661
|
readonly "onSpeech-error"?: ((error: Error) => any) | undefined;
|
|
667
662
|
} & VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
668
|
-
$attrs:
|
|
669
|
-
[x: string]: unknown;
|
|
670
|
-
};
|
|
663
|
+
$attrs: Attrs;
|
|
671
664
|
$refs: {
|
|
672
665
|
[x: string]: unknown;
|
|
673
666
|
};
|
|
@@ -727,11 +720,11 @@ autoInsert: boolean;
|
|
|
727
720
|
"onSpeech-final"?: ((transcript: string) => any) | undefined;
|
|
728
721
|
"onSpeech-end"?: ((transcript?: string | undefined) => any) | undefined;
|
|
729
722
|
"onSpeech-error"?: ((error: Error) => any) | undefined;
|
|
730
|
-
}>, "stop" | "start" | "speechState" | ("tooltipPlacement" | "autoInsert")> &
|
|
723
|
+
}>, "stop" | "start" | "speechState" | ("tooltipPlacement" | "autoInsert")> & {
|
|
731
724
|
start: () => void;
|
|
732
725
|
stop: () => void;
|
|
733
726
|
speechState: SpeechState;
|
|
734
|
-
}
|
|
727
|
+
} & {} & ComponentCustomProperties & {} & {
|
|
735
728
|
$slots: {
|
|
736
729
|
icon?(_: {
|
|
737
730
|
isRecording: boolean;
|
|
@@ -829,9 +822,7 @@ declare function __VLS_template_11(): {
|
|
|
829
822
|
readonly transitionProps?: TransitionProps | undefined;
|
|
830
823
|
readonly triggerEvents?: Partial<Record<`on${Capitalize<string>}`, (...args: any[]) => void>> | undefined;
|
|
831
824
|
} & VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
832
|
-
$attrs:
|
|
833
|
-
[x: string]: unknown;
|
|
834
|
-
};
|
|
825
|
+
$attrs: Attrs;
|
|
835
826
|
$refs: {
|
|
836
827
|
[x: string]: unknown;
|
|
837
828
|
};
|
|
@@ -893,11 +884,11 @@ declare function __VLS_template_11(): {
|
|
|
893
884
|
show?: boolean;
|
|
894
885
|
transitionProps?: TransitionProps;
|
|
895
886
|
triggerEvents?: Partial<Record<`on${Capitalize<string>}`, (...args: any[]) => void>>;
|
|
896
|
-
}> & Readonly<{}>, "placement" | "popperRef" | "update" | "triggerRef"> &
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
}
|
|
887
|
+
}> & Readonly<{}>, "placement" | "popperRef" | "update" | "triggerRef"> & {
|
|
888
|
+
triggerRef: HTMLElement | SVGElement | null | undefined;
|
|
889
|
+
popperRef: HTMLDivElement | null;
|
|
890
|
+
update: () => void;
|
|
891
|
+
} & {} & ComponentCustomProperties & {} & {
|
|
901
892
|
$slots: Readonly<{
|
|
902
893
|
trigger?: () => VNode[];
|
|
903
894
|
content?: () => VNode[];
|
|
@@ -1036,9 +1027,7 @@ declare function __VLS_template_6(): {
|
|
|
1036
1027
|
readonly transitionProps?: TransitionProps | undefined;
|
|
1037
1028
|
readonly triggerEvents?: Partial<Record<`on${Capitalize<string>}`, (...args: any[]) => void>> | undefined;
|
|
1038
1029
|
} & VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
1039
|
-
$attrs:
|
|
1040
|
-
[x: string]: unknown;
|
|
1041
|
-
};
|
|
1030
|
+
$attrs: Attrs;
|
|
1042
1031
|
$refs: {
|
|
1043
1032
|
[x: string]: unknown;
|
|
1044
1033
|
};
|
|
@@ -1100,11 +1089,11 @@ declare function __VLS_template_6(): {
|
|
|
1100
1089
|
show?: boolean;
|
|
1101
1090
|
transitionProps?: TransitionProps;
|
|
1102
1091
|
triggerEvents?: Partial<Record<`on${Capitalize<string>}`, (...args: any[]) => void>>;
|
|
1103
|
-
}> & Readonly<{}>, "placement" | "popperRef" | "update" | "triggerRef"> &
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
}
|
|
1092
|
+
}> & Readonly<{}>, "placement" | "popperRef" | "update" | "triggerRef"> & {
|
|
1093
|
+
triggerRef: HTMLElement | SVGElement | null | undefined;
|
|
1094
|
+
popperRef: HTMLDivElement | null;
|
|
1095
|
+
update: () => void;
|
|
1096
|
+
} & {} & ComponentCustomProperties & {} & {
|
|
1108
1097
|
$slots: Readonly<{
|
|
1109
1098
|
trigger?: () => VNode[];
|
|
1110
1099
|
content?: () => VNode[];
|
|
@@ -1167,9 +1156,7 @@ declare function __VLS_template_8(): {
|
|
|
1167
1156
|
readonly onSubmit?: ((textContent: string, structuredData?: StructuredData | undefined) => any) | undefined;
|
|
1168
1157
|
readonly "onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
1169
1158
|
} & VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
1170
|
-
$attrs:
|
|
1171
|
-
[x: string]: unknown;
|
|
1172
|
-
};
|
|
1159
|
+
$attrs: Attrs;
|
|
1173
1160
|
$refs: {
|
|
1174
1161
|
[x: string]: unknown;
|
|
1175
1162
|
};
|
|
@@ -1250,16 +1237,16 @@ declare function __VLS_template_8(): {
|
|
|
1250
1237
|
onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
1251
1238
|
onSubmit?: ((textContent: string, structuredData?: StructuredData | undefined) => any) | undefined;
|
|
1252
1239
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
1253
|
-
}>, "clear" | "blur" | "cancel" | "focus" | "submit" | "editor" | "setContent" | ("size" | "placeholder" | "mode" | "enterkeyhint" | "autoSize" | "extensions" | "submitType") | "getContent"> &
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
}
|
|
1240
|
+
}>, "clear" | "blur" | "cancel" | "focus" | "submit" | "editor" | "setContent" | ("size" | "placeholder" | "mode" | "enterkeyhint" | "autoSize" | "extensions" | "submitType") | "getContent"> & {
|
|
1241
|
+
submit: () => void;
|
|
1242
|
+
clear: () => void;
|
|
1243
|
+
cancel: () => void;
|
|
1244
|
+
focus: () => void;
|
|
1245
|
+
blur: () => void;
|
|
1246
|
+
setContent: (content: string) => void;
|
|
1247
|
+
getContent: () => string;
|
|
1248
|
+
editor: Editor | undefined;
|
|
1249
|
+
} & {} & ComponentCustomProperties & {} & {
|
|
1263
1250
|
$slots: {
|
|
1264
1251
|
header?(_: {}): any;
|
|
1265
1252
|
header?(_: {}): any;
|
|
@@ -1295,9 +1282,7 @@ declare function __VLS_template_8(): {
|
|
|
1295
1282
|
readonly "onSpeech-end"?: ((transcript?: string | undefined) => any) | undefined;
|
|
1296
1283
|
readonly "onSpeech-error"?: ((error: Error) => any) | undefined;
|
|
1297
1284
|
} & VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
1298
|
-
$attrs:
|
|
1299
|
-
[x: string]: unknown;
|
|
1300
|
-
};
|
|
1285
|
+
$attrs: Attrs;
|
|
1301
1286
|
$refs: {
|
|
1302
1287
|
[x: string]: unknown;
|
|
1303
1288
|
};
|
|
@@ -1357,11 +1342,11 @@ declare function __VLS_template_8(): {
|
|
|
1357
1342
|
"onSpeech-final"?: ((transcript: string) => any) | undefined;
|
|
1358
1343
|
"onSpeech-end"?: ((transcript?: string | undefined) => any) | undefined;
|
|
1359
1344
|
"onSpeech-error"?: ((error: Error) => any) | undefined;
|
|
1360
|
-
}>, "stop" | "start" | "speechState" | ("tooltipPlacement" | "autoInsert")> &
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
}
|
|
1345
|
+
}>, "stop" | "start" | "speechState" | ("tooltipPlacement" | "autoInsert")> & {
|
|
1346
|
+
start: () => void;
|
|
1347
|
+
stop: () => void;
|
|
1348
|
+
speechState: SpeechState;
|
|
1349
|
+
} & {} & ComponentCustomProperties & {} & {
|
|
1365
1350
|
$slots: {
|
|
1366
1351
|
icon?(_: {
|
|
1367
1352
|
isRecording: boolean;
|
package/dist/index5.js
CHANGED
|
@@ -3,53 +3,53 @@ class w extends Error {
|
|
|
3
3
|
super(`${e} at position ${r}`), this.position = r;
|
|
4
4
|
}
|
|
5
5
|
}
|
|
6
|
-
const q = 32, ae = 10,
|
|
7
|
-
function
|
|
6
|
+
const q = 32, ae = 10, P = 9, H = 13, de = 160, pe = 6158, he = 8192, ge = 8203, we = 8239, me = 8287, Ce = 12288, be = 65279;
|
|
7
|
+
function Se(n) {
|
|
8
8
|
return /^[0-9A-Fa-f]$/.test(n);
|
|
9
9
|
}
|
|
10
10
|
function d(n) {
|
|
11
11
|
return n >= "0" && n <= "9";
|
|
12
12
|
}
|
|
13
|
-
function
|
|
13
|
+
function Ne(n) {
|
|
14
14
|
return n >= " ";
|
|
15
15
|
}
|
|
16
16
|
function O(n) {
|
|
17
17
|
return `,:[]/{}()
|
|
18
18
|
+`.includes(n);
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function K(n) {
|
|
21
21
|
return n >= "a" && n <= "z" || n >= "A" && n <= "Z" || n === "_" || n === "$";
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function L(n) {
|
|
24
24
|
return n >= "a" && n <= "z" || n >= "A" && n <= "Z" || n === "_" || n === "$" || n >= "0" && n <= "9";
|
|
25
25
|
}
|
|
26
|
-
const M = /^(http|https|ftp|mailto|file|data|irc):\/\/$/,
|
|
27
|
-
function
|
|
26
|
+
const M = /^(http|https|ftp|mailto|file|data|irc):\/\/$/, F = /^[A-Za-z0-9-._~:/?#@!$&'()*+;=]$/;
|
|
27
|
+
function R(n) {
|
|
28
28
|
return `,[]/{}
|
|
29
29
|
+`.includes(n);
|
|
30
30
|
}
|
|
31
31
|
function _(n) {
|
|
32
|
-
return E(n) ||
|
|
32
|
+
return E(n) || ke.test(n);
|
|
33
33
|
}
|
|
34
|
-
const
|
|
35
|
-
function
|
|
34
|
+
const ke = /^[[{\w-]$/;
|
|
35
|
+
function $e(n) {
|
|
36
36
|
return n === `
|
|
37
37
|
` || n === "\r" || n === " " || n === "\b" || n === "\f";
|
|
38
38
|
}
|
|
39
39
|
function p(n, e) {
|
|
40
40
|
const r = n.charCodeAt(e);
|
|
41
|
-
return r === q || r === ae || r ===
|
|
41
|
+
return r === q || r === ae || r === P || r === H;
|
|
42
42
|
}
|
|
43
|
-
function
|
|
43
|
+
function Ae(n, e) {
|
|
44
44
|
const r = n.charCodeAt(e);
|
|
45
|
-
return r === q || r ===
|
|
45
|
+
return r === q || r === P || r === H;
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function Oe(n, e) {
|
|
48
48
|
const r = n.charCodeAt(e);
|
|
49
|
-
return r === de || r
|
|
49
|
+
return r === de || r === pe || r >= he && r <= ge || r === we || r === me || r === Ce || r === be;
|
|
50
50
|
}
|
|
51
51
|
function E(n) {
|
|
52
|
-
return G(n) ||
|
|
52
|
+
return G(n) || B(n);
|
|
53
53
|
}
|
|
54
54
|
function G(n) {
|
|
55
55
|
return n === '"' || n === "“" || n === "”";
|
|
@@ -57,7 +57,7 @@ function G(n) {
|
|
|
57
57
|
function z(n) {
|
|
58
58
|
return n === '"';
|
|
59
59
|
}
|
|
60
|
-
function
|
|
60
|
+
function B(n) {
|
|
61
61
|
return n === "'" || n === "‘" || n === "’" || n === "`" || n === "´";
|
|
62
62
|
}
|
|
63
63
|
function T(n) {
|
|
@@ -76,19 +76,19 @@ function l(n, e) {
|
|
|
76
76
|
r--;
|
|
77
77
|
return n.substring(0, r) + e + n.substring(r);
|
|
78
78
|
}
|
|
79
|
-
function
|
|
79
|
+
function Ee(n, e, r) {
|
|
80
80
|
return n.substring(0, e) + n.substring(e + r);
|
|
81
81
|
}
|
|
82
|
-
function
|
|
82
|
+
function ye(n) {
|
|
83
83
|
return /[,\n][ \t\r]*$/.test(n);
|
|
84
84
|
}
|
|
85
|
-
const
|
|
85
|
+
const We = {
|
|
86
86
|
"\b": "\\b",
|
|
87
87
|
"\f": "\\f",
|
|
88
88
|
"\n": "\\n",
|
|
89
89
|
"\r": "\\r",
|
|
90
90
|
" ": "\\t"
|
|
91
|
-
},
|
|
91
|
+
}, ve = {
|
|
92
92
|
'"': '"',
|
|
93
93
|
"\\": "\\",
|
|
94
94
|
"/": "/",
|
|
@@ -100,11 +100,11 @@ const Ee = {
|
|
|
100
100
|
t: " "
|
|
101
101
|
// note that \u is handled separately in parseString()
|
|
102
102
|
};
|
|
103
|
-
function
|
|
103
|
+
function Be(n) {
|
|
104
104
|
let e = 0, r = "";
|
|
105
|
-
|
|
105
|
+
I(["```", "[```", "{```"]), m() || ce(), I(["```", "```]", "```}"]);
|
|
106
106
|
const y = C(",");
|
|
107
|
-
for (y && t(), _(n[e]) &&
|
|
107
|
+
for (y && t(), _(n[e]) && ye(r) ? (y || (r = l(r, ",")), re()) : y && (r = S(r, ",")); n[e] === "}" || n[e] === "]"; )
|
|
108
108
|
e++, t();
|
|
109
109
|
if (e >= n.length)
|
|
110
110
|
return r;
|
|
@@ -117,19 +117,19 @@ function We(n) {
|
|
|
117
117
|
function t() {
|
|
118
118
|
let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !0;
|
|
119
119
|
const s = e;
|
|
120
|
-
let u =
|
|
120
|
+
let u = W(i);
|
|
121
121
|
do
|
|
122
|
-
u = X(), u && (u =
|
|
122
|
+
u = X(), u && (u = W(i));
|
|
123
123
|
while (u);
|
|
124
124
|
return e > s;
|
|
125
125
|
}
|
|
126
|
-
function
|
|
127
|
-
const s = i ? p :
|
|
126
|
+
function W(i) {
|
|
127
|
+
const s = i ? p : Ae;
|
|
128
128
|
let u = "";
|
|
129
129
|
for (; ; )
|
|
130
130
|
if (s(n, e))
|
|
131
131
|
u += n[e], e++;
|
|
132
|
-
else if (
|
|
132
|
+
else if (Oe(n, e))
|
|
133
133
|
u += " ", e++;
|
|
134
134
|
else
|
|
135
135
|
break;
|
|
@@ -137,7 +137,7 @@ function We(n) {
|
|
|
137
137
|
}
|
|
138
138
|
function X() {
|
|
139
139
|
if (n[e] === "/" && n[e + 1] === "*") {
|
|
140
|
-
for (; e < n.length && !
|
|
140
|
+
for (; e < n.length && !Ve(n, e); )
|
|
141
141
|
e++;
|
|
142
142
|
return e += 2, !0;
|
|
143
143
|
}
|
|
@@ -149,17 +149,17 @@ function We(n) {
|
|
|
149
149
|
}
|
|
150
150
|
return !1;
|
|
151
151
|
}
|
|
152
|
-
function
|
|
152
|
+
function I(i) {
|
|
153
153
|
if (Y(i)) {
|
|
154
|
-
if (
|
|
155
|
-
for (; e < n.length &&
|
|
154
|
+
if (K(n[e]))
|
|
155
|
+
for (; e < n.length && L(n[e]); )
|
|
156
156
|
e++;
|
|
157
157
|
return t(), !0;
|
|
158
158
|
}
|
|
159
159
|
return !1;
|
|
160
160
|
}
|
|
161
161
|
function Y(i) {
|
|
162
|
-
|
|
162
|
+
W(!0);
|
|
163
163
|
for (const s of i) {
|
|
164
164
|
const u = e + s.length;
|
|
165
165
|
if (n.slice(e, u) === s)
|
|
@@ -176,7 +176,7 @@ function We(n) {
|
|
|
176
176
|
function x() {
|
|
177
177
|
return k("\\");
|
|
178
178
|
}
|
|
179
|
-
function
|
|
179
|
+
function Q() {
|
|
180
180
|
return t(), n[e] === "." && n[e + 1] === "." && n[e + 2] === "." ? (e += 3, t(), k(","), !0) : !1;
|
|
181
181
|
}
|
|
182
182
|
function ee() {
|
|
@@ -185,7 +185,7 @@ function We(n) {
|
|
|
185
185
|
let i = !0;
|
|
186
186
|
for (; e < n.length && n[e] !== "}"; ) {
|
|
187
187
|
let s;
|
|
188
|
-
if (i ? (s = !0, i = !1) : (s = C(","), s || (r = l(r, ",")), t()),
|
|
188
|
+
if (i ? (s = !0, i = !1) : (s = C(","), s || (r = l(r, ",")), t()), Q(), !(h() || j(!0))) {
|
|
189
189
|
n[e] === "}" || n[e] === "{" || n[e] === "]" || n[e] === "[" || n[e] === void 0 ? r = S(r, ",") : le();
|
|
190
190
|
break;
|
|
191
191
|
}
|
|
@@ -202,7 +202,7 @@ function We(n) {
|
|
|
202
202
|
r += "[", e++, t(), k(",") && t();
|
|
203
203
|
let i = !0;
|
|
204
204
|
for (; e < n.length && n[e] !== "]"; )
|
|
205
|
-
if (i ? i = !1 : C(",") || (r = l(r, ",")),
|
|
205
|
+
if (i ? i = !1 : C(",") || (r = l(r, ",")), Q(), !m()) {
|
|
206
206
|
r = S(r, ",");
|
|
207
207
|
break;
|
|
208
208
|
}
|
|
@@ -221,7 +221,7 @@ ${r}
|
|
|
221
221
|
function h() {
|
|
222
222
|
let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1, s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : -1, u = n[e] === "\\";
|
|
223
223
|
if (u && (e++, u = !0), E(n[e])) {
|
|
224
|
-
const A = z(n[e]) ? z : T(n[e]) ? T :
|
|
224
|
+
const A = z(n[e]) ? z : T(n[e]) ? T : B(n[e]) ? B : G, a = e, b = r.length;
|
|
225
225
|
let o = '"';
|
|
226
226
|
for (e++; ; ) {
|
|
227
227
|
if (e >= n.length) {
|
|
@@ -231,46 +231,46 @@ ${r}
|
|
|
231
231
|
if (e === s)
|
|
232
232
|
return o = l(o, '"'), r += o, !0;
|
|
233
233
|
if (A(n[e])) {
|
|
234
|
-
const c = e,
|
|
234
|
+
const c = e, V = o.length;
|
|
235
235
|
if (o += '"', e++, r += o, t(!1), i || e >= n.length || O(n[e]) || E(n[e]) || d(n[e]))
|
|
236
|
-
return
|
|
237
|
-
const f = D(c - 1),
|
|
238
|
-
if (
|
|
236
|
+
return U(), !0;
|
|
237
|
+
const f = D(c - 1), Z = n.charAt(f);
|
|
238
|
+
if (Z === ",")
|
|
239
239
|
return e = a, r = r.substring(0, b), h(!1, f);
|
|
240
|
-
if (O(
|
|
240
|
+
if (O(Z))
|
|
241
241
|
return e = a, r = r.substring(0, b), h(!0);
|
|
242
|
-
r = r.substring(0, b), e = c + 1, o = `${o.substring(0,
|
|
243
|
-
} else if (i &&
|
|
242
|
+
r = r.substring(0, b), e = c + 1, o = `${o.substring(0, V)}\\${o.substring(V)}`;
|
|
243
|
+
} else if (i && R(n[e])) {
|
|
244
244
|
if (n[e - 1] === ":" && M.test(n.substring(a + 1, e + 2)))
|
|
245
|
-
for (; e < n.length &&
|
|
245
|
+
for (; e < n.length && F.test(n[e]); )
|
|
246
246
|
o += n[e], e++;
|
|
247
|
-
return o = l(o, '"'), r += o,
|
|
247
|
+
return o = l(o, '"'), r += o, U(), !0;
|
|
248
248
|
} else if (n[e] === "\\") {
|
|
249
249
|
const c = n.charAt(e + 1);
|
|
250
|
-
if (
|
|
250
|
+
if (ve[c] !== void 0)
|
|
251
251
|
o += n.slice(e, e + 2), e += 2;
|
|
252
252
|
else if (c === "u") {
|
|
253
253
|
let f = 2;
|
|
254
|
-
for (; f < 6 &&
|
|
254
|
+
for (; f < 6 && Se(n[e + f]); )
|
|
255
255
|
f++;
|
|
256
256
|
f === 6 ? (o += n.slice(e, e + 6), e += 6) : e + f >= n.length ? e = n.length : fe();
|
|
257
257
|
} else
|
|
258
258
|
o += c, e += 2;
|
|
259
259
|
} else {
|
|
260
260
|
const c = n.charAt(e);
|
|
261
|
-
c === '"' && n[e - 1] !== "\\" ? (o += `\\${c}`, e++) :
|
|
261
|
+
c === '"' && n[e - 1] !== "\\" ? (o += `\\${c}`, e++) : $e(c) ? (o += We[c], e++) : (Ne(c) || oe(c), o += c, e++);
|
|
262
262
|
}
|
|
263
263
|
u && x();
|
|
264
264
|
}
|
|
265
265
|
}
|
|
266
266
|
return !1;
|
|
267
267
|
}
|
|
268
|
-
function
|
|
268
|
+
function U() {
|
|
269
269
|
let i = !1;
|
|
270
270
|
for (t(); n[e] === "+"; ) {
|
|
271
271
|
i = !0, e++, t(), r = S(r, '"', !0);
|
|
272
272
|
const s = r.length;
|
|
273
|
-
h() ? r =
|
|
273
|
+
h() ? r = Ee(r, s, 1) : r = l(r, '"');
|
|
274
274
|
}
|
|
275
275
|
return i;
|
|
276
276
|
}
|
|
@@ -278,7 +278,7 @@ ${r}
|
|
|
278
278
|
const i = e;
|
|
279
279
|
if (n[e] === "-") {
|
|
280
280
|
if (e++, $())
|
|
281
|
-
return
|
|
281
|
+
return v(i), !0;
|
|
282
282
|
if (!d(n[e]))
|
|
283
283
|
return e = i, !1;
|
|
284
284
|
}
|
|
@@ -286,7 +286,7 @@ ${r}
|
|
|
286
286
|
e++;
|
|
287
287
|
if (n[e] === ".") {
|
|
288
288
|
if (e++, $())
|
|
289
|
-
return
|
|
289
|
+
return v(i), !0;
|
|
290
290
|
if (!d(n[e]))
|
|
291
291
|
return e = i, !1;
|
|
292
292
|
for (; d(n[e]); )
|
|
@@ -294,7 +294,7 @@ ${r}
|
|
|
294
294
|
}
|
|
295
295
|
if (n[e] === "e" || n[e] === "E") {
|
|
296
296
|
if (e++, (n[e] === "-" || n[e] === "+") && e++, $())
|
|
297
|
-
return
|
|
297
|
+
return v(i), !0;
|
|
298
298
|
if (!d(n[e]))
|
|
299
299
|
return e = i, !1;
|
|
300
300
|
for (; d(n[e]); )
|
|
@@ -317,8 +317,8 @@ ${r}
|
|
|
317
317
|
}
|
|
318
318
|
function j(i) {
|
|
319
319
|
const s = e;
|
|
320
|
-
if (
|
|
321
|
-
for (; e < n.length &&
|
|
320
|
+
if (K(n[e])) {
|
|
321
|
+
for (; e < n.length && L(n[e]); )
|
|
322
322
|
e++;
|
|
323
323
|
let u = e;
|
|
324
324
|
for (; p(n, u); )
|
|
@@ -326,10 +326,10 @@ ${r}
|
|
|
326
326
|
if (n[u] === "(")
|
|
327
327
|
return e = u + 1, m(), n[e] === ")" && (e++, n[e] === ";" && e++), !0;
|
|
328
328
|
}
|
|
329
|
-
for (; e < n.length && !
|
|
329
|
+
for (; e < n.length && !R(n[e]) && !E(n[e]) && (!i || n[e] !== ":"); )
|
|
330
330
|
e++;
|
|
331
331
|
if (n[e - 1] === ":" && M.test(n.substring(s, e + 2)))
|
|
332
|
-
for (; e < n.length &&
|
|
332
|
+
for (; e < n.length && F.test(n[e]); )
|
|
333
333
|
e++;
|
|
334
334
|
if (e > s) {
|
|
335
335
|
for (; p(n, e - 1) && e > 0; )
|
|
@@ -355,7 +355,7 @@ ${r}
|
|
|
355
355
|
function $() {
|
|
356
356
|
return e >= n.length || O(n[e]) || p(n, e);
|
|
357
357
|
}
|
|
358
|
-
function
|
|
358
|
+
function v(i) {
|
|
359
359
|
r += `${n.slice(i, e)}0`;
|
|
360
360
|
}
|
|
361
361
|
function oe(i) {
|
|
@@ -378,10 +378,10 @@ ${r}
|
|
|
378
378
|
throw new w(`Invalid unicode character "${i}"`, e);
|
|
379
379
|
}
|
|
380
380
|
}
|
|
381
|
-
function
|
|
381
|
+
function Ve(n, e) {
|
|
382
382
|
return n[e] === "*" && n[e + 1] === "/";
|
|
383
383
|
}
|
|
384
384
|
export {
|
|
385
385
|
w as JSONRepairError,
|
|
386
|
-
|
|
386
|
+
Be as jsonrepair
|
|
387
387
|
};
|