typia 6.6.2 → 6.6.3-dev.20240801
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/lib/index.mjs +3493 -23
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -1
- package/lib/TypeGuardError.mjs +0 -26
- package/lib/TypeGuardError.mjs.map +0 -1
- package/lib/_external/node_modules_drange_lib/index.mjs +0 -180
- package/lib/_external/node_modules_drange_lib/index.mjs.map +0 -1
- package/lib/_external/node_modules_randexp_lib/randexp.mjs +0 -270
- package/lib/_external/node_modules_randexp_lib/randexp.mjs.map +0 -1
- package/lib/_external/node_modules_ret_lib/index.mjs +0 -296
- package/lib/_external/node_modules_ret_lib/index.mjs.map +0 -1
- package/lib/_external/node_modules_ret_lib/positions.mjs +0 -11
- package/lib/_external/node_modules_ret_lib/positions.mjs.map +0 -1
- package/lib/_external/node_modules_ret_lib/sets.mjs +0 -55
- package/lib/_external/node_modules_ret_lib/sets.mjs.map +0 -1
- package/lib/_external/node_modules_ret_lib/types.mjs +0 -13
- package/lib/_external/node_modules_ret_lib/types.mjs.map +0 -1
- package/lib/_external/node_modules_ret_lib/util.mjs +0 -116
- package/lib/_external/node_modules_ret_lib/util.mjs.map +0 -1
- package/lib/_virtual/_commonjsHelpers.mjs +0 -6
- package/lib/_virtual/_commonjsHelpers.mjs.map +0 -1
- package/lib/_virtual/index.mjs +0 -4
- package/lib/_virtual/index.mjs.map +0 -1
- package/lib/_virtual/positions.mjs +0 -4
- package/lib/_virtual/positions.mjs.map +0 -1
- package/lib/_virtual/sets.mjs +0 -4
- package/lib/_virtual/sets.mjs.map +0 -1
- package/lib/_virtual/util.mjs +0 -4
- package/lib/_virtual/util.mjs.map +0 -1
- package/lib/functional/Namespace/functional.mjs +0 -8
- package/lib/functional/Namespace/functional.mjs.map +0 -1
- package/lib/functional/Namespace/http.mjs +0 -12
- package/lib/functional/Namespace/http.mjs.map +0 -1
- package/lib/functional/Namespace/index.mjs +0 -54
- package/lib/functional/Namespace/index.mjs.map +0 -1
- package/lib/functional/Namespace/json.mjs +0 -18
- package/lib/functional/Namespace/json.mjs.map +0 -1
- package/lib/functional/Namespace/misc.mjs +0 -16
- package/lib/functional/Namespace/misc.mjs.map +0 -1
- package/lib/functional/Namespace/notations.mjs +0 -24
- package/lib/functional/Namespace/notations.mjs.map +0 -1
- package/lib/functional/Namespace/protobuf.mjs +0 -22
- package/lib/functional/Namespace/protobuf.mjs.map +0 -1
- package/lib/functional/_FormDataReader/_FormDataReader.mjs +0 -64
- package/lib/functional/_FormDataReader/_FormDataReader.mjs.map +0 -1
- package/lib/functional/_HeadersReader/_HeadersReader.mjs +0 -25
- package/lib/functional/_HeadersReader/_HeadersReader.mjs.map +0 -1
- package/lib/functional/_ParameterReader/_ParameterReader.mjs +0 -25
- package/lib/functional/_ParameterReader/_ParameterReader.mjs.map +0 -1
- package/lib/functional/_ProtobufReader.mjs +0 -176
- package/lib/functional/_ProtobufReader.mjs.map +0 -1
- package/lib/functional/_ProtobufSizer.mjs +0 -131
- package/lib/functional/_ProtobufSizer.mjs.map +0 -1
- package/lib/functional/_ProtobufWriter.mjs +0 -122
- package/lib/functional/_ProtobufWriter.mjs.map +0 -1
- package/lib/functional/_QueryReader/_QueryReader.mjs +0 -38
- package/lib/functional/_QueryReader/_QueryReader.mjs.map +0 -1
- package/lib/functional/_any.mjs +0 -6
- package/lib/functional/_any.mjs.map +0 -1
- package/lib/functional/_clone.mjs +0 -62
- package/lib/functional/_clone.mjs.map +0 -1
- package/lib/functional/_convention.mjs +0 -37
- package/lib/functional/_convention.mjs.map +0 -1
- package/lib/functional/_every.mjs +0 -10
- package/lib/functional/_every.mjs.map +0 -1
- package/lib/functional/_guard.mjs +0 -18
- package/lib/functional/_guard.mjs.map +0 -1
- package/lib/functional/_is_between.mjs +0 -4
- package/lib/functional/_is_between.mjs.map +0 -1
- package/lib/functional/_join.mjs +0 -44
- package/lib/functional/_join.mjs.map +0 -1
- package/lib/functional/_number.mjs +0 -15
- package/lib/functional/_number.mjs.map +0 -1
- package/lib/functional/_report.mjs +0 -16
- package/lib/functional/_report.mjs.map +0 -1
- package/lib/functional/_rest.mjs +0 -6
- package/lib/functional/_rest.mjs.map +0 -1
- package/lib/functional/_stoll.mjs +0 -12
- package/lib/functional/_stoll.mjs.map +0 -1
- package/lib/functional/_string.mjs +0 -41
- package/lib/functional/_string.mjs.map +0 -1
- package/lib/functional/_strlen.mjs +0 -11
- package/lib/functional/_strlen.mjs.map +0 -1
- package/lib/functional/_tail.mjs +0 -7
- package/lib/functional/_tail.mjs.map +0 -1
- package/lib/functional/_throws.mjs +0 -11
- package/lib/functional/_throws.mjs.map +0 -1
- package/lib/functional/is.mjs +0 -13
- package/lib/functional/is.mjs.map +0 -1
- package/lib/functional.mjs +0 -150
- package/lib/functional.mjs.map +0 -1
- package/lib/http.mjs +0 -239
- package/lib/http.mjs.map +0 -1
- package/lib/json.mjs +0 -126
- package/lib/json.mjs.map +0 -1
- package/lib/misc.mjs +0 -154
- package/lib/misc.mjs.map +0 -1
- package/lib/module.mjs +0 -161
- package/lib/module.mjs.map +0 -1
- package/lib/notations.mjs +0 -222
- package/lib/notations.mjs.map +0 -1
- package/lib/protobuf.mjs +0 -157
- package/lib/protobuf.mjs.map +0 -1
- package/lib/reflect.mjs +0 -19
- package/lib/reflect.mjs.map +0 -1
- package/lib/tags/index.mjs +0 -2
- package/lib/tags/index.mjs.map +0 -1
- package/lib/utils/NamingConvention/NamingConvention.mjs +0 -84
- package/lib/utils/NamingConvention/NamingConvention.mjs.map +0 -1
- package/lib/utils/RandomGenerator/RandomGenerator.mjs +0 -104
- package/lib/utils/RandomGenerator/RandomGenerator.mjs.map +0 -1
- package/lib/utils/Singleton.mjs +0 -17
- package/lib/utils/Singleton.mjs.map +0 -1
- package/lib/utils/StringUtil/StringUtil.mjs +0 -4
- package/lib/utils/StringUtil/StringUtil.mjs.map +0 -1
package/lib/index.mjs
CHANGED
|
@@ -1,24 +1,3494 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
1
|
+
function getDefaultExportFromCjs (x) {
|
|
2
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
var lib$1 = {exports: {}};
|
|
6
|
+
|
|
7
|
+
var util$1 = {};
|
|
8
|
+
|
|
9
|
+
var types$4 = {
|
|
10
|
+
ROOT : 0,
|
|
11
|
+
GROUP : 1,
|
|
12
|
+
POSITION : 2,
|
|
13
|
+
SET : 3,
|
|
14
|
+
RANGE : 4,
|
|
15
|
+
REPETITION : 5,
|
|
16
|
+
REFERENCE : 6,
|
|
17
|
+
CHAR : 7,
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
var sets$1 = {};
|
|
21
|
+
|
|
22
|
+
const types$3 = types$4;
|
|
23
|
+
|
|
24
|
+
const INTS = () => [{ type: types$3.RANGE , from: 48, to: 57 }];
|
|
25
|
+
|
|
26
|
+
const WORDS = () => {
|
|
27
|
+
return [
|
|
28
|
+
{ type: types$3.CHAR, value: 95 },
|
|
29
|
+
{ type: types$3.RANGE, from: 97, to: 122 },
|
|
30
|
+
{ type: types$3.RANGE, from: 65, to: 90 }
|
|
31
|
+
].concat(INTS());
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const WHITESPACE = () => {
|
|
35
|
+
return [
|
|
36
|
+
{ type: types$3.CHAR, value: 9 },
|
|
37
|
+
{ type: types$3.CHAR, value: 10 },
|
|
38
|
+
{ type: types$3.CHAR, value: 11 },
|
|
39
|
+
{ type: types$3.CHAR, value: 12 },
|
|
40
|
+
{ type: types$3.CHAR, value: 13 },
|
|
41
|
+
{ type: types$3.CHAR, value: 32 },
|
|
42
|
+
{ type: types$3.CHAR, value: 160 },
|
|
43
|
+
{ type: types$3.CHAR, value: 5760 },
|
|
44
|
+
{ type: types$3.RANGE, from: 8192, to: 8202 },
|
|
45
|
+
{ type: types$3.CHAR, value: 8232 },
|
|
46
|
+
{ type: types$3.CHAR, value: 8233 },
|
|
47
|
+
{ type: types$3.CHAR, value: 8239 },
|
|
48
|
+
{ type: types$3.CHAR, value: 8287 },
|
|
49
|
+
{ type: types$3.CHAR, value: 12288 },
|
|
50
|
+
{ type: types$3.CHAR, value: 65279 }
|
|
51
|
+
];
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const NOTANYCHAR = () => {
|
|
55
|
+
return [
|
|
56
|
+
{ type: types$3.CHAR, value: 10 },
|
|
57
|
+
{ type: types$3.CHAR, value: 13 },
|
|
58
|
+
{ type: types$3.CHAR, value: 8232 },
|
|
59
|
+
{ type: types$3.CHAR, value: 8233 },
|
|
60
|
+
];
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
// Predefined class objects.
|
|
64
|
+
sets$1.words = () => ({ type: types$3.SET, set: WORDS(), not: false });
|
|
65
|
+
sets$1.notWords = () => ({ type: types$3.SET, set: WORDS(), not: true });
|
|
66
|
+
sets$1.ints = () => ({ type: types$3.SET, set: INTS(), not: false });
|
|
67
|
+
sets$1.notInts = () => ({ type: types$3.SET, set: INTS(), not: true });
|
|
68
|
+
sets$1.whitespace = () => ({ type: types$3.SET, set: WHITESPACE(), not: false });
|
|
69
|
+
sets$1.notWhitespace = () => ({ type: types$3.SET, set: WHITESPACE(), not: true });
|
|
70
|
+
sets$1.anyChar = () => ({ type: types$3.SET, set: NOTANYCHAR(), not: true });
|
|
71
|
+
|
|
72
|
+
(function (exports) {
|
|
73
|
+
const types = types$4;
|
|
74
|
+
const sets = sets$1;
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
const CTRL = '@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^ ?';
|
|
78
|
+
const SLSH = { '0': 0, 't': 9, 'n': 10, 'v': 11, 'f': 12, 'r': 13 };
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Finds character representations in str and convert all to
|
|
82
|
+
* their respective characters
|
|
83
|
+
*
|
|
84
|
+
* @param {String} str
|
|
85
|
+
* @return {String}
|
|
86
|
+
*/
|
|
87
|
+
exports.strToChars = function(str) {
|
|
88
|
+
/* jshint maxlen: false */
|
|
89
|
+
var chars_regex = /(\[\\b\])|(\\)?\\(?:u([A-F0-9]{4})|x([A-F0-9]{2})|(0?[0-7]{2})|c([@A-Z[\\\]^?])|([0tnvfr]))/g;
|
|
90
|
+
str = str.replace(chars_regex, function(s, b, lbs, a16, b16, c8, dctrl, eslsh) {
|
|
91
|
+
if (lbs) {
|
|
92
|
+
return s;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
var code = b ? 8 :
|
|
96
|
+
a16 ? parseInt(a16, 16) :
|
|
97
|
+
b16 ? parseInt(b16, 16) :
|
|
98
|
+
c8 ? parseInt(c8, 8) :
|
|
99
|
+
dctrl ? CTRL.indexOf(dctrl) :
|
|
100
|
+
SLSH[eslsh];
|
|
101
|
+
|
|
102
|
+
var c = String.fromCharCode(code);
|
|
103
|
+
|
|
104
|
+
// Escape special regex characters.
|
|
105
|
+
if (/[[\]{}^$.|?*+()]/.test(c)) {
|
|
106
|
+
c = '\\' + c;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
return c;
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
return str;
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* turns class into tokens
|
|
118
|
+
* reads str until it encounters a ] not preceeded by a \
|
|
119
|
+
*
|
|
120
|
+
* @param {String} str
|
|
121
|
+
* @param {String} regexpStr
|
|
122
|
+
* @return {Array.<Array.<Object>, Number>}
|
|
123
|
+
*/
|
|
124
|
+
exports.tokenizeClass = (str, regexpStr) => {
|
|
125
|
+
/* jshint maxlen: false */
|
|
126
|
+
var tokens = [];
|
|
127
|
+
var regexp = /\\(?:(w)|(d)|(s)|(W)|(D)|(S))|((?:(?:\\)(.)|([^\]\\]))-(?:\\)?([^\]]))|(\])|(?:\\)?([^])/g;
|
|
128
|
+
var rs, c;
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
while ((rs = regexp.exec(str)) != null) {
|
|
132
|
+
if (rs[1]) {
|
|
133
|
+
tokens.push(sets.words());
|
|
134
|
+
|
|
135
|
+
} else if (rs[2]) {
|
|
136
|
+
tokens.push(sets.ints());
|
|
137
|
+
|
|
138
|
+
} else if (rs[3]) {
|
|
139
|
+
tokens.push(sets.whitespace());
|
|
140
|
+
|
|
141
|
+
} else if (rs[4]) {
|
|
142
|
+
tokens.push(sets.notWords());
|
|
143
|
+
|
|
144
|
+
} else if (rs[5]) {
|
|
145
|
+
tokens.push(sets.notInts());
|
|
146
|
+
|
|
147
|
+
} else if (rs[6]) {
|
|
148
|
+
tokens.push(sets.notWhitespace());
|
|
149
|
+
|
|
150
|
+
} else if (rs[7]) {
|
|
151
|
+
tokens.push({
|
|
152
|
+
type: types.RANGE,
|
|
153
|
+
from: (rs[8] || rs[9]).charCodeAt(0),
|
|
154
|
+
to: rs[10].charCodeAt(0),
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
} else if ((c = rs[12])) {
|
|
158
|
+
tokens.push({
|
|
159
|
+
type: types.CHAR,
|
|
160
|
+
value: c.charCodeAt(0),
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
} else {
|
|
164
|
+
return [tokens, regexp.lastIndex];
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
exports.error(regexpStr, 'Unterminated character class');
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Shortcut to throw errors.
|
|
174
|
+
*
|
|
175
|
+
* @param {String} regexp
|
|
176
|
+
* @param {String} msg
|
|
177
|
+
*/
|
|
178
|
+
exports.error = (regexp, msg) => {
|
|
179
|
+
throw new SyntaxError('Invalid regular expression: /' + regexp + '/: ' + msg);
|
|
180
|
+
};
|
|
181
|
+
} (util$1));
|
|
182
|
+
|
|
183
|
+
var positions$1 = {};
|
|
184
|
+
|
|
185
|
+
const types$2 = types$4;
|
|
186
|
+
positions$1.wordBoundary = () => ({ type: types$2.POSITION, value: 'b' });
|
|
187
|
+
positions$1.nonWordBoundary = () => ({ type: types$2.POSITION, value: 'B' });
|
|
188
|
+
positions$1.begin = () => ({ type: types$2.POSITION, value: '^' });
|
|
189
|
+
positions$1.end = () => ({ type: types$2.POSITION, value: '$' });
|
|
190
|
+
|
|
191
|
+
const util = util$1;
|
|
192
|
+
const types$1 = types$4;
|
|
193
|
+
const sets = sets$1;
|
|
194
|
+
const positions = positions$1;
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
lib$1.exports = (regexpStr) => {
|
|
198
|
+
var i = 0, l, c,
|
|
199
|
+
start = { type: types$1.ROOT, stack: []},
|
|
200
|
+
|
|
201
|
+
// Keep track of last clause/group and stack.
|
|
202
|
+
lastGroup = start,
|
|
203
|
+
last = start.stack,
|
|
204
|
+
groupStack = [];
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
var repeatErr = (i) => {
|
|
208
|
+
util.error(regexpStr, `Nothing to repeat at column ${i - 1}`);
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
// Decode a few escaped characters.
|
|
212
|
+
var str = util.strToChars(regexpStr);
|
|
213
|
+
l = str.length;
|
|
214
|
+
|
|
215
|
+
// Iterate through each character in string.
|
|
216
|
+
while (i < l) {
|
|
217
|
+
c = str[i++];
|
|
218
|
+
|
|
219
|
+
switch (c) {
|
|
220
|
+
// Handle escaped characters, inclues a few sets.
|
|
221
|
+
case '\\':
|
|
222
|
+
c = str[i++];
|
|
223
|
+
|
|
224
|
+
switch (c) {
|
|
225
|
+
case 'b':
|
|
226
|
+
last.push(positions.wordBoundary());
|
|
227
|
+
break;
|
|
228
|
+
|
|
229
|
+
case 'B':
|
|
230
|
+
last.push(positions.nonWordBoundary());
|
|
231
|
+
break;
|
|
232
|
+
|
|
233
|
+
case 'w':
|
|
234
|
+
last.push(sets.words());
|
|
235
|
+
break;
|
|
236
|
+
|
|
237
|
+
case 'W':
|
|
238
|
+
last.push(sets.notWords());
|
|
239
|
+
break;
|
|
240
|
+
|
|
241
|
+
case 'd':
|
|
242
|
+
last.push(sets.ints());
|
|
243
|
+
break;
|
|
244
|
+
|
|
245
|
+
case 'D':
|
|
246
|
+
last.push(sets.notInts());
|
|
247
|
+
break;
|
|
248
|
+
|
|
249
|
+
case 's':
|
|
250
|
+
last.push(sets.whitespace());
|
|
251
|
+
break;
|
|
252
|
+
|
|
253
|
+
case 'S':
|
|
254
|
+
last.push(sets.notWhitespace());
|
|
255
|
+
break;
|
|
256
|
+
|
|
257
|
+
default:
|
|
258
|
+
// Check if c is integer.
|
|
259
|
+
// In which case it's a reference.
|
|
260
|
+
if (/\d/.test(c)) {
|
|
261
|
+
last.push({ type: types$1.REFERENCE, value: parseInt(c, 10) });
|
|
262
|
+
|
|
263
|
+
// Escaped character.
|
|
264
|
+
} else {
|
|
265
|
+
last.push({ type: types$1.CHAR, value: c.charCodeAt(0) });
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
break;
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
// Positionals.
|
|
273
|
+
case '^':
|
|
274
|
+
last.push(positions.begin());
|
|
275
|
+
break;
|
|
276
|
+
|
|
277
|
+
case '$':
|
|
278
|
+
last.push(positions.end());
|
|
279
|
+
break;
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
// Handle custom sets.
|
|
283
|
+
case '[':
|
|
284
|
+
// Check if this class is 'anti' i.e. [^abc].
|
|
285
|
+
var not;
|
|
286
|
+
if (str[i] === '^') {
|
|
287
|
+
not = true;
|
|
288
|
+
i++;
|
|
289
|
+
} else {
|
|
290
|
+
not = false;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
// Get all the characters in class.
|
|
294
|
+
var classTokens = util.tokenizeClass(str.slice(i), regexpStr);
|
|
295
|
+
|
|
296
|
+
// Increase index by length of class.
|
|
297
|
+
i += classTokens[1];
|
|
298
|
+
last.push({
|
|
299
|
+
type: types$1.SET,
|
|
300
|
+
set: classTokens[0],
|
|
301
|
+
not,
|
|
302
|
+
});
|
|
303
|
+
|
|
304
|
+
break;
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
// Class of any character except \n.
|
|
308
|
+
case '.':
|
|
309
|
+
last.push(sets.anyChar());
|
|
310
|
+
break;
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
// Push group onto stack.
|
|
314
|
+
case '(':
|
|
315
|
+
// Create group.
|
|
316
|
+
var group = {
|
|
317
|
+
type: types$1.GROUP,
|
|
318
|
+
stack: [],
|
|
319
|
+
remember: true,
|
|
320
|
+
};
|
|
321
|
+
|
|
322
|
+
c = str[i];
|
|
323
|
+
|
|
324
|
+
// If if this is a special kind of group.
|
|
325
|
+
if (c === '?') {
|
|
326
|
+
c = str[i + 1];
|
|
327
|
+
i += 2;
|
|
328
|
+
|
|
329
|
+
// Match if followed by.
|
|
330
|
+
if (c === '=') {
|
|
331
|
+
group.followedBy = true;
|
|
332
|
+
|
|
333
|
+
// Match if not followed by.
|
|
334
|
+
} else if (c === '!') {
|
|
335
|
+
group.notFollowedBy = true;
|
|
336
|
+
|
|
337
|
+
} else if (c !== ':') {
|
|
338
|
+
util.error(regexpStr,
|
|
339
|
+
`Invalid group, character '${c}'` +
|
|
340
|
+
` after '?' at column ${i - 1}`);
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
group.remember = false;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
// Insert subgroup into current group stack.
|
|
347
|
+
last.push(group);
|
|
348
|
+
|
|
349
|
+
// Remember the current group for when the group closes.
|
|
350
|
+
groupStack.push(lastGroup);
|
|
351
|
+
|
|
352
|
+
// Make this new group the current group.
|
|
353
|
+
lastGroup = group;
|
|
354
|
+
last = group.stack;
|
|
355
|
+
break;
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
// Pop group out of stack.
|
|
359
|
+
case ')':
|
|
360
|
+
if (groupStack.length === 0) {
|
|
361
|
+
util.error(regexpStr, `Unmatched ) at column ${i - 1}`);
|
|
362
|
+
}
|
|
363
|
+
lastGroup = groupStack.pop();
|
|
364
|
+
|
|
365
|
+
// Check if this group has a PIPE.
|
|
366
|
+
// To get back the correct last stack.
|
|
367
|
+
last = lastGroup.options ?
|
|
368
|
+
lastGroup.options[lastGroup.options.length - 1] : lastGroup.stack;
|
|
369
|
+
break;
|
|
370
|
+
|
|
371
|
+
|
|
372
|
+
// Use pipe character to give more choices.
|
|
373
|
+
case '|':
|
|
374
|
+
// Create array where options are if this is the first PIPE
|
|
375
|
+
// in this clause.
|
|
376
|
+
if (!lastGroup.options) {
|
|
377
|
+
lastGroup.options = [lastGroup.stack];
|
|
378
|
+
delete lastGroup.stack;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
// Create a new stack and add to options for rest of clause.
|
|
382
|
+
var stack = [];
|
|
383
|
+
lastGroup.options.push(stack);
|
|
384
|
+
last = stack;
|
|
385
|
+
break;
|
|
386
|
+
|
|
387
|
+
|
|
388
|
+
// Repetition.
|
|
389
|
+
// For every repetition, remove last element from last stack
|
|
390
|
+
// then insert back a RANGE object.
|
|
391
|
+
// This design is chosen because there could be more than
|
|
392
|
+
// one repetition symbols in a regex i.e. `a?+{2,3}`.
|
|
393
|
+
case '{':
|
|
394
|
+
var rs = /^(\d+)(,(\d+)?)?\}/.exec(str.slice(i)), min, max;
|
|
395
|
+
if (rs !== null) {
|
|
396
|
+
if (last.length === 0) {
|
|
397
|
+
repeatErr(i);
|
|
398
|
+
}
|
|
399
|
+
min = parseInt(rs[1], 10);
|
|
400
|
+
max = rs[2] ? rs[3] ? parseInt(rs[3], 10) : Infinity : min;
|
|
401
|
+
i += rs[0].length;
|
|
402
|
+
|
|
403
|
+
last.push({
|
|
404
|
+
type: types$1.REPETITION,
|
|
405
|
+
min,
|
|
406
|
+
max,
|
|
407
|
+
value: last.pop(),
|
|
408
|
+
});
|
|
409
|
+
} else {
|
|
410
|
+
last.push({
|
|
411
|
+
type: types$1.CHAR,
|
|
412
|
+
value: 123,
|
|
413
|
+
});
|
|
414
|
+
}
|
|
415
|
+
break;
|
|
416
|
+
|
|
417
|
+
case '?':
|
|
418
|
+
if (last.length === 0) {
|
|
419
|
+
repeatErr(i);
|
|
420
|
+
}
|
|
421
|
+
last.push({
|
|
422
|
+
type: types$1.REPETITION,
|
|
423
|
+
min: 0,
|
|
424
|
+
max: 1,
|
|
425
|
+
value: last.pop(),
|
|
426
|
+
});
|
|
427
|
+
break;
|
|
428
|
+
|
|
429
|
+
case '+':
|
|
430
|
+
if (last.length === 0) {
|
|
431
|
+
repeatErr(i);
|
|
432
|
+
}
|
|
433
|
+
last.push({
|
|
434
|
+
type: types$1.REPETITION,
|
|
435
|
+
min: 1,
|
|
436
|
+
max: Infinity,
|
|
437
|
+
value: last.pop(),
|
|
438
|
+
});
|
|
439
|
+
break;
|
|
440
|
+
|
|
441
|
+
case '*':
|
|
442
|
+
if (last.length === 0) {
|
|
443
|
+
repeatErr(i);
|
|
444
|
+
}
|
|
445
|
+
last.push({
|
|
446
|
+
type: types$1.REPETITION,
|
|
447
|
+
min: 0,
|
|
448
|
+
max: Infinity,
|
|
449
|
+
value: last.pop(),
|
|
450
|
+
});
|
|
451
|
+
break;
|
|
452
|
+
|
|
453
|
+
|
|
454
|
+
// Default is a character that is not `\[](){}?+*^$`.
|
|
455
|
+
default:
|
|
456
|
+
last.push({
|
|
457
|
+
type: types$1.CHAR,
|
|
458
|
+
value: c.charCodeAt(0),
|
|
459
|
+
});
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
// Check if any groups have not been closed.
|
|
465
|
+
if (groupStack.length !== 0) {
|
|
466
|
+
util.error(regexpStr, 'Unterminated group');
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
return start;
|
|
470
|
+
};
|
|
471
|
+
|
|
472
|
+
lib$1.exports.types = types$1;
|
|
473
|
+
|
|
474
|
+
var libExports = lib$1.exports;
|
|
475
|
+
|
|
476
|
+
/* eslint indent: 4 */
|
|
477
|
+
|
|
478
|
+
|
|
479
|
+
// Private helper class
|
|
480
|
+
class SubRange {
|
|
481
|
+
constructor(low, high) {
|
|
482
|
+
this.low = low;
|
|
483
|
+
this.high = high;
|
|
484
|
+
this.length = 1 + high - low;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
overlaps(range) {
|
|
488
|
+
return !(this.high < range.low || this.low > range.high);
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
touches(range) {
|
|
492
|
+
return !(this.high + 1 < range.low || this.low - 1 > range.high);
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
// Returns inclusive combination of SubRanges as a SubRange.
|
|
496
|
+
add(range) {
|
|
497
|
+
return new SubRange(
|
|
498
|
+
Math.min(this.low, range.low),
|
|
499
|
+
Math.max(this.high, range.high)
|
|
500
|
+
);
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
// Returns subtraction of SubRanges as an array of SubRanges.
|
|
504
|
+
// (There's a case where subtraction divides it in 2)
|
|
505
|
+
subtract(range) {
|
|
506
|
+
if (range.low <= this.low && range.high >= this.high) {
|
|
507
|
+
return [];
|
|
508
|
+
} else if (range.low > this.low && range.high < this.high) {
|
|
509
|
+
return [
|
|
510
|
+
new SubRange(this.low, range.low - 1),
|
|
511
|
+
new SubRange(range.high + 1, this.high)
|
|
512
|
+
];
|
|
513
|
+
} else if (range.low <= this.low) {
|
|
514
|
+
return [new SubRange(range.high + 1, this.high)];
|
|
515
|
+
} else {
|
|
516
|
+
return [new SubRange(this.low, range.low - 1)];
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
toString() {
|
|
521
|
+
return this.low == this.high ?
|
|
522
|
+
this.low.toString() : this.low + '-' + this.high;
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
|
|
527
|
+
let DRange$1 = class DRange {
|
|
528
|
+
constructor(a, b) {
|
|
529
|
+
this.ranges = [];
|
|
530
|
+
this.length = 0;
|
|
531
|
+
if (a != null) this.add(a, b);
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
_update_length() {
|
|
535
|
+
this.length = this.ranges.reduce((previous, range) => {
|
|
536
|
+
return previous + range.length;
|
|
537
|
+
}, 0);
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
add(a, b) {
|
|
541
|
+
var _add = (subrange) => {
|
|
542
|
+
var i = 0;
|
|
543
|
+
while (i < this.ranges.length && !subrange.touches(this.ranges[i])) {
|
|
544
|
+
i++;
|
|
545
|
+
}
|
|
546
|
+
var newRanges = this.ranges.slice(0, i);
|
|
547
|
+
while (i < this.ranges.length && subrange.touches(this.ranges[i])) {
|
|
548
|
+
subrange = subrange.add(this.ranges[i]);
|
|
549
|
+
i++;
|
|
550
|
+
}
|
|
551
|
+
newRanges.push(subrange);
|
|
552
|
+
this.ranges = newRanges.concat(this.ranges.slice(i));
|
|
553
|
+
this._update_length();
|
|
554
|
+
};
|
|
555
|
+
|
|
556
|
+
if (a instanceof DRange) {
|
|
557
|
+
a.ranges.forEach(_add);
|
|
558
|
+
} else {
|
|
559
|
+
if (b == null) b = a;
|
|
560
|
+
_add(new SubRange(a, b));
|
|
561
|
+
}
|
|
562
|
+
return this;
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
subtract(a, b) {
|
|
566
|
+
var _subtract = (subrange) => {
|
|
567
|
+
var i = 0;
|
|
568
|
+
while (i < this.ranges.length && !subrange.overlaps(this.ranges[i])) {
|
|
569
|
+
i++;
|
|
570
|
+
}
|
|
571
|
+
var newRanges = this.ranges.slice(0, i);
|
|
572
|
+
while (i < this.ranges.length && subrange.overlaps(this.ranges[i])) {
|
|
573
|
+
newRanges = newRanges.concat(this.ranges[i].subtract(subrange));
|
|
574
|
+
i++;
|
|
575
|
+
}
|
|
576
|
+
this.ranges = newRanges.concat(this.ranges.slice(i));
|
|
577
|
+
this._update_length();
|
|
578
|
+
};
|
|
579
|
+
|
|
580
|
+
if (a instanceof DRange) {
|
|
581
|
+
a.ranges.forEach(_subtract);
|
|
582
|
+
} else {
|
|
583
|
+
if (b == null) b = a;
|
|
584
|
+
_subtract(new SubRange(a, b));
|
|
585
|
+
}
|
|
586
|
+
return this;
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
intersect(a, b) {
|
|
590
|
+
var newRanges = [];
|
|
591
|
+
var _intersect = (subrange) => {
|
|
592
|
+
var i = 0;
|
|
593
|
+
while (i < this.ranges.length && !subrange.overlaps(this.ranges[i])) {
|
|
594
|
+
i++;
|
|
595
|
+
}
|
|
596
|
+
while (i < this.ranges.length && subrange.overlaps(this.ranges[i])) {
|
|
597
|
+
var low = Math.max(this.ranges[i].low, subrange.low);
|
|
598
|
+
var high = Math.min(this.ranges[i].high, subrange.high);
|
|
599
|
+
newRanges.push(new SubRange(low, high));
|
|
600
|
+
i++;
|
|
601
|
+
}
|
|
602
|
+
};
|
|
603
|
+
|
|
604
|
+
if (a instanceof DRange) {
|
|
605
|
+
a.ranges.forEach(_intersect);
|
|
606
|
+
} else {
|
|
607
|
+
if (b == null) b = a;
|
|
608
|
+
_intersect(new SubRange(a, b));
|
|
609
|
+
}
|
|
610
|
+
this.ranges = newRanges;
|
|
611
|
+
this._update_length();
|
|
612
|
+
return this;
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
index(index) {
|
|
616
|
+
var i = 0;
|
|
617
|
+
while (i < this.ranges.length && this.ranges[i].length <= index) {
|
|
618
|
+
index -= this.ranges[i].length;
|
|
619
|
+
i++;
|
|
620
|
+
}
|
|
621
|
+
return this.ranges[i].low + index;
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
toString() {
|
|
625
|
+
return '[ ' + this.ranges.join(', ') + ' ]';
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
clone() {
|
|
629
|
+
return new DRange(this);
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
numbers() {
|
|
633
|
+
return this.ranges.reduce((result, subrange) => {
|
|
634
|
+
var i = subrange.low;
|
|
635
|
+
while (i <= subrange.high) {
|
|
636
|
+
result.push(i);
|
|
637
|
+
i++;
|
|
638
|
+
}
|
|
639
|
+
return result;
|
|
640
|
+
}, []);
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
subranges() {
|
|
644
|
+
return this.ranges.map((subrange) => ({
|
|
645
|
+
low: subrange.low,
|
|
646
|
+
high: subrange.high,
|
|
647
|
+
length: 1 + subrange.high - subrange.low
|
|
648
|
+
}));
|
|
649
|
+
}
|
|
650
|
+
};
|
|
651
|
+
|
|
652
|
+
var lib = DRange$1;
|
|
653
|
+
|
|
654
|
+
const ret = libExports;
|
|
655
|
+
const DRange = lib;
|
|
656
|
+
const types = ret.types;
|
|
657
|
+
|
|
658
|
+
|
|
659
|
+
var randexp = class RandExp {
|
|
660
|
+
/**
|
|
661
|
+
* @constructor
|
|
662
|
+
* @param {RegExp|String} regexp
|
|
663
|
+
* @param {String} m
|
|
664
|
+
*/
|
|
665
|
+
constructor(regexp, m) {
|
|
666
|
+
this._setDefaults(regexp);
|
|
667
|
+
if (regexp instanceof RegExp) {
|
|
668
|
+
this.ignoreCase = regexp.ignoreCase;
|
|
669
|
+
this.multiline = regexp.multiline;
|
|
670
|
+
regexp = regexp.source;
|
|
671
|
+
|
|
672
|
+
} else if (typeof regexp === 'string') {
|
|
673
|
+
this.ignoreCase = m && m.indexOf('i') !== -1;
|
|
674
|
+
this.multiline = m && m.indexOf('m') !== -1;
|
|
675
|
+
} else {
|
|
676
|
+
throw new Error('Expected a regexp or string');
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
this.tokens = ret(regexp);
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
|
|
683
|
+
/**
|
|
684
|
+
* Checks if some custom properties have been set for this regexp.
|
|
685
|
+
*
|
|
686
|
+
* @param {RandExp} randexp
|
|
687
|
+
* @param {RegExp} regexp
|
|
688
|
+
*/
|
|
689
|
+
_setDefaults(regexp) {
|
|
690
|
+
// When a repetitional token has its max set to Infinite,
|
|
691
|
+
// randexp won't actually generate a random amount between min and Infinite
|
|
692
|
+
// instead it will see Infinite as min + 100.
|
|
693
|
+
this.max = regexp.max != null ? regexp.max :
|
|
694
|
+
RandExp.prototype.max != null ? RandExp.prototype.max : 100;
|
|
695
|
+
|
|
696
|
+
// This allows expanding to include additional characters
|
|
697
|
+
// for instance: RandExp.defaultRange.add(0, 65535);
|
|
698
|
+
this.defaultRange = regexp.defaultRange ?
|
|
699
|
+
regexp.defaultRange : this.defaultRange.clone();
|
|
700
|
+
|
|
701
|
+
if (regexp.randInt) {
|
|
702
|
+
this.randInt = regexp.randInt;
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
|
|
707
|
+
/**
|
|
708
|
+
* Generates the random string.
|
|
709
|
+
*
|
|
710
|
+
* @return {String}
|
|
711
|
+
*/
|
|
712
|
+
gen() {
|
|
713
|
+
return this._gen(this.tokens, []);
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
|
|
717
|
+
/**
|
|
718
|
+
* Generate random string modeled after given tokens.
|
|
719
|
+
*
|
|
720
|
+
* @param {Object} token
|
|
721
|
+
* @param {Array.<String>} groups
|
|
722
|
+
* @return {String}
|
|
723
|
+
*/
|
|
724
|
+
_gen(token, groups) {
|
|
725
|
+
var stack, str, n, i, l;
|
|
726
|
+
|
|
727
|
+
switch (token.type) {
|
|
728
|
+
case types.ROOT:
|
|
729
|
+
case types.GROUP:
|
|
730
|
+
// Ignore lookaheads for now.
|
|
731
|
+
if (token.followedBy || token.notFollowedBy) { return ''; }
|
|
732
|
+
|
|
733
|
+
// Insert placeholder until group string is generated.
|
|
734
|
+
if (token.remember && token.groupNumber === undefined) {
|
|
735
|
+
token.groupNumber = groups.push(null) - 1;
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
stack = token.options ?
|
|
739
|
+
this._randSelect(token.options) : token.stack;
|
|
740
|
+
|
|
741
|
+
str = '';
|
|
742
|
+
for (i = 0, l = stack.length; i < l; i++) {
|
|
743
|
+
str += this._gen(stack[i], groups);
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
if (token.remember) {
|
|
747
|
+
groups[token.groupNumber] = str;
|
|
748
|
+
}
|
|
749
|
+
return str;
|
|
750
|
+
|
|
751
|
+
case types.POSITION:
|
|
752
|
+
// Do nothing for now.
|
|
753
|
+
return '';
|
|
754
|
+
|
|
755
|
+
case types.SET:
|
|
756
|
+
var expandedSet = this._expand(token);
|
|
757
|
+
if (!expandedSet.length) { return ''; }
|
|
758
|
+
return String.fromCharCode(this._randSelect(expandedSet));
|
|
759
|
+
|
|
760
|
+
case types.REPETITION:
|
|
761
|
+
// Randomly generate number between min and max.
|
|
762
|
+
n = this.randInt(token.min,
|
|
763
|
+
token.max === Infinity ? token.min + this.max : token.max);
|
|
764
|
+
|
|
765
|
+
str = '';
|
|
766
|
+
for (i = 0; i < n; i++) {
|
|
767
|
+
str += this._gen(token.value, groups);
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
return str;
|
|
771
|
+
|
|
772
|
+
case types.REFERENCE:
|
|
773
|
+
return groups[token.value - 1] || '';
|
|
774
|
+
|
|
775
|
+
case types.CHAR:
|
|
776
|
+
var code = this.ignoreCase && this._randBool() ?
|
|
777
|
+
this._toOtherCase(token.value) : token.value;
|
|
778
|
+
return String.fromCharCode(code);
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
|
|
783
|
+
/**
|
|
784
|
+
* If code is alphabetic, converts to other case.
|
|
785
|
+
* If not alphabetic, returns back code.
|
|
786
|
+
*
|
|
787
|
+
* @param {Number} code
|
|
788
|
+
* @return {Number}
|
|
789
|
+
*/
|
|
790
|
+
_toOtherCase(code) {
|
|
791
|
+
return code + (97 <= code && code <= 122 ? -32 :
|
|
792
|
+
65 <= code && code <= 90 ? 32 : 0);
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
|
|
796
|
+
/**
|
|
797
|
+
* Randomly returns a true or false value.
|
|
798
|
+
*
|
|
799
|
+
* @return {Boolean}
|
|
800
|
+
*/
|
|
801
|
+
_randBool() {
|
|
802
|
+
return !this.randInt(0, 1);
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
|
|
806
|
+
/**
|
|
807
|
+
* Randomly selects and returns a value from the array.
|
|
808
|
+
*
|
|
809
|
+
* @param {Array.<Object>} arr
|
|
810
|
+
* @return {Object}
|
|
811
|
+
*/
|
|
812
|
+
_randSelect(arr) {
|
|
813
|
+
if (arr instanceof DRange) {
|
|
814
|
+
return arr.index(this.randInt(0, arr.length - 1));
|
|
815
|
+
}
|
|
816
|
+
return arr[this.randInt(0, arr.length - 1)];
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
|
|
820
|
+
/**
|
|
821
|
+
* expands a token to a DiscontinuousRange of characters which has a
|
|
822
|
+
* length and an index function (for random selecting)
|
|
823
|
+
*
|
|
824
|
+
* @param {Object} token
|
|
825
|
+
* @return {DiscontinuousRange}
|
|
826
|
+
*/
|
|
827
|
+
_expand(token) {
|
|
828
|
+
if (token.type === ret.types.CHAR) {
|
|
829
|
+
return new DRange(token.value);
|
|
830
|
+
} else if (token.type === ret.types.RANGE) {
|
|
831
|
+
return new DRange(token.from, token.to);
|
|
832
|
+
} else {
|
|
833
|
+
let drange = new DRange();
|
|
834
|
+
for (let i = 0; i < token.set.length; i++) {
|
|
835
|
+
let subrange = this._expand(token.set[i]);
|
|
836
|
+
drange.add(subrange);
|
|
837
|
+
if (this.ignoreCase) {
|
|
838
|
+
for (let j = 0; j < subrange.length; j++) {
|
|
839
|
+
let code = subrange.index(j);
|
|
840
|
+
let otherCaseCode = this._toOtherCase(code);
|
|
841
|
+
if (code !== otherCaseCode) {
|
|
842
|
+
drange.add(otherCaseCode);
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
}
|
|
847
|
+
if (token.not) {
|
|
848
|
+
return this.defaultRange.clone().subtract(drange);
|
|
849
|
+
} else {
|
|
850
|
+
return this.defaultRange.clone().intersect(drange);
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
|
|
856
|
+
/**
|
|
857
|
+
* Randomly generates and returns a number between a and b (inclusive).
|
|
858
|
+
*
|
|
859
|
+
* @param {Number} a
|
|
860
|
+
* @param {Number} b
|
|
861
|
+
* @return {Number}
|
|
862
|
+
*/
|
|
863
|
+
randInt(a, b) {
|
|
864
|
+
return a + Math.floor(Math.random() * (1 + b - a));
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
|
|
868
|
+
/**
|
|
869
|
+
* Default range of characters to generate from.
|
|
870
|
+
*/
|
|
871
|
+
get defaultRange() {
|
|
872
|
+
return this._range = this._range || new DRange(32, 126);
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
set defaultRange(range) {
|
|
876
|
+
this._range = range;
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
|
|
880
|
+
/**
|
|
881
|
+
*
|
|
882
|
+
* Enables use of randexp with a shorter call.
|
|
883
|
+
*
|
|
884
|
+
* @param {RegExp|String| regexp}
|
|
885
|
+
* @param {String} m
|
|
886
|
+
* @return {String}
|
|
887
|
+
*/
|
|
888
|
+
static randexp(regexp, m) {
|
|
889
|
+
var randexp;
|
|
890
|
+
if(typeof regexp === 'string') {
|
|
891
|
+
regexp = new RegExp(regexp, m);
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
if (regexp._randexp === undefined) {
|
|
895
|
+
randexp = new RandExp(regexp, m);
|
|
896
|
+
regexp._randexp = randexp;
|
|
897
|
+
} else {
|
|
898
|
+
randexp = regexp._randexp;
|
|
899
|
+
randexp._setDefaults(regexp);
|
|
900
|
+
}
|
|
901
|
+
return randexp.gen();
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
|
|
905
|
+
/**
|
|
906
|
+
* Enables sugary /regexp/.gen syntax.
|
|
907
|
+
*/
|
|
908
|
+
static sugar() {
|
|
909
|
+
/* eshint freeze:false */
|
|
910
|
+
RegExp.prototype.gen = function() {
|
|
911
|
+
return RandExp.randexp(this);
|
|
912
|
+
};
|
|
913
|
+
}
|
|
914
|
+
};
|
|
915
|
+
|
|
916
|
+
var RandExp = /*@__PURE__*/getDefaultExportFromCjs(randexp);
|
|
917
|
+
|
|
918
|
+
const ALPHABETS = "abcdefghijklmnopqrstuvwxyz";
|
|
919
|
+
/* -----------------------------------------------------------
|
|
920
|
+
REGULAR
|
|
921
|
+
----------------------------------------------------------- */
|
|
922
|
+
const boolean$4 = () => Math.random() < 0.5;
|
|
923
|
+
const integer = (min, max) => {
|
|
924
|
+
min ??= 0;
|
|
925
|
+
max ??= 100;
|
|
926
|
+
return Math.floor(Math.random() * (max - min + 1)) + min;
|
|
927
|
+
};
|
|
928
|
+
const bigint$4 = (min, max) => BigInt(integer(Number(min ?? BigInt(0)), Number(max ?? BigInt(100))));
|
|
929
|
+
const number$4 = (min, max) => {
|
|
930
|
+
min ??= 0;
|
|
931
|
+
max ??= 100;
|
|
932
|
+
return Math.random() * (max - min) + min;
|
|
933
|
+
};
|
|
934
|
+
const string$4 = (length) => new Array(length ?? integer(5, 10))
|
|
935
|
+
.fill(0)
|
|
936
|
+
.map(() => ALPHABETS[integer(0, ALPHABETS.length - 1)])
|
|
937
|
+
.join("");
|
|
938
|
+
const array$2 = (closure, count, unique) => {
|
|
939
|
+
count ??= length();
|
|
940
|
+
unique ??= false;
|
|
941
|
+
if (unique === false)
|
|
942
|
+
return new Array(count ?? length())
|
|
943
|
+
.fill(0)
|
|
944
|
+
.map((_e, index) => closure(index));
|
|
945
|
+
else {
|
|
946
|
+
const set = new Set();
|
|
947
|
+
while (set.size < count)
|
|
948
|
+
set.add(closure(set.size));
|
|
949
|
+
return Array.from(set);
|
|
950
|
+
}
|
|
951
|
+
};
|
|
952
|
+
const pick = (array) => array[integer(0, array.length - 1)];
|
|
953
|
+
const length = () => integer(0, 3);
|
|
954
|
+
const pattern = (regex) => {
|
|
955
|
+
const r = new RandExp(regex);
|
|
956
|
+
for (let i = 0; i < 10; ++i) {
|
|
957
|
+
const str = r.gen();
|
|
958
|
+
if (regex.test(str))
|
|
959
|
+
return str;
|
|
960
|
+
}
|
|
961
|
+
return r.gen();
|
|
962
|
+
};
|
|
963
|
+
/* -----------------------------------------------------------
|
|
964
|
+
SECIAL FORMATS
|
|
965
|
+
----------------------------------------------------------- */
|
|
966
|
+
// SPECIAL CHARACTERS
|
|
967
|
+
const byte = () => "vt7ekz4lIoNTTS9sDQYdWKharxIFAR54+z/umIxSgUM=";
|
|
968
|
+
const password = () => string$4(integer(4, 16));
|
|
969
|
+
const regex = () => "/^(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)\\.){3}(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)$/";
|
|
970
|
+
const uuid = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
|
|
971
|
+
const r = (Math.random() * 16) | 0;
|
|
972
|
+
const v = c === "x" ? r : (r & 0x3) | 0x8;
|
|
973
|
+
return v.toString(16);
|
|
974
|
+
});
|
|
975
|
+
// ADDRESSES
|
|
976
|
+
const email = () => `${string$4(10)}@${string$4(10)}.${string$4(3)}`;
|
|
977
|
+
const hostname = () => `${string$4(10)}.${string$4(3)}`;
|
|
978
|
+
const idnEmail = () => email();
|
|
979
|
+
const idnHostname = () => hostname();
|
|
980
|
+
const iri = () => url();
|
|
981
|
+
const iriReference = () => url();
|
|
982
|
+
const ipv4 = () => array$2(() => integer(0, 255), 4).join(".");
|
|
983
|
+
const ipv6 = () => array$2(() => integer(0, 65535).toString(16), 8).join(":");
|
|
984
|
+
const uri = () => url();
|
|
985
|
+
const uriReference = () => url();
|
|
986
|
+
const uriTemplate = () => url();
|
|
987
|
+
const url = () => `https://${string$4(10)}.${string$4(3)}`;
|
|
988
|
+
// TIMESTAMPS
|
|
989
|
+
const datetime = (min, max) => new Date(number$4(min ?? Date.now() - 30 * DAY, max ?? Date.now() + 7 * DAY)).toISOString();
|
|
990
|
+
const date = (min, max) => new Date(number$4(min ?? 0, max ?? Date.now() * 2))
|
|
991
|
+
.toISOString()
|
|
992
|
+
.substring(0, 10);
|
|
993
|
+
const time = () => new Date(number$4(0, DAY)).toISOString().substring(11);
|
|
994
|
+
const duration = () => {
|
|
995
|
+
const period = durate([
|
|
996
|
+
["Y", integer(0, 100)],
|
|
997
|
+
["M", integer(0, 12)],
|
|
998
|
+
["D", integer(0, 31)],
|
|
999
|
+
]);
|
|
1000
|
+
const time = durate([
|
|
1001
|
+
["H", integer(0, 24)],
|
|
1002
|
+
["M", integer(0, 60)],
|
|
1003
|
+
["S", integer(0, 60)],
|
|
1004
|
+
]);
|
|
1005
|
+
if (period.length + time.length === 0)
|
|
1006
|
+
return "PT0S";
|
|
1007
|
+
return `P${period}${time.length ? "T" : ""}${time}`;
|
|
1008
|
+
};
|
|
1009
|
+
// POINTERS
|
|
1010
|
+
const jsonPointer = () => `/components/schemas/${string$4(10)}`;
|
|
1011
|
+
const relativeJsonPointer = () => `${integer(0, 10)}#`;
|
|
1012
|
+
const DAY = 86400000;
|
|
1013
|
+
const durate = (elements) => elements
|
|
1014
|
+
.filter(([_unit, value]) => value !== 0)
|
|
1015
|
+
.map(([unit, value]) => `${value}${unit}`)
|
|
1016
|
+
.join("");
|
|
1017
|
+
|
|
1018
|
+
var RandomGenerator = /*#__PURE__*/Object.freeze({
|
|
1019
|
+
__proto__: null,
|
|
1020
|
+
array: array$2,
|
|
1021
|
+
bigint: bigint$4,
|
|
1022
|
+
boolean: boolean$4,
|
|
1023
|
+
byte: byte,
|
|
1024
|
+
date: date,
|
|
1025
|
+
datetime: datetime,
|
|
1026
|
+
duration: duration,
|
|
1027
|
+
email: email,
|
|
1028
|
+
hostname: hostname,
|
|
1029
|
+
idnEmail: idnEmail,
|
|
1030
|
+
idnHostname: idnHostname,
|
|
1031
|
+
integer: integer,
|
|
1032
|
+
ipv4: ipv4,
|
|
1033
|
+
ipv6: ipv6,
|
|
1034
|
+
iri: iri,
|
|
1035
|
+
iriReference: iriReference,
|
|
1036
|
+
jsonPointer: jsonPointer,
|
|
1037
|
+
length: length,
|
|
1038
|
+
number: number$4,
|
|
1039
|
+
password: password,
|
|
1040
|
+
pattern: pattern,
|
|
1041
|
+
pick: pick,
|
|
1042
|
+
regex: regex,
|
|
1043
|
+
relativeJsonPointer: relativeJsonPointer,
|
|
1044
|
+
string: string$4,
|
|
1045
|
+
time: time,
|
|
1046
|
+
uri: uri,
|
|
1047
|
+
uriReference: uriReference,
|
|
1048
|
+
uriTemplate: uriTemplate,
|
|
1049
|
+
url: url,
|
|
1050
|
+
uuid: uuid
|
|
1051
|
+
});
|
|
1052
|
+
|
|
1053
|
+
const $every = (array, pred) => {
|
|
1054
|
+
let error = null;
|
|
1055
|
+
for (let i = 0; i < array.length; ++i)
|
|
1056
|
+
if (null !== (error = pred(array[i], i)))
|
|
1057
|
+
return error;
|
|
1058
|
+
return null;
|
|
1059
|
+
};
|
|
1060
|
+
|
|
1061
|
+
class TypeGuardError extends Error {
|
|
1062
|
+
method;
|
|
1063
|
+
path;
|
|
1064
|
+
expected;
|
|
1065
|
+
value;
|
|
1066
|
+
fake_expected_typed_value_;
|
|
1067
|
+
constructor(props) {
|
|
1068
|
+
// MESSAGE CONSTRUCTION
|
|
1069
|
+
super(props.message ||
|
|
1070
|
+
`Error on ${props.method}(): invalid type${props.path ? ` on ${props.path}` : ""}, expect to be ${props.expected}`);
|
|
1071
|
+
// INHERITANCE POLYFILL
|
|
1072
|
+
const proto = new.target.prototype;
|
|
1073
|
+
if (Object.setPrototypeOf)
|
|
1074
|
+
Object.setPrototypeOf(this, proto);
|
|
1075
|
+
else
|
|
1076
|
+
this.__proto__ = proto;
|
|
1077
|
+
// ASSIGN MEMBERS
|
|
1078
|
+
this.method = props.method;
|
|
1079
|
+
this.path = props.path;
|
|
1080
|
+
this.expected = props.expected;
|
|
1081
|
+
this.value = props.value;
|
|
1082
|
+
}
|
|
1083
|
+
}
|
|
1084
|
+
|
|
1085
|
+
/**
|
|
1086
|
+
* @internal
|
|
1087
|
+
*/
|
|
1088
|
+
const $guard = (method) => (exceptionable, props, factory) => {
|
|
1089
|
+
if (exceptionable === true)
|
|
1090
|
+
throw (factory ?? ((props) => new TypeGuardError(props)))({
|
|
1091
|
+
method,
|
|
1092
|
+
path: props.path,
|
|
1093
|
+
expected: props.expected,
|
|
1094
|
+
value: props.value,
|
|
1095
|
+
});
|
|
1096
|
+
return false;
|
|
1097
|
+
};
|
|
1098
|
+
|
|
1099
|
+
const $join = (str) => variable(str) ? `.${str}` : `[${JSON.stringify(str)}]`;
|
|
1100
|
+
const variable = (str) => reserved(str) === false && /^[a-zA-Z_$][a-zA-Z_$0-9]*$/g.test(str);
|
|
1101
|
+
const reserved = (str) => RESERVED.has(str);
|
|
1102
|
+
const RESERVED = new Set([
|
|
1103
|
+
"break",
|
|
1104
|
+
"case",
|
|
1105
|
+
"catch",
|
|
1106
|
+
"class",
|
|
1107
|
+
"const",
|
|
1108
|
+
"continue",
|
|
1109
|
+
"debugger",
|
|
1110
|
+
"default",
|
|
1111
|
+
"delete",
|
|
1112
|
+
"do",
|
|
1113
|
+
"else",
|
|
1114
|
+
"enum",
|
|
1115
|
+
"export",
|
|
1116
|
+
"extends",
|
|
1117
|
+
"false",
|
|
1118
|
+
"finally",
|
|
1119
|
+
"for",
|
|
1120
|
+
"function",
|
|
1121
|
+
"if",
|
|
1122
|
+
"import",
|
|
1123
|
+
"in",
|
|
1124
|
+
"instanceof",
|
|
1125
|
+
"new",
|
|
1126
|
+
"null",
|
|
1127
|
+
"return",
|
|
1128
|
+
"super",
|
|
1129
|
+
"switch",
|
|
1130
|
+
"this",
|
|
1131
|
+
"throw",
|
|
1132
|
+
"true",
|
|
1133
|
+
"try",
|
|
1134
|
+
"typeof",
|
|
1135
|
+
"var",
|
|
1136
|
+
"void",
|
|
1137
|
+
"while",
|
|
1138
|
+
"with",
|
|
1139
|
+
]);
|
|
1140
|
+
|
|
1141
|
+
const $report = (array) => {
|
|
1142
|
+
const reportable = (path) => {
|
|
1143
|
+
if (array.length === 0)
|
|
1144
|
+
return true;
|
|
1145
|
+
const last = array[array.length - 1].path;
|
|
1146
|
+
return path.length > last.length || last.substring(0, path.length) !== path;
|
|
1147
|
+
};
|
|
1148
|
+
return (exceptable, error) => {
|
|
1149
|
+
if (exceptable && reportable(error.path))
|
|
1150
|
+
array.push(error);
|
|
1151
|
+
return false;
|
|
1152
|
+
};
|
|
1153
|
+
};
|
|
1154
|
+
|
|
1155
|
+
const $is_between = (value, minimum, maximum) => minimum <= value && value <= maximum;
|
|
1156
|
+
|
|
1157
|
+
const $is_bigint_string = (str) => {
|
|
1158
|
+
try {
|
|
1159
|
+
BigInt(str);
|
|
1160
|
+
return true;
|
|
1161
|
+
}
|
|
1162
|
+
catch {
|
|
1163
|
+
return false;
|
|
1164
|
+
}
|
|
1165
|
+
};
|
|
1166
|
+
|
|
1167
|
+
/**
|
|
1168
|
+
* @internal
|
|
1169
|
+
*/
|
|
1170
|
+
const is$1 = () => ({
|
|
1171
|
+
is_between: $is_between,
|
|
1172
|
+
is_bigint_string: $is_bigint_string,
|
|
1173
|
+
});
|
|
1174
|
+
|
|
1175
|
+
const functionalAssert = () => ({
|
|
1176
|
+
errorFactory: (p) => new TypeGuardError(p),
|
|
1177
|
+
});
|
|
1178
|
+
|
|
1179
|
+
const $number = (value) => {
|
|
1180
|
+
if (isFinite(value) === false)
|
|
1181
|
+
throw new TypeGuardError({
|
|
1182
|
+
method: "typia.json.stringify",
|
|
1183
|
+
expected: "number",
|
|
1184
|
+
value,
|
|
1185
|
+
message: "Error on typia.json.stringify(): infinite or not a number.",
|
|
1186
|
+
});
|
|
1187
|
+
return value;
|
|
1188
|
+
};
|
|
1189
|
+
|
|
1190
|
+
const $rest = (str) => {
|
|
1191
|
+
return str.length === 2 ? "" : "," + str.substring(1, str.length - 1);
|
|
1192
|
+
};
|
|
1193
|
+
|
|
1194
|
+
/**
|
|
1195
|
+
* In the past, name of `typia` was `typescript-json`, and supported
|
|
1196
|
+
* JSON serialization by wrapping `fast-json-stringify. `typescript-json` was
|
|
1197
|
+
* a helper library of `fast-json-stringify`, which can skip manual JSON schema
|
|
1198
|
+
* definition just by putting pure TypeScript type.
|
|
1199
|
+
*
|
|
1200
|
+
* This `$string` function is a part of `fast-json-stringify` at that time, and
|
|
1201
|
+
* still being used in `typia` for the string serialization.
|
|
1202
|
+
*
|
|
1203
|
+
* @internal
|
|
1204
|
+
* @reference https://github.com/fastify/fast-json-stringify/blob/master/lib/serializer.js
|
|
1205
|
+
* @blog https://dev.to/samchon/good-bye-typescript-is-ancestor-of-typia-20000x-faster-validator-49fi
|
|
1206
|
+
*/
|
|
1207
|
+
const $string = (str) => {
|
|
1208
|
+
const len = str.length;
|
|
1209
|
+
let result = "";
|
|
1210
|
+
let last = -1;
|
|
1211
|
+
let point = 255;
|
|
1212
|
+
// eslint-disable-next-line
|
|
1213
|
+
for (var i = 0; i < len; i++) {
|
|
1214
|
+
point = str.charCodeAt(i);
|
|
1215
|
+
if (point < 32) {
|
|
1216
|
+
return JSON.stringify(str);
|
|
1217
|
+
}
|
|
1218
|
+
if (point >= 0xd800 && point <= 0xdfff) {
|
|
1219
|
+
// The current character is a surrogate.
|
|
1220
|
+
return JSON.stringify(str);
|
|
1221
|
+
}
|
|
1222
|
+
if (point === 0x22 || // '"'
|
|
1223
|
+
point === 0x5c // '\'
|
|
1224
|
+
) {
|
|
1225
|
+
last === -1 && (last = 0);
|
|
1226
|
+
result += str.slice(last, i) + "\\";
|
|
1227
|
+
last = i;
|
|
1228
|
+
}
|
|
1229
|
+
}
|
|
1230
|
+
return ((last === -1 && '"' + str + '"') || '"' + result + str.slice(last) + '"');
|
|
1231
|
+
};
|
|
1232
|
+
|
|
1233
|
+
/**
|
|
1234
|
+
* @internal
|
|
1235
|
+
*/
|
|
1236
|
+
const $tail = (str) => str[str.length - 1] === "," ? str.substring(0, str.length - 1) : str;
|
|
1237
|
+
|
|
1238
|
+
const $throws = (method) => (props) => {
|
|
1239
|
+
throw new TypeGuardError({
|
|
1240
|
+
...props,
|
|
1241
|
+
method: `typia.${method}`,
|
|
1242
|
+
});
|
|
1243
|
+
};
|
|
1244
|
+
|
|
1245
|
+
const stringify$1 = (method) => ({
|
|
1246
|
+
...is$1(),
|
|
1247
|
+
number: $number,
|
|
1248
|
+
string: $string,
|
|
1249
|
+
tail: $tail,
|
|
1250
|
+
rest: $rest,
|
|
1251
|
+
throws: $throws(`json.${method}`),
|
|
1252
|
+
});
|
|
1253
|
+
|
|
1254
|
+
const boolean$3 = (input) => input instanceof File
|
|
1255
|
+
? input
|
|
1256
|
+
: input === null
|
|
1257
|
+
? undefined
|
|
1258
|
+
: input === "null"
|
|
1259
|
+
? null
|
|
1260
|
+
: input.length === 0
|
|
1261
|
+
? true
|
|
1262
|
+
: input === "true" || input === "1"
|
|
1263
|
+
? true
|
|
1264
|
+
: input === "false" || input === "0"
|
|
1265
|
+
? false
|
|
1266
|
+
: input; // wrong type
|
|
1267
|
+
const number$3 = (input) => input instanceof File
|
|
1268
|
+
? input
|
|
1269
|
+
: !!input?.length
|
|
1270
|
+
? input === "null"
|
|
1271
|
+
? null
|
|
1272
|
+
: toNumber$3(input)
|
|
1273
|
+
: undefined;
|
|
1274
|
+
const bigint$3 = (input) => input instanceof File
|
|
1275
|
+
? input
|
|
1276
|
+
: !!input?.length
|
|
1277
|
+
? input === "null"
|
|
1278
|
+
? null
|
|
1279
|
+
: toBigint$3(input)
|
|
1280
|
+
: undefined;
|
|
1281
|
+
const string$3 = (input) => input instanceof File
|
|
1282
|
+
? input
|
|
1283
|
+
: input === null
|
|
1284
|
+
? undefined
|
|
1285
|
+
: input === "null"
|
|
1286
|
+
? null
|
|
1287
|
+
: input;
|
|
1288
|
+
const array$1 = (input, alternative) => input.length ? input : alternative;
|
|
1289
|
+
const blob = (input) => input instanceof Blob
|
|
1290
|
+
? input
|
|
1291
|
+
: input === null
|
|
1292
|
+
? undefined
|
|
1293
|
+
: input === "null"
|
|
1294
|
+
? null
|
|
1295
|
+
: input;
|
|
1296
|
+
const file = (input) => input instanceof File
|
|
1297
|
+
? input
|
|
1298
|
+
: input === null
|
|
1299
|
+
? undefined
|
|
1300
|
+
: input === "null"
|
|
1301
|
+
? null
|
|
1302
|
+
: input;
|
|
1303
|
+
const toNumber$3 = (str) => {
|
|
1304
|
+
const value = Number(str);
|
|
1305
|
+
return isNaN(value) ? str : value;
|
|
1306
|
+
};
|
|
1307
|
+
const toBigint$3 = (str) => {
|
|
1308
|
+
try {
|
|
1309
|
+
return BigInt(str);
|
|
1310
|
+
}
|
|
1311
|
+
catch {
|
|
1312
|
+
return str;
|
|
1313
|
+
}
|
|
1314
|
+
};
|
|
1315
|
+
|
|
1316
|
+
var $FormDataReader = /*#__PURE__*/Object.freeze({
|
|
1317
|
+
__proto__: null,
|
|
1318
|
+
array: array$1,
|
|
1319
|
+
bigint: bigint$3,
|
|
1320
|
+
blob: blob,
|
|
1321
|
+
boolean: boolean$3,
|
|
1322
|
+
file: file,
|
|
1323
|
+
number: number$3,
|
|
1324
|
+
string: string$3
|
|
1325
|
+
});
|
|
1326
|
+
|
|
1327
|
+
const boolean$2 = (value) => value !== undefined
|
|
1328
|
+
? value === "true"
|
|
1329
|
+
? true
|
|
1330
|
+
: value === "false"
|
|
1331
|
+
? false
|
|
1332
|
+
: value
|
|
1333
|
+
: undefined;
|
|
1334
|
+
const bigint$2 = (value) => value !== undefined ? toBigint$2(value) : undefined;
|
|
1335
|
+
const number$2 = (value) => value !== undefined ? toNumber$2(value) : undefined;
|
|
1336
|
+
const string$2 = (value) => value;
|
|
1337
|
+
const toBigint$2 = (str) => {
|
|
1338
|
+
try {
|
|
1339
|
+
return BigInt(str);
|
|
1340
|
+
}
|
|
1341
|
+
catch {
|
|
1342
|
+
return str;
|
|
1343
|
+
}
|
|
1344
|
+
};
|
|
1345
|
+
const toNumber$2 = (str) => {
|
|
1346
|
+
const value = Number(str);
|
|
1347
|
+
return isNaN(value) ? str : value;
|
|
1348
|
+
};
|
|
1349
|
+
|
|
1350
|
+
var $HeadersReader = /*#__PURE__*/Object.freeze({
|
|
1351
|
+
__proto__: null,
|
|
1352
|
+
bigint: bigint$2,
|
|
1353
|
+
boolean: boolean$2,
|
|
1354
|
+
number: number$2,
|
|
1355
|
+
string: string$2
|
|
1356
|
+
});
|
|
1357
|
+
|
|
1358
|
+
const boolean$1 = (value) => value !== "null"
|
|
1359
|
+
? value === "true" || value === "1"
|
|
1360
|
+
? true
|
|
1361
|
+
: value === "false" || value === "0"
|
|
1362
|
+
? false
|
|
1363
|
+
: value
|
|
1364
|
+
: null;
|
|
1365
|
+
const bigint$1 = (value) => value !== "null" ? toBigint$1(value) : null;
|
|
1366
|
+
const number$1 = (value) => value !== "null" ? toNumber$1(value) : null;
|
|
1367
|
+
const string$1 = (value) => (value !== "null" ? value : null);
|
|
1368
|
+
const toNumber$1 = (str) => {
|
|
1369
|
+
const value = Number(str);
|
|
1370
|
+
return isNaN(value) ? str : value;
|
|
1371
|
+
};
|
|
1372
|
+
const toBigint$1 = (str) => {
|
|
1373
|
+
try {
|
|
1374
|
+
return BigInt(str);
|
|
1375
|
+
}
|
|
1376
|
+
catch {
|
|
1377
|
+
return str;
|
|
1378
|
+
}
|
|
1379
|
+
};
|
|
1380
|
+
|
|
1381
|
+
var $ParameterReader = /*#__PURE__*/Object.freeze({
|
|
1382
|
+
__proto__: null,
|
|
1383
|
+
bigint: bigint$1,
|
|
1384
|
+
boolean: boolean$1,
|
|
1385
|
+
number: number$1,
|
|
1386
|
+
string: string$1
|
|
1387
|
+
});
|
|
1388
|
+
|
|
1389
|
+
const boolean = (str) => str === null
|
|
1390
|
+
? undefined
|
|
1391
|
+
: str === "null"
|
|
1392
|
+
? null
|
|
1393
|
+
: str.length === 0
|
|
1394
|
+
? true
|
|
1395
|
+
: str === "true" || str === "1"
|
|
1396
|
+
? true
|
|
1397
|
+
: str === "false" || str === "0"
|
|
1398
|
+
? false
|
|
1399
|
+
: str; // wrong type
|
|
1400
|
+
const number = (str) => !!str?.length ? (str === "null" ? null : toNumber(str)) : undefined;
|
|
1401
|
+
const bigint = (str) => !!str?.length ? (str === "null" ? null : toBigint(str)) : undefined;
|
|
1402
|
+
const string = (str) => str === null ? undefined : str === "null" ? null : str;
|
|
1403
|
+
const params = (input) => {
|
|
1404
|
+
if (typeof input === "string") {
|
|
1405
|
+
const index = input.indexOf("?");
|
|
1406
|
+
input = index === -1 ? "" : input.substring(index + 1);
|
|
1407
|
+
return new URLSearchParams(input);
|
|
1408
|
+
}
|
|
1409
|
+
return input;
|
|
1410
|
+
};
|
|
1411
|
+
const array = (input, alternative) => input.length ? input : alternative;
|
|
1412
|
+
const toNumber = (str) => {
|
|
1413
|
+
const value = Number(str);
|
|
1414
|
+
return isNaN(value) ? str : value;
|
|
1415
|
+
};
|
|
1416
|
+
const toBigint = (str) => {
|
|
1417
|
+
try {
|
|
1418
|
+
return BigInt(str);
|
|
1419
|
+
}
|
|
1420
|
+
catch {
|
|
1421
|
+
return str;
|
|
1422
|
+
}
|
|
1423
|
+
};
|
|
1424
|
+
|
|
1425
|
+
var $QueryReader = /*#__PURE__*/Object.freeze({
|
|
1426
|
+
__proto__: null,
|
|
1427
|
+
array: array,
|
|
1428
|
+
bigint: bigint,
|
|
1429
|
+
boolean: boolean,
|
|
1430
|
+
number: number,
|
|
1431
|
+
params: params,
|
|
1432
|
+
string: string
|
|
1433
|
+
});
|
|
1434
|
+
|
|
1435
|
+
const formData$1 = () => $FormDataReader;
|
|
1436
|
+
const headers$1 = () => $HeadersReader;
|
|
1437
|
+
const parameter$1 = () => $ParameterReader;
|
|
1438
|
+
const query$1 = () => $QueryReader;
|
|
1439
|
+
|
|
1440
|
+
const capitalize = (str) => str.length ? str[0].toUpperCase() + str.slice(1).toLowerCase() : str;
|
|
1441
|
+
|
|
1442
|
+
function snake$2(str) {
|
|
1443
|
+
if (str.length === 0)
|
|
1444
|
+
return str;
|
|
1445
|
+
// PREFIX
|
|
1446
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1447
|
+
let prefix = "";
|
|
1448
|
+
for (let i = 0; i < str.length; i++) {
|
|
1449
|
+
if (str[i] === "_")
|
|
1450
|
+
prefix += "_";
|
|
1451
|
+
else
|
|
1452
|
+
break;
|
|
1453
|
+
}
|
|
1454
|
+
if (prefix.length !== 0)
|
|
1455
|
+
str = str.substring(prefix.length);
|
|
1456
|
+
const out = (s) => `${prefix}${s}`;
|
|
1457
|
+
// SNAKE CASE
|
|
1458
|
+
const items = str.split("_");
|
|
1459
|
+
if (items.length > 1)
|
|
1460
|
+
return out(items.map((s) => s.toLowerCase()).join("_"));
|
|
1461
|
+
// CAMEL OR PASCAL CASE
|
|
1462
|
+
const indexes = [];
|
|
1463
|
+
for (let i = 0; i < str.length; i++) {
|
|
1464
|
+
const code = str.charCodeAt(i);
|
|
1465
|
+
if (65 <= code && code <= 90)
|
|
1466
|
+
indexes.push(i);
|
|
1467
|
+
}
|
|
1468
|
+
for (let i = indexes.length - 1; i > 0; --i) {
|
|
1469
|
+
const now = indexes[i];
|
|
1470
|
+
const prev = indexes[i - 1];
|
|
1471
|
+
if (now - prev === 1)
|
|
1472
|
+
indexes.splice(i, 1);
|
|
1473
|
+
}
|
|
1474
|
+
if (indexes.length !== 0 && indexes[0] === 0)
|
|
1475
|
+
indexes.splice(0, 1);
|
|
1476
|
+
if (indexes.length === 0)
|
|
1477
|
+
return str.toLowerCase();
|
|
1478
|
+
let ret = "";
|
|
1479
|
+
for (let i = 0; i < indexes.length; i++) {
|
|
1480
|
+
const first = i === 0 ? 0 : indexes[i - 1];
|
|
1481
|
+
const last = indexes[i];
|
|
1482
|
+
ret += str.substring(first, last).toLowerCase();
|
|
1483
|
+
ret += "_";
|
|
1484
|
+
}
|
|
1485
|
+
ret += str.substring(indexes[indexes.length - 1]).toLowerCase();
|
|
1486
|
+
return out(ret);
|
|
1487
|
+
}
|
|
1488
|
+
const camel$2 = (str) => unsnake({
|
|
1489
|
+
plain: (str) => str.length
|
|
1490
|
+
? str === str.toUpperCase()
|
|
1491
|
+
? str.toLocaleLowerCase()
|
|
1492
|
+
: `${str[0].toLowerCase()}${str.substring(1)}`
|
|
1493
|
+
: str,
|
|
1494
|
+
snake: (str, i) => i === 0 ? str.toLowerCase() : capitalize(str.toLowerCase()),
|
|
1495
|
+
})(str);
|
|
1496
|
+
const pascal$2 = (str) => unsnake({
|
|
1497
|
+
plain: (str) => str.length ? `${str[0].toUpperCase()}${str.substring(1)}` : str,
|
|
1498
|
+
snake: capitalize,
|
|
1499
|
+
})(str);
|
|
1500
|
+
const unsnake = (props) => (str) => {
|
|
1501
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1502
|
+
let prefix = "";
|
|
1503
|
+
for (let i = 0; i < str.length; i++) {
|
|
1504
|
+
if (str[i] === "_")
|
|
1505
|
+
prefix += "_";
|
|
1506
|
+
else
|
|
1507
|
+
break;
|
|
1508
|
+
}
|
|
1509
|
+
if (prefix.length !== 0)
|
|
1510
|
+
str = str.substring(prefix.length);
|
|
1511
|
+
const out = (s) => `${prefix}${s}`;
|
|
1512
|
+
if (str.length === 0)
|
|
1513
|
+
return out("");
|
|
1514
|
+
const items = str.split("_").filter((s) => s.length !== 0);
|
|
1515
|
+
return items.length === 0
|
|
1516
|
+
? out("")
|
|
1517
|
+
: items.length === 1
|
|
1518
|
+
? out(props.plain(items[0]))
|
|
1519
|
+
: out(items.map(props.snake).join(""));
|
|
1520
|
+
};
|
|
1521
|
+
|
|
1522
|
+
const $convention = (rename) => {
|
|
1523
|
+
const main = (input) => {
|
|
1524
|
+
if (typeof input === "object")
|
|
1525
|
+
if (input === null)
|
|
1526
|
+
return null;
|
|
1527
|
+
else if (Array.isArray(input))
|
|
1528
|
+
return input.map(main);
|
|
1529
|
+
else if (input instanceof Boolean ||
|
|
1530
|
+
input instanceof BigInt ||
|
|
1531
|
+
input instanceof Number ||
|
|
1532
|
+
input instanceof String)
|
|
1533
|
+
return input.valueOf();
|
|
1534
|
+
else if (input instanceof Date)
|
|
1535
|
+
return new Date(input);
|
|
1536
|
+
else if (input instanceof Uint8Array ||
|
|
1537
|
+
input instanceof Uint8ClampedArray ||
|
|
1538
|
+
input instanceof Uint16Array ||
|
|
1539
|
+
input instanceof Uint32Array ||
|
|
1540
|
+
input instanceof BigUint64Array ||
|
|
1541
|
+
input instanceof Int8Array ||
|
|
1542
|
+
input instanceof Int16Array ||
|
|
1543
|
+
input instanceof Int32Array ||
|
|
1544
|
+
input instanceof BigInt64Array ||
|
|
1545
|
+
input instanceof Float32Array ||
|
|
1546
|
+
input instanceof Float64Array ||
|
|
1547
|
+
input instanceof DataView)
|
|
1548
|
+
return input;
|
|
1549
|
+
else
|
|
1550
|
+
return object(input);
|
|
1551
|
+
return input;
|
|
1552
|
+
};
|
|
1553
|
+
const object = (input) => Object.fromEntries(Object.entries(input).map(([key, value]) => [rename(key), main(value)]));
|
|
1554
|
+
return main;
|
|
1555
|
+
};
|
|
1556
|
+
|
|
1557
|
+
const camel$1 = (method) => ({
|
|
1558
|
+
...base(method),
|
|
1559
|
+
any: $convention(camel$2),
|
|
1560
|
+
});
|
|
1561
|
+
const pascal$1 = (method) => ({
|
|
1562
|
+
...base(method),
|
|
1563
|
+
any: $convention(pascal$2),
|
|
1564
|
+
});
|
|
1565
|
+
const snake$1 = (method) => ({
|
|
1566
|
+
...base(method),
|
|
1567
|
+
any: $convention(snake$2),
|
|
1568
|
+
});
|
|
1569
|
+
const base = (method) => ({
|
|
1570
|
+
...is$1(),
|
|
1571
|
+
throws: $throws(`notations.${method}`),
|
|
1572
|
+
});
|
|
1573
|
+
|
|
1574
|
+
const $clone = (value) => $cloneMain(value);
|
|
1575
|
+
const $cloneMain = (value) => {
|
|
1576
|
+
if (value === undefined)
|
|
1577
|
+
return undefined;
|
|
1578
|
+
else if (typeof value === "object")
|
|
1579
|
+
if (value === null)
|
|
1580
|
+
return null;
|
|
1581
|
+
else if (Array.isArray(value))
|
|
1582
|
+
return value.map($cloneMain);
|
|
1583
|
+
else if (value instanceof Date)
|
|
1584
|
+
return new Date(value);
|
|
1585
|
+
else if (value instanceof Uint8Array)
|
|
1586
|
+
return new Uint8Array(value);
|
|
1587
|
+
else if (value instanceof Uint8ClampedArray)
|
|
1588
|
+
return new Uint8ClampedArray(value);
|
|
1589
|
+
else if (value instanceof Uint16Array)
|
|
1590
|
+
return new Uint16Array(value);
|
|
1591
|
+
else if (value instanceof Uint32Array)
|
|
1592
|
+
return new Uint32Array(value);
|
|
1593
|
+
else if (value instanceof BigUint64Array)
|
|
1594
|
+
return new BigUint64Array(value);
|
|
1595
|
+
else if (value instanceof Int8Array)
|
|
1596
|
+
return new Int8Array(value);
|
|
1597
|
+
else if (value instanceof Int16Array)
|
|
1598
|
+
return new Int16Array(value);
|
|
1599
|
+
else if (value instanceof Int32Array)
|
|
1600
|
+
return new Int32Array(value);
|
|
1601
|
+
else if (value instanceof BigInt64Array)
|
|
1602
|
+
return new BigInt64Array(value);
|
|
1603
|
+
else if (value instanceof Float32Array)
|
|
1604
|
+
return new Float32Array(value);
|
|
1605
|
+
else if (value instanceof Float64Array)
|
|
1606
|
+
return new Float64Array(value);
|
|
1607
|
+
else if (value instanceof ArrayBuffer)
|
|
1608
|
+
return value.slice(0);
|
|
1609
|
+
else if (value instanceof SharedArrayBuffer)
|
|
1610
|
+
return value.slice(0);
|
|
1611
|
+
else if (value instanceof DataView)
|
|
1612
|
+
return new DataView(value.buffer.slice(0));
|
|
1613
|
+
else if (typeof File !== "undefined" && value instanceof File)
|
|
1614
|
+
return new File([value], value.name, { type: value.type });
|
|
1615
|
+
else if (typeof Blob !== "undefined" && value instanceof Blob)
|
|
1616
|
+
return new Blob([value], { type: value.type });
|
|
1617
|
+
else if (value instanceof Set)
|
|
1618
|
+
return new Set([...value].map($cloneMain));
|
|
1619
|
+
else if (value instanceof Map)
|
|
1620
|
+
return new Map([...value].map(([k, v]) => [$cloneMain(k), $cloneMain(v)]));
|
|
1621
|
+
else if (value instanceof WeakSet || value instanceof WeakMap)
|
|
1622
|
+
throw new Error("WeakSet and WeakMap are not supported");
|
|
1623
|
+
else if (value.valueOf() !== value)
|
|
1624
|
+
return $cloneMain(value.valueOf());
|
|
1625
|
+
else
|
|
1626
|
+
return Object.fromEntries(Object.entries(value)
|
|
1627
|
+
.map(([k, v]) => [k, $cloneMain(v)])
|
|
1628
|
+
.filter(([, v]) => v !== undefined));
|
|
1629
|
+
else if (typeof value === "function")
|
|
1630
|
+
return undefined;
|
|
1631
|
+
return value;
|
|
1632
|
+
};
|
|
1633
|
+
|
|
1634
|
+
const $any = (val) => $clone(val);
|
|
1635
|
+
|
|
1636
|
+
const clone$1 = (method) => ({
|
|
1637
|
+
...is$1(),
|
|
1638
|
+
throws: $throws(`misc.${method}`),
|
|
1639
|
+
any: $any,
|
|
1640
|
+
});
|
|
1641
|
+
const prune$1 = (method) => ({
|
|
1642
|
+
...is$1(),
|
|
1643
|
+
throws: $throws(`misc.${method}`),
|
|
1644
|
+
});
|
|
1645
|
+
|
|
1646
|
+
class Singleton {
|
|
1647
|
+
closure_;
|
|
1648
|
+
value_;
|
|
1649
|
+
constructor(closure) {
|
|
1650
|
+
this.closure_ = closure;
|
|
1651
|
+
this.value_ = NOT_MOUNTED_YET;
|
|
1652
|
+
}
|
|
1653
|
+
get(...args) {
|
|
1654
|
+
if (this.value_ === NOT_MOUNTED_YET)
|
|
1655
|
+
this.value_ = this.closure_(...args);
|
|
1656
|
+
return this.value_;
|
|
1657
|
+
}
|
|
1658
|
+
}
|
|
1659
|
+
const NOT_MOUNTED_YET = {};
|
|
1660
|
+
|
|
1661
|
+
/// @reference https://github.com/piotr-oles/as-proto/blob/main/packages/as-proto/assembly/internal/FixedReader.ts
|
|
1662
|
+
class $ProtobufReader {
|
|
1663
|
+
/**
|
|
1664
|
+
* Read buffer
|
|
1665
|
+
*/
|
|
1666
|
+
buf;
|
|
1667
|
+
/**
|
|
1668
|
+
* Read buffer pointer.
|
|
1669
|
+
*/
|
|
1670
|
+
ptr;
|
|
1671
|
+
/**
|
|
1672
|
+
* DataView for buffer.
|
|
1673
|
+
*/
|
|
1674
|
+
view;
|
|
1675
|
+
constructor(buf) {
|
|
1676
|
+
this.buf = buf;
|
|
1677
|
+
this.ptr = 0;
|
|
1678
|
+
this.view = new DataView(buf.buffer, buf.byteOffset, buf.byteLength);
|
|
1679
|
+
}
|
|
1680
|
+
index() {
|
|
1681
|
+
return this.ptr;
|
|
1682
|
+
}
|
|
1683
|
+
size() {
|
|
1684
|
+
return this.buf.length;
|
|
1685
|
+
}
|
|
1686
|
+
uint32() {
|
|
1687
|
+
return this.varint32();
|
|
1688
|
+
}
|
|
1689
|
+
int32() {
|
|
1690
|
+
return this.varint32();
|
|
1691
|
+
}
|
|
1692
|
+
sint32() {
|
|
1693
|
+
const value = this.varint32();
|
|
1694
|
+
return (value >>> 1) ^ -(value & 1);
|
|
1695
|
+
}
|
|
1696
|
+
uint64() {
|
|
1697
|
+
return this.varint64();
|
|
1698
|
+
}
|
|
1699
|
+
int64() {
|
|
1700
|
+
return this.varint64();
|
|
1701
|
+
}
|
|
1702
|
+
sint64() {
|
|
1703
|
+
const value = this.varint64();
|
|
1704
|
+
return (value >> BigInt(0x01)) ^ -(value & BigInt(0x01));
|
|
1705
|
+
}
|
|
1706
|
+
bool() {
|
|
1707
|
+
return this.varint32() !== 0;
|
|
1708
|
+
}
|
|
1709
|
+
float() {
|
|
1710
|
+
const value = this.view.getFloat32(this.ptr, true);
|
|
1711
|
+
this.ptr += 4;
|
|
1712
|
+
return value;
|
|
1713
|
+
}
|
|
1714
|
+
double() {
|
|
1715
|
+
const value = this.view.getFloat64(this.ptr, true);
|
|
1716
|
+
this.ptr += 8;
|
|
1717
|
+
return value;
|
|
1718
|
+
}
|
|
1719
|
+
bytes() {
|
|
1720
|
+
const length = this.uint32();
|
|
1721
|
+
const from = this.ptr;
|
|
1722
|
+
this.ptr += length;
|
|
1723
|
+
return this.buf.subarray(from, from + length);
|
|
1724
|
+
}
|
|
1725
|
+
string() {
|
|
1726
|
+
return utf8$1.get().decode(this.bytes());
|
|
1727
|
+
}
|
|
1728
|
+
skip(length) {
|
|
1729
|
+
if (length === 0)
|
|
1730
|
+
while (this.u8() & 0x80)
|
|
1731
|
+
;
|
|
1732
|
+
else {
|
|
1733
|
+
if (this.index() + length > this.size())
|
|
1734
|
+
throw new Error("Error on typia.protobuf.decode(): buffer overflow.");
|
|
1735
|
+
this.ptr += length;
|
|
1736
|
+
}
|
|
1737
|
+
}
|
|
1738
|
+
skipType(wireType) {
|
|
1739
|
+
switch (wireType) {
|
|
1740
|
+
case 0 /* ProtobufWire.VARIANT */:
|
|
1741
|
+
this.skip(0);
|
|
1742
|
+
break;
|
|
1743
|
+
case 1 /* ProtobufWire.I64 */:
|
|
1744
|
+
this.skip(8);
|
|
1745
|
+
break;
|
|
1746
|
+
case 2 /* ProtobufWire.LEN */:
|
|
1747
|
+
this.skip(this.uint32());
|
|
1748
|
+
break;
|
|
1749
|
+
case 3 /* ProtobufWire.START_GROUP */:
|
|
1750
|
+
while ((wireType = this.uint32() & 0x07) !== 4 /* ProtobufWire.END_GROUP */)
|
|
1751
|
+
this.skipType(wireType);
|
|
1752
|
+
break;
|
|
1753
|
+
case 5 /* ProtobufWire.I32 */:
|
|
1754
|
+
this.skip(4);
|
|
1755
|
+
break;
|
|
1756
|
+
default:
|
|
1757
|
+
throw new Error(`Invalid wire type ${wireType} at offset ${this.ptr}.`);
|
|
1758
|
+
}
|
|
1759
|
+
}
|
|
1760
|
+
varint32() {
|
|
1761
|
+
let loaded;
|
|
1762
|
+
let value;
|
|
1763
|
+
value = (loaded = this.u8()) & 0x7f;
|
|
1764
|
+
if (loaded < 0x80)
|
|
1765
|
+
return value;
|
|
1766
|
+
value |= ((loaded = this.u8()) & 0x7f) << 7;
|
|
1767
|
+
if (loaded < 0x80)
|
|
1768
|
+
return value;
|
|
1769
|
+
value |= ((loaded = this.u8()) & 0x7f) << 14;
|
|
1770
|
+
if (loaded < 0x80)
|
|
1771
|
+
return value;
|
|
1772
|
+
value |= ((loaded = this.u8()) & 0x7f) << 21;
|
|
1773
|
+
if (loaded < 0x80)
|
|
1774
|
+
return value;
|
|
1775
|
+
value |= ((loaded = this.u8()) & 0xf) << 28;
|
|
1776
|
+
if (loaded < 0x80)
|
|
1777
|
+
return value;
|
|
1778
|
+
// increment position until there is no continuation bit or until we read 10 bytes
|
|
1779
|
+
if (this.u8() < 0x80)
|
|
1780
|
+
return value;
|
|
1781
|
+
if (this.u8() < 0x80)
|
|
1782
|
+
return value;
|
|
1783
|
+
if (this.u8() < 0x80)
|
|
1784
|
+
return value;
|
|
1785
|
+
if (this.u8() < 0x80)
|
|
1786
|
+
return value;
|
|
1787
|
+
if (this.u8() < 0x80)
|
|
1788
|
+
return value;
|
|
1789
|
+
return value;
|
|
1790
|
+
}
|
|
1791
|
+
varint64() {
|
|
1792
|
+
let loaded;
|
|
1793
|
+
let value;
|
|
1794
|
+
value = (loaded = this.u8n()) & BigInt(0x7f);
|
|
1795
|
+
if (loaded < BigInt(0x80))
|
|
1796
|
+
return value;
|
|
1797
|
+
value |= ((loaded = this.u8n()) & BigInt(0x7f)) << BigInt(7);
|
|
1798
|
+
if (loaded < BigInt(0x80))
|
|
1799
|
+
return value;
|
|
1800
|
+
value |= ((loaded = this.u8n()) & BigInt(0x7f)) << BigInt(14);
|
|
1801
|
+
if (loaded < BigInt(0x80))
|
|
1802
|
+
return value;
|
|
1803
|
+
value |= ((loaded = this.u8n()) & BigInt(0x7f)) << BigInt(21);
|
|
1804
|
+
if (loaded < BigInt(0x80))
|
|
1805
|
+
return value;
|
|
1806
|
+
value |= ((loaded = this.u8n()) & BigInt(0x7f)) << BigInt(28);
|
|
1807
|
+
if (loaded < BigInt(0x80))
|
|
1808
|
+
return value;
|
|
1809
|
+
value |= ((loaded = this.u8n()) & BigInt(0x7f)) << BigInt(35);
|
|
1810
|
+
if (loaded < BigInt(0x80))
|
|
1811
|
+
return value;
|
|
1812
|
+
value |= ((loaded = this.u8n()) & BigInt(0x7f)) << BigInt(42);
|
|
1813
|
+
if (loaded < BigInt(0x80))
|
|
1814
|
+
return value;
|
|
1815
|
+
value |= ((loaded = this.u8n()) & BigInt(0x7f)) << BigInt(49);
|
|
1816
|
+
if (loaded < BigInt(0x80))
|
|
1817
|
+
return value;
|
|
1818
|
+
value |= ((loaded = this.u8n()) & BigInt(0x7f)) << BigInt(56);
|
|
1819
|
+
if (loaded < BigInt(0x80))
|
|
1820
|
+
return value;
|
|
1821
|
+
value |= (this.u8n() & BigInt(0x01)) << BigInt(63);
|
|
1822
|
+
return BigInt.asIntN(64, value);
|
|
1823
|
+
}
|
|
1824
|
+
u8() {
|
|
1825
|
+
return this.view.getUint8(this.ptr++);
|
|
1826
|
+
}
|
|
1827
|
+
u8n() {
|
|
1828
|
+
return BigInt(this.u8());
|
|
1829
|
+
}
|
|
1830
|
+
}
|
|
1831
|
+
const utf8$1 = /** @__PURE__ */ new Singleton(() => new TextDecoder("utf-8"));
|
|
1832
|
+
|
|
1833
|
+
const $strlen = (s) => {
|
|
1834
|
+
let b;
|
|
1835
|
+
let i;
|
|
1836
|
+
let c;
|
|
1837
|
+
for (b = i = 0; (c = s.charCodeAt(i++)); b += c >> 11 ? 3 : c >> 7 ? 2 : 1)
|
|
1838
|
+
;
|
|
1839
|
+
return b;
|
|
1840
|
+
};
|
|
1841
|
+
|
|
1842
|
+
/// @reference https://github.com/piotr-oles/as-proto/blob/main/packages/as-proto/assembly/internal/FixedSizer.ts
|
|
1843
|
+
class $ProtobufSizer {
|
|
1844
|
+
/**
|
|
1845
|
+
* Total length.
|
|
1846
|
+
*/
|
|
1847
|
+
len;
|
|
1848
|
+
/**
|
|
1849
|
+
* Position stack.
|
|
1850
|
+
*/
|
|
1851
|
+
pos;
|
|
1852
|
+
/**
|
|
1853
|
+
* Variable length list.
|
|
1854
|
+
*/
|
|
1855
|
+
varlen;
|
|
1856
|
+
/**
|
|
1857
|
+
* Variable length index stack.
|
|
1858
|
+
*/
|
|
1859
|
+
varlenidx;
|
|
1860
|
+
constructor(length = 0) {
|
|
1861
|
+
this.len = length;
|
|
1862
|
+
this.pos = [];
|
|
1863
|
+
this.varlen = [];
|
|
1864
|
+
this.varlenidx = [];
|
|
1865
|
+
}
|
|
1866
|
+
bool() {
|
|
1867
|
+
this.len += 1;
|
|
1868
|
+
}
|
|
1869
|
+
int32(value) {
|
|
1870
|
+
if (value < 0) {
|
|
1871
|
+
// 10 bytes to encode negative number
|
|
1872
|
+
this.len += 10;
|
|
1873
|
+
}
|
|
1874
|
+
else {
|
|
1875
|
+
this.varint32(value);
|
|
1876
|
+
}
|
|
1877
|
+
}
|
|
1878
|
+
sint32(value) {
|
|
1879
|
+
this.varint32((value << 1) ^ (value >> 31));
|
|
1880
|
+
}
|
|
1881
|
+
uint32(value) {
|
|
1882
|
+
this.varint32(value);
|
|
1883
|
+
}
|
|
1884
|
+
int64(value) {
|
|
1885
|
+
this.varint64(typeof value === "number" ? BigInt(value) : value);
|
|
1886
|
+
}
|
|
1887
|
+
sint64(value) {
|
|
1888
|
+
if (typeof value === "number")
|
|
1889
|
+
value = BigInt(value);
|
|
1890
|
+
this.varint64((value << BigInt(1)) ^ (value >> BigInt(63)));
|
|
1891
|
+
}
|
|
1892
|
+
uint64(value) {
|
|
1893
|
+
this.varint64(typeof value === "number" ? BigInt(value) : value);
|
|
1894
|
+
}
|
|
1895
|
+
// public fixed32(_value: number): void {
|
|
1896
|
+
// this.len += 4;
|
|
1897
|
+
// }
|
|
1898
|
+
// public sfixed32(_value: number): void {
|
|
1899
|
+
// this.len += 4;
|
|
1900
|
+
// }
|
|
1901
|
+
// public fixed64(_value: number | bigint): void {
|
|
1902
|
+
// this.len += 8;
|
|
1903
|
+
// }
|
|
1904
|
+
// public sfixed64(_value: number | bigint): void {
|
|
1905
|
+
// this.len += 8;
|
|
1906
|
+
// }
|
|
1907
|
+
float(_value) {
|
|
1908
|
+
this.len += 4;
|
|
1909
|
+
}
|
|
1910
|
+
double(_value) {
|
|
1911
|
+
this.len += 8;
|
|
1912
|
+
}
|
|
1913
|
+
bytes(value) {
|
|
1914
|
+
this.uint32(value.byteLength);
|
|
1915
|
+
this.len += value.byteLength;
|
|
1916
|
+
}
|
|
1917
|
+
string(value) {
|
|
1918
|
+
const len = $strlen(value);
|
|
1919
|
+
this.varlen.push(len);
|
|
1920
|
+
this.uint32(len);
|
|
1921
|
+
this.len += len;
|
|
1922
|
+
}
|
|
1923
|
+
fork() {
|
|
1924
|
+
this.pos.push(this.len); // save current position
|
|
1925
|
+
this.varlenidx.push(this.varlen.length); // save current index in varlen array
|
|
1926
|
+
this.varlen.push(0); // add 0 length to varlen array (to be updated in ldelim())
|
|
1927
|
+
}
|
|
1928
|
+
ldelim() {
|
|
1929
|
+
if (!(this.pos.length && this.varlenidx.length))
|
|
1930
|
+
throw new Error("Error on typia.protobuf.encode(): missing fork() before ldelim() call.");
|
|
1931
|
+
const endPos = this.len; // current position is end position
|
|
1932
|
+
const startPos = this.pos.pop(); // get start position from stack
|
|
1933
|
+
const idx = this.varlenidx.pop(); // get varlen index from stack
|
|
1934
|
+
const len = endPos - startPos; // calculate length
|
|
1935
|
+
this.varlen[idx] = len; // update variable length
|
|
1936
|
+
this.uint32(len); // add uint32 that should be called in fork()
|
|
1937
|
+
}
|
|
1938
|
+
reset() {
|
|
1939
|
+
this.len = 0;
|
|
1940
|
+
// re-use arrays
|
|
1941
|
+
this.pos.length = 0;
|
|
1942
|
+
this.varlen.length = 0;
|
|
1943
|
+
this.varlenidx.length = 0;
|
|
1944
|
+
}
|
|
1945
|
+
varint32(value) {
|
|
1946
|
+
this.len +=
|
|
1947
|
+
value < 0
|
|
1948
|
+
? 10 // 10 bits with leading 1's
|
|
1949
|
+
: value < 0x80
|
|
1950
|
+
? 1
|
|
1951
|
+
: value < 0x4000
|
|
1952
|
+
? 2
|
|
1953
|
+
: value < 0x200000
|
|
1954
|
+
? 3
|
|
1955
|
+
: value < 0x10000000
|
|
1956
|
+
? 4
|
|
1957
|
+
: 5;
|
|
1958
|
+
}
|
|
1959
|
+
varint64(val) {
|
|
1960
|
+
val = BigInt.asUintN(64, val);
|
|
1961
|
+
while (val > BigInt(0x7f)) {
|
|
1962
|
+
++this.len;
|
|
1963
|
+
val = val >> BigInt(0x07);
|
|
1964
|
+
}
|
|
1965
|
+
++this.len;
|
|
1966
|
+
}
|
|
1967
|
+
}
|
|
1968
|
+
|
|
1969
|
+
/// @reference https://github.com/piotr-oles/as-proto/blob/main/packages/as-proto/assembly/internal/FixedWriter.ts
|
|
1970
|
+
class $ProtobufWriter {
|
|
1971
|
+
/**
|
|
1972
|
+
* Related sizer
|
|
1973
|
+
*/
|
|
1974
|
+
sizer;
|
|
1975
|
+
/**
|
|
1976
|
+
* Current pointer.
|
|
1977
|
+
*/
|
|
1978
|
+
ptr;
|
|
1979
|
+
/**
|
|
1980
|
+
* Protobuf buffer.
|
|
1981
|
+
*/
|
|
1982
|
+
buf;
|
|
1983
|
+
/**
|
|
1984
|
+
* DataView for buffer.
|
|
1985
|
+
*/
|
|
1986
|
+
view;
|
|
1987
|
+
/**
|
|
1988
|
+
* Index in varlen array from sizer.
|
|
1989
|
+
*/
|
|
1990
|
+
varlenidx;
|
|
1991
|
+
constructor(sizer) {
|
|
1992
|
+
this.sizer = sizer;
|
|
1993
|
+
this.buf = new Uint8Array(sizer.len);
|
|
1994
|
+
this.view = new DataView(this.buf.buffer);
|
|
1995
|
+
this.ptr = 0;
|
|
1996
|
+
this.varlenidx = 0;
|
|
1997
|
+
}
|
|
1998
|
+
buffer() {
|
|
1999
|
+
return this.buf;
|
|
2000
|
+
}
|
|
2001
|
+
bool(value) {
|
|
2002
|
+
this.byte(value ? 1 : 0);
|
|
2003
|
+
}
|
|
2004
|
+
byte(value) {
|
|
2005
|
+
this.buf[this.ptr++] = value & 255;
|
|
2006
|
+
}
|
|
2007
|
+
int32(value) {
|
|
2008
|
+
if (value < 0)
|
|
2009
|
+
this.int64(value);
|
|
2010
|
+
else
|
|
2011
|
+
this.variant32(value >>> 0);
|
|
2012
|
+
}
|
|
2013
|
+
sint32(value) {
|
|
2014
|
+
this.variant32((value << 1) ^ (value >> 31));
|
|
2015
|
+
}
|
|
2016
|
+
uint32(value) {
|
|
2017
|
+
this.variant32(value);
|
|
2018
|
+
}
|
|
2019
|
+
sint64(value) {
|
|
2020
|
+
value = BigInt(value);
|
|
2021
|
+
this.variant64((value << BigInt(0x01)) ^ (value >> BigInt(0x3f)));
|
|
2022
|
+
}
|
|
2023
|
+
int64(value) {
|
|
2024
|
+
this.variant64(BigInt(value));
|
|
2025
|
+
}
|
|
2026
|
+
uint64(value) {
|
|
2027
|
+
this.variant64(BigInt(value));
|
|
2028
|
+
}
|
|
2029
|
+
float(val) {
|
|
2030
|
+
this.view.setFloat32(this.ptr, val, true);
|
|
2031
|
+
this.ptr += 4;
|
|
2032
|
+
}
|
|
2033
|
+
double(val) {
|
|
2034
|
+
this.view.setFloat64(this.ptr, val, true);
|
|
2035
|
+
this.ptr += 8;
|
|
2036
|
+
}
|
|
2037
|
+
bytes(value) {
|
|
2038
|
+
this.uint32(value.byteLength);
|
|
2039
|
+
for (let i = 0; i < value.byteLength; i++)
|
|
2040
|
+
this.buf[this.ptr++] = value[i];
|
|
2041
|
+
}
|
|
2042
|
+
string(value) {
|
|
2043
|
+
const len = this.varlen(); // use precomputed length
|
|
2044
|
+
this.uint32(len);
|
|
2045
|
+
const binary = utf8.get().encode(value);
|
|
2046
|
+
for (let i = 0; i < binary.byteLength; i++)
|
|
2047
|
+
this.buf[this.ptr++] = binary[i];
|
|
2048
|
+
}
|
|
2049
|
+
fork() {
|
|
2050
|
+
this.uint32(this.varlen()); // use precomputed length
|
|
2051
|
+
}
|
|
2052
|
+
ldelim() {
|
|
2053
|
+
// nothing to do - all dirty work done by sizer
|
|
2054
|
+
}
|
|
2055
|
+
finish() {
|
|
2056
|
+
return this.buf;
|
|
2057
|
+
}
|
|
2058
|
+
reset() {
|
|
2059
|
+
this.buf = new Uint8Array(this.sizer.len);
|
|
2060
|
+
this.view = new DataView(this.buf.buffer);
|
|
2061
|
+
this.ptr = 0;
|
|
2062
|
+
this.varlenidx = 0;
|
|
2063
|
+
}
|
|
2064
|
+
variant32(val) {
|
|
2065
|
+
while (val > 0x7f) {
|
|
2066
|
+
this.buf[this.ptr++] = (val & 0x7f) | 0x80;
|
|
2067
|
+
val = val >>> 7;
|
|
2068
|
+
}
|
|
2069
|
+
this.buf[this.ptr++] = val;
|
|
2070
|
+
}
|
|
2071
|
+
variant64(val) {
|
|
2072
|
+
val = BigInt.asUintN(64, val);
|
|
2073
|
+
while (val > BigInt(0x7f)) {
|
|
2074
|
+
this.buf[this.ptr++] = Number((val & BigInt(0x7f)) | BigInt(0x80));
|
|
2075
|
+
val = val >> BigInt(0x07);
|
|
2076
|
+
}
|
|
2077
|
+
this.buf[this.ptr++] = Number(val);
|
|
2078
|
+
}
|
|
2079
|
+
varlen() {
|
|
2080
|
+
return this.varlenidx >= this.sizer.varlen.length
|
|
2081
|
+
? 0
|
|
2082
|
+
: this.sizer.varlen[this.varlenidx++];
|
|
2083
|
+
}
|
|
2084
|
+
}
|
|
2085
|
+
const utf8 = /** @__PURE__ */ new Singleton(() => new TextEncoder());
|
|
2086
|
+
|
|
2087
|
+
const decode$1 = (method) => ({
|
|
2088
|
+
...is$1(),
|
|
2089
|
+
Reader: $ProtobufReader,
|
|
2090
|
+
throws: $throws(`protobuf.${method}`),
|
|
2091
|
+
});
|
|
2092
|
+
const encode$1 = (method) => ({
|
|
2093
|
+
...is$1(),
|
|
2094
|
+
Sizer: $ProtobufSizer,
|
|
2095
|
+
Writer: $ProtobufWriter,
|
|
2096
|
+
strlen: $strlen,
|
|
2097
|
+
throws: $throws(method),
|
|
2098
|
+
});
|
|
2099
|
+
|
|
2100
|
+
const assert$1 = (method) => ({
|
|
2101
|
+
...is$1(),
|
|
2102
|
+
join: $join,
|
|
2103
|
+
every: $every,
|
|
2104
|
+
guard: $guard(`typia.${method}`),
|
|
2105
|
+
predicate: (matched, exceptionable, closure) => {
|
|
2106
|
+
if (matched === false && exceptionable === true)
|
|
2107
|
+
throw new TypeGuardError({
|
|
2108
|
+
...closure(),
|
|
2109
|
+
method: `typia.${method}`,
|
|
2110
|
+
});
|
|
2111
|
+
return matched;
|
|
2112
|
+
},
|
|
2113
|
+
});
|
|
2114
|
+
const validate$1 = () => ({
|
|
2115
|
+
...is$1(),
|
|
2116
|
+
join: $join,
|
|
2117
|
+
report: $report,
|
|
2118
|
+
predicate: (res) => (matched, exceptionable, closure) => {
|
|
2119
|
+
// CHECK FAILURE
|
|
2120
|
+
if (matched === false && exceptionable === true)
|
|
2121
|
+
(() => {
|
|
2122
|
+
res.success &&= false;
|
|
2123
|
+
const errorList = res.errors;
|
|
2124
|
+
// TRACE ERROR
|
|
2125
|
+
const error = closure();
|
|
2126
|
+
if (errorList.length) {
|
|
2127
|
+
const last = errorList[errorList.length - 1].path;
|
|
2128
|
+
if (last.length >= error.path.length &&
|
|
2129
|
+
last.substring(0, error.path.length) === error.path)
|
|
2130
|
+
return;
|
|
2131
|
+
}
|
|
2132
|
+
errorList.push(error);
|
|
2133
|
+
return;
|
|
2134
|
+
})();
|
|
2135
|
+
return matched;
|
|
2136
|
+
},
|
|
2137
|
+
});
|
|
2138
|
+
const random$1 = () => ({
|
|
2139
|
+
generator: RandomGenerator,
|
|
2140
|
+
pick: pick,
|
|
2141
|
+
});
|
|
2142
|
+
|
|
2143
|
+
/**
|
|
2144
|
+
* @internal
|
|
2145
|
+
*/
|
|
2146
|
+
function assertFunction() {
|
|
2147
|
+
halt$7("assertFunction");
|
|
2148
|
+
}
|
|
2149
|
+
const assertFunctionPure = /** @__PURE__ */ Object.assign(assertFunction,
|
|
2150
|
+
/** @__PURE__ */ assert$1("functional.assertFunction"),
|
|
2151
|
+
/** @__PURE__ */ functionalAssert());
|
|
2152
|
+
const assertParametersPure = /** @__PURE__ */ Object.assign(assertFunction,
|
|
2153
|
+
/** @__PURE__ */ assert$1("functional.assertFunction"),
|
|
2154
|
+
/** @__PURE__ */ functionalAssert());
|
|
2155
|
+
/**
|
|
2156
|
+
* @internal
|
|
2157
|
+
*/
|
|
2158
|
+
function assertReturn() {
|
|
2159
|
+
halt$7("assertReturn");
|
|
2160
|
+
}
|
|
2161
|
+
const assertReturnPure = /** @__PURE__ */ Object.assign(assertReturn,
|
|
2162
|
+
/** @__PURE__ */ assert$1("functional.assertReturn"),
|
|
2163
|
+
/** @__PURE__ */ functionalAssert());
|
|
2164
|
+
/**
|
|
2165
|
+
* @internal
|
|
2166
|
+
*/
|
|
2167
|
+
function assertEqualsFunction() {
|
|
2168
|
+
halt$7("assertEqualsFunction");
|
|
2169
|
+
}
|
|
2170
|
+
const assertEqualsFunctionPure = /** @__PURE__ */ Object.assign(assertEqualsFunction,
|
|
2171
|
+
/** @__PURE__ */ assert$1("functional.assertEqualsFunction"),
|
|
2172
|
+
/** @__PURE__ */ functionalAssert());
|
|
2173
|
+
/**
|
|
2174
|
+
* @internal
|
|
2175
|
+
*/
|
|
2176
|
+
function assertEqualsParameters() {
|
|
2177
|
+
halt$7("assertEqualsParameters");
|
|
2178
|
+
}
|
|
2179
|
+
const assertEqualsParametersPure = /** @__PURE__ */ Object.assign(assertEqualsParameters,
|
|
2180
|
+
/** @__PURE__ */ assert$1("functional.assertEqualsParameters"),
|
|
2181
|
+
/** @__PURE__ */ functionalAssert());
|
|
2182
|
+
/**
|
|
2183
|
+
* @internal
|
|
2184
|
+
*/
|
|
2185
|
+
function assertEqualsReturn() {
|
|
2186
|
+
halt$7("assertEqualsReturn");
|
|
2187
|
+
}
|
|
2188
|
+
const assertEqualsReturnPure = /** @__PURE__ */ Object.assign(assertEqualsReturn,
|
|
2189
|
+
/** @__PURE__ */ assert$1("functional.assertEqualsReturn"),
|
|
2190
|
+
/** @__PURE__ */ functionalAssert());
|
|
2191
|
+
/**
|
|
2192
|
+
* @internal
|
|
2193
|
+
*/
|
|
2194
|
+
function isFunction() {
|
|
2195
|
+
halt$7("isFunction");
|
|
2196
|
+
}
|
|
2197
|
+
const isFunctionPure = /** @__PURE__ */ Object.assign(isFunction,
|
|
2198
|
+
/** @__PURE__ */ is$1());
|
|
2199
|
+
/**
|
|
2200
|
+
* @internal
|
|
2201
|
+
*/
|
|
2202
|
+
function isParameters() {
|
|
2203
|
+
halt$7("isParameters");
|
|
2204
|
+
}
|
|
2205
|
+
const isParametersPure = /** @__PURE__ */ Object.assign(isParameters, /** @__PURE__ */ is$1());
|
|
2206
|
+
/**
|
|
2207
|
+
* @internal
|
|
2208
|
+
*/
|
|
2209
|
+
function isReturn() {
|
|
2210
|
+
halt$7("isReturn");
|
|
2211
|
+
}
|
|
2212
|
+
const isReturnPure = /** @__PURE__ */ Object.assign(isReturn,
|
|
2213
|
+
/** @__PURE__ */ is$1());
|
|
2214
|
+
/**
|
|
2215
|
+
* @internal
|
|
2216
|
+
*/
|
|
2217
|
+
function equalsFunction() {
|
|
2218
|
+
halt$7("equalsFunction");
|
|
2219
|
+
}
|
|
2220
|
+
const equalsFunctionPure = /** @__PURE__ */ Object.assign(equalsFunction, /** @__PURE__ */ is$1());
|
|
2221
|
+
/**
|
|
2222
|
+
* @internal
|
|
2223
|
+
*/
|
|
2224
|
+
function equalsParameters() {
|
|
2225
|
+
halt$7("equalsParameters");
|
|
2226
|
+
}
|
|
2227
|
+
const equalsParametersPure = /** @__PURE__ */ Object.assign(equalsParameters, /** @__PURE__ */ is$1());
|
|
2228
|
+
/**
|
|
2229
|
+
* @internal
|
|
2230
|
+
*/
|
|
2231
|
+
function equalsReturn() {
|
|
2232
|
+
halt$7("equalsReturn");
|
|
2233
|
+
}
|
|
2234
|
+
const equalsReturnPure = /** @__PURE__ */ Object.assign(equalsReturn, /** @__PURE__ */ is$1());
|
|
2235
|
+
/**
|
|
2236
|
+
* @internal
|
|
2237
|
+
*/
|
|
2238
|
+
function validateFunction() {
|
|
2239
|
+
halt$7("validateFunction");
|
|
2240
|
+
}
|
|
2241
|
+
const validateFunctionPure = /** @__PURE__ */ Object.assign(validateFunction, /** @__PURE__ */ validate$1());
|
|
2242
|
+
/**
|
|
2243
|
+
* @internal
|
|
2244
|
+
*/
|
|
2245
|
+
function validateParameters() {
|
|
2246
|
+
halt$7("validateReturn");
|
|
2247
|
+
}
|
|
2248
|
+
const validateParametersPure = /** @__PURE__ */ Object.assign(validateParameters, /** @__PURE__ */ validate$1());
|
|
2249
|
+
/**
|
|
2250
|
+
* @internal
|
|
2251
|
+
*/
|
|
2252
|
+
function validateReturn() {
|
|
2253
|
+
halt$7("validateReturn");
|
|
2254
|
+
}
|
|
2255
|
+
const validateReturnPure = /** @__PURE__ */ Object.assign(validateReturn, /** @__PURE__ */ validate$1());
|
|
2256
|
+
/**
|
|
2257
|
+
* @internal
|
|
2258
|
+
*/
|
|
2259
|
+
function validateEqualsFunction() {
|
|
2260
|
+
halt$7("validateEqualsFunction");
|
|
2261
|
+
}
|
|
2262
|
+
const validateEqualsFunctionPure = /** @__PURE__ */ Object.assign(validateEqualsFunction, /** @__PURE__ */ validate$1());
|
|
2263
|
+
/**
|
|
2264
|
+
* @internal
|
|
2265
|
+
*/
|
|
2266
|
+
function validateEqualsParameters() {
|
|
2267
|
+
halt$7("validateEqualsParameters");
|
|
2268
|
+
}
|
|
2269
|
+
const validateEqualsParametersPure = /** @__PURE__ */ Object.assign(validateEqualsParameters, /** @__PURE__ */ validate$1());
|
|
2270
|
+
/**
|
|
2271
|
+
* @internal
|
|
2272
|
+
*/
|
|
2273
|
+
function validateEqualsReturn() {
|
|
2274
|
+
halt$7("validateEqualsReturn");
|
|
2275
|
+
}
|
|
2276
|
+
const validateEqualsReturnPure = /** @__PURE__ */ Object.assign(validateEqualsReturn, /** @__PURE__ */ validate$1());
|
|
2277
|
+
/* -----------------------------------------------------------
|
|
2278
|
+
HALTER
|
|
2279
|
+
----------------------------------------------------------- */
|
|
2280
|
+
/**
|
|
2281
|
+
* @internal
|
|
2282
|
+
*/
|
|
2283
|
+
function halt$7(name) {
|
|
2284
|
+
throw new Error(`Error on typia.functional.${name}(): no transform has been configured. Read and follow https://typia.io/docs/setup please.`);
|
|
2285
|
+
}
|
|
2286
|
+
|
|
2287
|
+
var functional = /*#__PURE__*/Object.freeze({
|
|
2288
|
+
__proto__: null,
|
|
2289
|
+
assertEqualsFunction: assertEqualsFunctionPure,
|
|
2290
|
+
assertEqualsParameters: assertEqualsParametersPure,
|
|
2291
|
+
assertEqualsReturn: assertEqualsReturnPure,
|
|
2292
|
+
assertFunction: assertFunctionPure,
|
|
2293
|
+
assertParameters: assertParametersPure,
|
|
2294
|
+
assertReturn: assertReturnPure,
|
|
2295
|
+
equalsFunction: equalsFunctionPure,
|
|
2296
|
+
equalsParameters: equalsParametersPure,
|
|
2297
|
+
equalsReturn: equalsReturnPure,
|
|
2298
|
+
isFunction: isFunctionPure,
|
|
2299
|
+
isParameters: isParametersPure,
|
|
2300
|
+
isReturn: isReturnPure,
|
|
2301
|
+
validateEqualsFunction: validateEqualsFunctionPure,
|
|
2302
|
+
validateEqualsParameters: validateEqualsParametersPure,
|
|
2303
|
+
validateEqualsReturn: validateEqualsReturnPure,
|
|
2304
|
+
validateFunction: validateFunctionPure,
|
|
2305
|
+
validateParameters: validateParametersPure,
|
|
2306
|
+
validateReturn: validateReturnPure
|
|
2307
|
+
});
|
|
2308
|
+
|
|
2309
|
+
/**
|
|
2310
|
+
* @internal
|
|
2311
|
+
*/
|
|
2312
|
+
function formData() {
|
|
2313
|
+
halt$6("formData");
|
|
2314
|
+
}
|
|
2315
|
+
const formDataPure = /** @__PURE__ */ Object.assign(formData,
|
|
2316
|
+
/** @__PURE__ */ formData$1());
|
|
2317
|
+
/**
|
|
2318
|
+
* @internal
|
|
2319
|
+
*/
|
|
2320
|
+
function assertFormData() {
|
|
2321
|
+
halt$6("assertFormData");
|
|
2322
|
+
}
|
|
2323
|
+
const assertFormDataPure = /** @__PURE__ */ Object.assign(assertFormData,
|
|
2324
|
+
/** @__PURE__ */ formData$1(),
|
|
2325
|
+
/** @__PURE__ */ assert$1("http.assertFormData"));
|
|
2326
|
+
/**
|
|
2327
|
+
* @internal
|
|
2328
|
+
*/
|
|
2329
|
+
function isFormData() {
|
|
2330
|
+
halt$6("isFormData");
|
|
2331
|
+
}
|
|
2332
|
+
const isFormDataPure = /** @__PURE__ */ Object.assign(isFormData,
|
|
2333
|
+
/** @__PURE__ */ formData$1(),
|
|
2334
|
+
/** @__PURE__ */ is$1());
|
|
2335
|
+
/**
|
|
2336
|
+
* @internal
|
|
2337
|
+
*/
|
|
2338
|
+
function validateFormData() {
|
|
2339
|
+
halt$6("validateFormData");
|
|
2340
|
+
}
|
|
2341
|
+
const validateFormDataPure = /** @__PURE__ */ Object.assign(validateFormData,
|
|
2342
|
+
/** @__PURE__ */ formData$1(),
|
|
2343
|
+
/** @__PURE__ */ validate$1());
|
|
2344
|
+
/**
|
|
2345
|
+
* @internal
|
|
2346
|
+
*/
|
|
2347
|
+
function query() {
|
|
2348
|
+
halt$6("query");
|
|
2349
|
+
}
|
|
2350
|
+
const queryPure = /** @__PURE__ */ Object.assign(query,
|
|
2351
|
+
/** @__PURE__ */ query$1());
|
|
2352
|
+
/**
|
|
2353
|
+
* @internal
|
|
2354
|
+
*/
|
|
2355
|
+
function assertQuery() {
|
|
2356
|
+
halt$6("assertQuery");
|
|
2357
|
+
}
|
|
2358
|
+
const assertQueryPure = /** @__PURE__ */ Object.assign(assertQuery,
|
|
2359
|
+
/** @__PURE__ */ query$1(),
|
|
2360
|
+
/** @__PURE__ */ assert$1("http.assertQuery"));
|
|
2361
|
+
/**
|
|
2362
|
+
* @internal
|
|
2363
|
+
*/
|
|
2364
|
+
function isQuery() {
|
|
2365
|
+
halt$6("isQuery");
|
|
2366
|
+
}
|
|
2367
|
+
const isQueryPure = /** @__PURE__ */ Object.assign(isQuery,
|
|
2368
|
+
/** @__PURE__ */ query$1(),
|
|
2369
|
+
/** @__PURE__ */ is$1());
|
|
2370
|
+
/**
|
|
2371
|
+
* @internal
|
|
2372
|
+
*/
|
|
2373
|
+
function validateQuery() {
|
|
2374
|
+
halt$6("validateQuery");
|
|
2375
|
+
}
|
|
2376
|
+
const validateQueryPure = /** @__PURE__ */ Object.assign(validateQuery,
|
|
2377
|
+
/** @__PURE__ */ query$1(),
|
|
2378
|
+
/** @__PURE__ */ validate$1());
|
|
2379
|
+
/**
|
|
2380
|
+
* @internal
|
|
2381
|
+
*/
|
|
2382
|
+
function headers() {
|
|
2383
|
+
halt$6("headers");
|
|
2384
|
+
}
|
|
2385
|
+
const headersPure = /** @__PURE__ */ Object.assign(headers,
|
|
2386
|
+
/** @__PURE__ */ headers$1());
|
|
2387
|
+
/**
|
|
2388
|
+
* @internal
|
|
2389
|
+
*/
|
|
2390
|
+
function assertHeaders() {
|
|
2391
|
+
halt$6("assertHeaders");
|
|
2392
|
+
}
|
|
2393
|
+
const assertHeadersPure = /** @__PURE__ */ Object.assign(assertHeaders,
|
|
2394
|
+
/** @__PURE__ */ headers$1(),
|
|
2395
|
+
/** @__PURE__ */ assert$1("http.assertHeaders"));
|
|
2396
|
+
/**
|
|
2397
|
+
* @internal
|
|
2398
|
+
*/
|
|
2399
|
+
function isHeaders() {
|
|
2400
|
+
halt$6("isHeaders");
|
|
2401
|
+
}
|
|
2402
|
+
const isHeadersPure = /** @__PURE__ */ Object.assign(isHeaders,
|
|
2403
|
+
/** @__PURE__ */ headers$1(),
|
|
2404
|
+
/** @__PURE__ */ is$1());
|
|
2405
|
+
/**
|
|
2406
|
+
* @internal
|
|
2407
|
+
*/
|
|
2408
|
+
function validateHeaders() {
|
|
2409
|
+
halt$6("validateHeaders");
|
|
2410
|
+
}
|
|
2411
|
+
const validateHeadersPure = /** @__PURE__ */ Object.assign(validateHeaders,
|
|
2412
|
+
/** @__PURE__ */ headers$1(),
|
|
2413
|
+
/** @__PURE__ */ validate$1());
|
|
2414
|
+
/**
|
|
2415
|
+
* @internal
|
|
2416
|
+
*/
|
|
2417
|
+
function parameter() {
|
|
2418
|
+
halt$6("parameter");
|
|
2419
|
+
}
|
|
2420
|
+
const parameterPure = /** @__PURE__ */ Object.assign(parameter,
|
|
2421
|
+
/** @__PURE__ */ parameter$1(),
|
|
2422
|
+
/** @__PURE__ */ assert$1("http.parameter"));
|
|
2423
|
+
/**
|
|
2424
|
+
* @internal
|
|
2425
|
+
*/
|
|
2426
|
+
function createFormData() {
|
|
2427
|
+
halt$6("createFormData");
|
|
2428
|
+
}
|
|
2429
|
+
const createFormDataPure = /** @__PURE__ */ Object.assign(createFormData, /** @__PURE__ */ formData$1());
|
|
2430
|
+
/**
|
|
2431
|
+
* @internal
|
|
2432
|
+
*/
|
|
2433
|
+
function createAssertFormData() {
|
|
2434
|
+
halt$6("createAssertFormData");
|
|
2435
|
+
}
|
|
2436
|
+
const createAssertFormDataPure = /** @__PURE__ */ Object.assign(createAssertFormData,
|
|
2437
|
+
/** @__PURE__ */ formData$1(),
|
|
2438
|
+
/** @__PURE__ */ assert$1("http.createAssertFormData"));
|
|
2439
|
+
/**
|
|
2440
|
+
* @internal
|
|
2441
|
+
*/
|
|
2442
|
+
function createIsFormData() {
|
|
2443
|
+
halt$6("createIsFormData");
|
|
2444
|
+
}
|
|
2445
|
+
const createIsFormDataPure = /** @__PURE__ */ Object.assign(createIsFormData,
|
|
2446
|
+
/** @__PURE__ */ formData$1(),
|
|
2447
|
+
/** @__PURE__ */ is$1());
|
|
2448
|
+
/**
|
|
2449
|
+
* @internal
|
|
2450
|
+
*/
|
|
2451
|
+
function createValidateFormData() {
|
|
2452
|
+
halt$6("createValidateFormData");
|
|
2453
|
+
}
|
|
2454
|
+
const createValidateFormDataPure = /** @__PURE__ */ Object.assign(createValidateFormData,
|
|
2455
|
+
/** @__PURE__ */ formData$1(),
|
|
2456
|
+
/** @__PURE__ */ validate$1());
|
|
2457
|
+
/**
|
|
2458
|
+
* @internal
|
|
2459
|
+
*/
|
|
2460
|
+
function createQuery() {
|
|
2461
|
+
halt$6("createQuery");
|
|
2462
|
+
}
|
|
2463
|
+
const createQueryPure = /** @__PURE__ */ Object.assign(createQuery,
|
|
2464
|
+
/** @__PURE__ */ query$1());
|
|
2465
|
+
/**
|
|
2466
|
+
* @internal
|
|
2467
|
+
*/
|
|
2468
|
+
function createAssertQuery() {
|
|
2469
|
+
halt$6("createAssertQuery");
|
|
2470
|
+
}
|
|
2471
|
+
const createAssertQueryPure = /** @__PURE__ */ Object.assign(createAssertQuery,
|
|
2472
|
+
/** @__PURE__ */ query$1(),
|
|
2473
|
+
/** @__PURE__ */ assert$1("http.createAssertQuery"));
|
|
2474
|
+
/**
|
|
2475
|
+
* @internal
|
|
2476
|
+
*/
|
|
2477
|
+
function createIsQuery() {
|
|
2478
|
+
halt$6("createIsQuery");
|
|
2479
|
+
}
|
|
2480
|
+
const createIsQueryPure = /** @__PURE__ */ Object.assign(createIsQuery,
|
|
2481
|
+
/** @__PURE__ */ query$1(),
|
|
2482
|
+
/** @__PURE__ */ is$1());
|
|
2483
|
+
/**
|
|
2484
|
+
* @internal
|
|
2485
|
+
*/
|
|
2486
|
+
function createValidateQuery() {
|
|
2487
|
+
halt$6("createValidateQuery");
|
|
2488
|
+
}
|
|
2489
|
+
const createValidateQueryPure = /** @__PURE__ */ Object.assign(createValidateQuery,
|
|
2490
|
+
/** @__PURE__ */ query$1(),
|
|
2491
|
+
/** @__PURE__ */ validate$1());
|
|
2492
|
+
/**
|
|
2493
|
+
* @internal
|
|
2494
|
+
*/
|
|
2495
|
+
function createHeaders() {
|
|
2496
|
+
halt$6("createHeaders");
|
|
2497
|
+
}
|
|
2498
|
+
const createHeadersPure = /** @__PURE__ */ Object.assign(createHeaders, /** @__PURE__ */ headers$1());
|
|
2499
|
+
/**
|
|
2500
|
+
* @internal
|
|
2501
|
+
*/
|
|
2502
|
+
function createAssertHeaders() {
|
|
2503
|
+
halt$6("createAssertHeaders");
|
|
2504
|
+
}
|
|
2505
|
+
const createAssertHeadersPure = /** @__PURE__ */ Object.assign(createAssertHeaders,
|
|
2506
|
+
/** @__PURE__ */ headers$1(),
|
|
2507
|
+
/** @__PURE__ */ assert$1("http.createAssertHeaders"));
|
|
2508
|
+
/**
|
|
2509
|
+
* @internal
|
|
2510
|
+
*/
|
|
2511
|
+
function createIsHeaders() {
|
|
2512
|
+
halt$6("createIsHeaders");
|
|
2513
|
+
}
|
|
2514
|
+
const createIsHeadersPure = /** @__PURE__ */ Object.assign(createIsHeaders,
|
|
2515
|
+
/** @__PURE__ */ headers$1(),
|
|
2516
|
+
/** @__PURE__ */ is$1());
|
|
2517
|
+
/**
|
|
2518
|
+
* @internal
|
|
2519
|
+
*/
|
|
2520
|
+
function createValidateHeaders() {
|
|
2521
|
+
halt$6("createValidateHeaders");
|
|
2522
|
+
}
|
|
2523
|
+
const createValidateHeadersPure = /** @__PURE__ */ Object.assign(createValidateHeaders,
|
|
2524
|
+
/** @__PURE__ */ headers$1(),
|
|
2525
|
+
/** @__PURE__ */ validate$1());
|
|
2526
|
+
/**
|
|
2527
|
+
* @internal
|
|
2528
|
+
*/
|
|
2529
|
+
function createParameter() {
|
|
2530
|
+
halt$6("createParameter");
|
|
2531
|
+
}
|
|
2532
|
+
const createParameterPure = /** @__PURE__ */ Object.assign(createParameter,
|
|
2533
|
+
/** @__PURE__ */ parameter$1(),
|
|
2534
|
+
/** @__PURE__ */ assert$1("http.createParameter"));
|
|
2535
|
+
/**
|
|
2536
|
+
* @internal
|
|
2537
|
+
*/
|
|
2538
|
+
function halt$6(name) {
|
|
2539
|
+
throw new Error(`Error on typia.http.${name}(): no transform has been configured. Read and follow https://typia.io/docs/setup please.`);
|
|
2540
|
+
}
|
|
2541
|
+
|
|
2542
|
+
var http = /*#__PURE__*/Object.freeze({
|
|
2543
|
+
__proto__: null,
|
|
2544
|
+
assertFormData: assertFormDataPure,
|
|
2545
|
+
assertHeaders: assertHeadersPure,
|
|
2546
|
+
assertQuery: assertQueryPure,
|
|
2547
|
+
createAssertFormData: createAssertFormDataPure,
|
|
2548
|
+
createAssertHeaders: createAssertHeadersPure,
|
|
2549
|
+
createAssertQuery: createAssertQueryPure,
|
|
2550
|
+
createFormData: createFormDataPure,
|
|
2551
|
+
createHeaders: createHeadersPure,
|
|
2552
|
+
createIsFormData: createIsFormDataPure,
|
|
2553
|
+
createIsHeaders: createIsHeadersPure,
|
|
2554
|
+
createIsQuery: createIsQueryPure,
|
|
2555
|
+
createParameter: createParameterPure,
|
|
2556
|
+
createQuery: createQueryPure,
|
|
2557
|
+
createValidateFormData: createValidateFormDataPure,
|
|
2558
|
+
createValidateHeaders: createValidateHeadersPure,
|
|
2559
|
+
createValidateQuery: createValidateQueryPure,
|
|
2560
|
+
formData: formDataPure,
|
|
2561
|
+
headers: headersPure,
|
|
2562
|
+
isFormData: isFormDataPure,
|
|
2563
|
+
isHeaders: isHeadersPure,
|
|
2564
|
+
isQuery: isQueryPure,
|
|
2565
|
+
parameter: parameterPure,
|
|
2566
|
+
query: queryPure,
|
|
2567
|
+
validateFormData: validateFormDataPure,
|
|
2568
|
+
validateHeaders: validateHeadersPure,
|
|
2569
|
+
validateQuery: validateQueryPure
|
|
2570
|
+
});
|
|
2571
|
+
|
|
2572
|
+
/**
|
|
2573
|
+
* @internal
|
|
2574
|
+
*/
|
|
2575
|
+
function application() {
|
|
2576
|
+
halt$5("application");
|
|
2577
|
+
}
|
|
2578
|
+
/**
|
|
2579
|
+
* @internal
|
|
2580
|
+
*/
|
|
2581
|
+
function assertParse() {
|
|
2582
|
+
halt$5("assertParse");
|
|
2583
|
+
}
|
|
2584
|
+
const assertParsePure = /** @__PURE__ */ Object.assign(assertParse,
|
|
2585
|
+
/** @__PURE__ */ assert$1("json.assertParse"));
|
|
2586
|
+
/**
|
|
2587
|
+
* @internal
|
|
2588
|
+
*/
|
|
2589
|
+
function isParse() {
|
|
2590
|
+
halt$5("isParse");
|
|
2591
|
+
}
|
|
2592
|
+
const isParsePure = /** @__PURE__ */ Object.assign(isParse,
|
|
2593
|
+
/** @__PURE__ */ is$1());
|
|
2594
|
+
/**
|
|
2595
|
+
* @internal
|
|
2596
|
+
*/
|
|
2597
|
+
function validateParse() {
|
|
2598
|
+
halt$5("validateParse");
|
|
2599
|
+
}
|
|
2600
|
+
const validateParsePure = /** @__PURE__ */ Object.assign(validateParse, /** @__PURE__ */ validate$1());
|
|
2601
|
+
/**
|
|
2602
|
+
* @internal
|
|
2603
|
+
*/
|
|
2604
|
+
function stringify() {
|
|
2605
|
+
halt$5("stringify");
|
|
2606
|
+
}
|
|
2607
|
+
const stringifyPure = /** @__PURE__ */ Object.assign(stringify,
|
|
2608
|
+
/** @__PURE__ */ stringify$1("stringify"));
|
|
2609
|
+
/**
|
|
2610
|
+
* @internal
|
|
2611
|
+
*/
|
|
2612
|
+
function assertStringify() {
|
|
2613
|
+
halt$5("assertStringify");
|
|
2614
|
+
}
|
|
2615
|
+
const assertStringifyPure = /** @__PURE__ */ Object.assign(assertStringify,
|
|
2616
|
+
/** @__PURE__ */ assert$1("json.assertStringify"),
|
|
2617
|
+
/** @__PURE__ */ stringify$1("assertStringify"));
|
|
2618
|
+
/**
|
|
2619
|
+
* @internal
|
|
2620
|
+
*/
|
|
2621
|
+
function isStringify() {
|
|
2622
|
+
halt$5("isStringify");
|
|
2623
|
+
}
|
|
2624
|
+
const isStringifyPure = /** @__PURE__ */ Object.assign(isStringify,
|
|
2625
|
+
/** @__PURE__ */ is$1(),
|
|
2626
|
+
/** @__PURE__ */ stringify$1("isStringify"));
|
|
2627
|
+
/**
|
|
2628
|
+
* @internal
|
|
2629
|
+
*/
|
|
2630
|
+
function validateStringify() {
|
|
2631
|
+
halt$5("validateStringify");
|
|
2632
|
+
}
|
|
2633
|
+
const validateStringifyPure = /** @__PURE__ */ Object.assign(validateStringify,
|
|
2634
|
+
/** @__PURE__ */ validate$1(),
|
|
2635
|
+
/** @__PURE__ */ stringify$1("validateStringify"));
|
|
2636
|
+
/**
|
|
2637
|
+
* @internal
|
|
2638
|
+
*/
|
|
2639
|
+
function createIsParse() {
|
|
2640
|
+
halt$5("createIsParse");
|
|
2641
|
+
}
|
|
2642
|
+
const createIsParsePure = /** @__PURE__ */ Object.assign(createIsParse, isParsePure);
|
|
2643
|
+
/**
|
|
2644
|
+
* @internal
|
|
2645
|
+
*/
|
|
2646
|
+
function createAssertParse() {
|
|
2647
|
+
halt$5("createAssertParse");
|
|
2648
|
+
}
|
|
2649
|
+
const createAssertParsePure = /** @__PURE__ */ Object.assign(createAssertParse, assertParsePure);
|
|
2650
|
+
/**
|
|
2651
|
+
* @internal
|
|
2652
|
+
*/
|
|
2653
|
+
function createValidateParse() {
|
|
2654
|
+
halt$5("createValidateParse");
|
|
2655
|
+
}
|
|
2656
|
+
const createValidateParsePure = /** @__PURE__ */ Object.assign(createValidateParse, validateParsePure);
|
|
2657
|
+
/**
|
|
2658
|
+
* @internal
|
|
2659
|
+
*/
|
|
2660
|
+
function createStringify() {
|
|
2661
|
+
halt$5("createStringify");
|
|
2662
|
+
}
|
|
2663
|
+
const createStringifyPure = /** @__PURE__ */ Object.assign(createStringify, stringifyPure);
|
|
2664
|
+
/**
|
|
2665
|
+
* @internal
|
|
2666
|
+
*/
|
|
2667
|
+
function createAssertStringify() {
|
|
2668
|
+
halt$5("createAssertStringify");
|
|
2669
|
+
}
|
|
2670
|
+
const createAssertStringifyPure = /** @__PURE__ */ Object.assign(createAssertStringify, assertStringifyPure);
|
|
2671
|
+
/**
|
|
2672
|
+
* @internal
|
|
2673
|
+
*/
|
|
2674
|
+
function createIsStringify() {
|
|
2675
|
+
halt$5("createIsStringify");
|
|
2676
|
+
}
|
|
2677
|
+
const createIsStringifyPure = /** @__PURE__ */ Object.assign(createIsStringify, isStringifyPure);
|
|
2678
|
+
/**
|
|
2679
|
+
* @internal
|
|
2680
|
+
*/
|
|
2681
|
+
function createValidateStringify() {
|
|
2682
|
+
halt$5("createValidateStringify");
|
|
2683
|
+
}
|
|
2684
|
+
const createValidateStringifyPure = /** @__PURE__ */ Object.assign(createValidateStringify, validateStringifyPure);
|
|
2685
|
+
/**
|
|
2686
|
+
* @internal
|
|
2687
|
+
*/
|
|
2688
|
+
function halt$5(name) {
|
|
2689
|
+
throw new Error(`Error on typia.json.${name}(): no transform has been configured. Read and follow https://typia.io/docs/setup please.`);
|
|
2690
|
+
}
|
|
2691
|
+
|
|
2692
|
+
var json = /*#__PURE__*/Object.freeze({
|
|
2693
|
+
__proto__: null,
|
|
2694
|
+
application: application,
|
|
2695
|
+
assertParse: assertParsePure,
|
|
2696
|
+
assertStringify: assertStringifyPure,
|
|
2697
|
+
createAssertParse: createAssertParsePure,
|
|
2698
|
+
createAssertStringify: createAssertStringifyPure,
|
|
2699
|
+
createIsParse: createIsParsePure,
|
|
2700
|
+
createIsStringify: createIsStringifyPure,
|
|
2701
|
+
createStringify: createStringifyPure,
|
|
2702
|
+
createValidateParse: createValidateParsePure,
|
|
2703
|
+
createValidateStringify: createValidateStringifyPure,
|
|
2704
|
+
isParse: isParsePure,
|
|
2705
|
+
isStringify: isStringifyPure,
|
|
2706
|
+
stringify: stringifyPure,
|
|
2707
|
+
validateParse: validateParsePure,
|
|
2708
|
+
validateStringify: validateStringifyPure
|
|
2709
|
+
});
|
|
2710
|
+
|
|
2711
|
+
/* ===========================================================
|
|
2712
|
+
MISCELLAENOUS
|
|
2713
|
+
- LITERALS
|
|
2714
|
+
- CLONE
|
|
2715
|
+
- PRUNE
|
|
2716
|
+
- FACTORY FUNCTIONS
|
|
2717
|
+
==============================================================
|
|
2718
|
+
LITERALS
|
|
2719
|
+
----------------------------------------------------------- */
|
|
2720
|
+
/**
|
|
2721
|
+
* @internal
|
|
2722
|
+
*/
|
|
2723
|
+
function literals() {
|
|
2724
|
+
halt$4("literals");
|
|
2725
|
+
}
|
|
2726
|
+
/**
|
|
2727
|
+
* @internal
|
|
2728
|
+
*/
|
|
2729
|
+
function clone() {
|
|
2730
|
+
halt$4("clone");
|
|
2731
|
+
}
|
|
2732
|
+
const clonePure = /** @__PURE__ */ Object.assign(clone,
|
|
2733
|
+
/** @__PURE__ */ clone$1("clone"));
|
|
2734
|
+
/**
|
|
2735
|
+
* @internal
|
|
2736
|
+
*/
|
|
2737
|
+
function assertClone() {
|
|
2738
|
+
halt$4("assertClone");
|
|
2739
|
+
}
|
|
2740
|
+
const assertClonePure = /** @__PURE__ */ Object.assign(assertClone,
|
|
2741
|
+
/** @__PURE__ */ assert$1("misc.assertClone"),
|
|
2742
|
+
/** @__PURE__ */ clone$1("assertClone"));
|
|
2743
|
+
/**
|
|
2744
|
+
* @internal
|
|
2745
|
+
*/
|
|
2746
|
+
function isClone() {
|
|
2747
|
+
halt$4("isClone");
|
|
2748
|
+
}
|
|
2749
|
+
const isClonePure = /** @__PURE__ */ Object.assign(isClone,
|
|
2750
|
+
/** @__PURE__ */ is$1(),
|
|
2751
|
+
/** @__PURE__ */ clone$1("isClone"));
|
|
2752
|
+
/**
|
|
2753
|
+
* @internal
|
|
2754
|
+
*/
|
|
2755
|
+
function validateClone() {
|
|
2756
|
+
halt$4("validateClone");
|
|
2757
|
+
}
|
|
2758
|
+
const validateClonePure = /** @__PURE__ */ Object.assign(validateClone,
|
|
2759
|
+
/** @__PURE__ */ validate$1(),
|
|
2760
|
+
/** @__PURE__ */ clone$1("validateClone"));
|
|
2761
|
+
/**
|
|
2762
|
+
* @internal
|
|
2763
|
+
*/
|
|
2764
|
+
function prune() {
|
|
2765
|
+
halt$4("prune");
|
|
2766
|
+
}
|
|
2767
|
+
const prunePure = /** @__PURE__ */ Object.assign(prune,
|
|
2768
|
+
/** @__PURE__ */ prune$1("prune"));
|
|
2769
|
+
/**
|
|
2770
|
+
* @internal
|
|
2771
|
+
*/
|
|
2772
|
+
function assertPrune() {
|
|
2773
|
+
halt$4("assertPrune");
|
|
2774
|
+
}
|
|
2775
|
+
const assertPrunePure = /** @__PURE__ */ Object.assign(assertPrune,
|
|
2776
|
+
/** @__PURE__ */ assert$1("misc.assertPrune"),
|
|
2777
|
+
/** @__PURE__ */ prune$1("assertPrune"));
|
|
2778
|
+
/**
|
|
2779
|
+
* @internal
|
|
2780
|
+
*/
|
|
2781
|
+
function isPrune() {
|
|
2782
|
+
halt$4("isPrune");
|
|
2783
|
+
}
|
|
2784
|
+
const isPrunePure = /** @__PURE__ */ Object.assign(isPrune,
|
|
2785
|
+
/** @__PURE__ */ is$1(),
|
|
2786
|
+
/** @__PURE__ */ prune$1("isPrune"));
|
|
2787
|
+
/**
|
|
2788
|
+
* @internal
|
|
2789
|
+
*/
|
|
2790
|
+
function validatePrune() {
|
|
2791
|
+
halt$4("validatePrune");
|
|
2792
|
+
}
|
|
2793
|
+
const validatePrunePure = /** @__PURE__ */ Object.assign(validatePrune,
|
|
2794
|
+
/** @__PURE__ */ prune$1("validatePrune"),
|
|
2795
|
+
/** @__PURE__ */ validate$1());
|
|
2796
|
+
/**
|
|
2797
|
+
* @internal
|
|
2798
|
+
*/
|
|
2799
|
+
function createClone() {
|
|
2800
|
+
halt$4("createClone");
|
|
2801
|
+
}
|
|
2802
|
+
const createClonePure = /** @__PURE__ */ Object.assign(createClone, clonePure);
|
|
2803
|
+
/**
|
|
2804
|
+
* @internal
|
|
2805
|
+
*/
|
|
2806
|
+
function createAssertClone() {
|
|
2807
|
+
halt$4("createAssertClone");
|
|
2808
|
+
}
|
|
2809
|
+
const createAssertClonePure = /** @__PURE__ */ Object.assign(createAssertClone, assertClonePure);
|
|
2810
|
+
/**
|
|
2811
|
+
* @internal
|
|
2812
|
+
*/
|
|
2813
|
+
function createIsClone() {
|
|
2814
|
+
halt$4("createIsClone");
|
|
2815
|
+
}
|
|
2816
|
+
const createIsClonePure = /** @__PURE__ */ Object.assign(createIsClone, isClonePure);
|
|
2817
|
+
/**
|
|
2818
|
+
* @internal
|
|
2819
|
+
*/
|
|
2820
|
+
function createValidateClone() {
|
|
2821
|
+
halt$4("createValidateClone");
|
|
2822
|
+
}
|
|
2823
|
+
const createValidateClonePure = /** @__PURE__ */ Object.assign(createValidateClone, validateClonePure);
|
|
2824
|
+
/**
|
|
2825
|
+
* @internal
|
|
2826
|
+
*/
|
|
2827
|
+
function createPrune() {
|
|
2828
|
+
halt$4("createPrune");
|
|
2829
|
+
}
|
|
2830
|
+
const createPrunePure = /** @__PURE__ */ Object.assign(createPrune, prunePure);
|
|
2831
|
+
/**
|
|
2832
|
+
* @internal
|
|
2833
|
+
*/
|
|
2834
|
+
function createAssertPrune() {
|
|
2835
|
+
halt$4("createAssertPrune");
|
|
2836
|
+
}
|
|
2837
|
+
const createAssertPrunePure = /** @__PURE__ */ Object.assign(createAssertPrune, assertPrunePure);
|
|
2838
|
+
/**
|
|
2839
|
+
* @internal
|
|
2840
|
+
*/
|
|
2841
|
+
function createIsPrune() {
|
|
2842
|
+
halt$4("createIsPrune");
|
|
2843
|
+
}
|
|
2844
|
+
const createIsPrunePure = /** @__PURE__ */ Object.assign(createIsPrune, isPrunePure);
|
|
2845
|
+
/**
|
|
2846
|
+
* @internal
|
|
2847
|
+
*/
|
|
2848
|
+
function createValidatePrune() {
|
|
2849
|
+
halt$4("createValidatePrune");
|
|
2850
|
+
}
|
|
2851
|
+
const createValidatePrunePure = /** @__PURE__ */ Object.assign(createValidatePrune, validatePrunePure);
|
|
2852
|
+
/**
|
|
2853
|
+
* @internal
|
|
2854
|
+
*/
|
|
2855
|
+
function halt$4(name) {
|
|
2856
|
+
throw new Error(`Error on typia.misc.${name}(): no transform has been configured. Read and follow https://typia.io/docs/setup please.`);
|
|
2857
|
+
}
|
|
2858
|
+
|
|
2859
|
+
var misc = /*#__PURE__*/Object.freeze({
|
|
2860
|
+
__proto__: null,
|
|
2861
|
+
assertClone: assertClonePure,
|
|
2862
|
+
assertPrune: assertPrunePure,
|
|
2863
|
+
clone: clonePure,
|
|
2864
|
+
createAssertClone: createAssertClonePure,
|
|
2865
|
+
createAssertPrune: createAssertPrunePure,
|
|
2866
|
+
createClone: createClonePure,
|
|
2867
|
+
createIsClone: createIsClonePure,
|
|
2868
|
+
createIsPrune: createIsPrunePure,
|
|
2869
|
+
createPrune: createPrunePure,
|
|
2870
|
+
createValidateClone: createValidateClonePure,
|
|
2871
|
+
createValidatePrune: createValidatePrunePure,
|
|
2872
|
+
isClone: isClonePure,
|
|
2873
|
+
isPrune: isPrunePure,
|
|
2874
|
+
literals: literals,
|
|
2875
|
+
prune: prunePure,
|
|
2876
|
+
validateClone: validateClonePure,
|
|
2877
|
+
validatePrune: validatePrunePure
|
|
2878
|
+
});
|
|
2879
|
+
|
|
2880
|
+
/**
|
|
2881
|
+
* @internal
|
|
2882
|
+
*/
|
|
2883
|
+
function camel() {
|
|
2884
|
+
return halt$3("camel");
|
|
2885
|
+
}
|
|
2886
|
+
const camelPure = /** @__PURE__ */ Object.assign(camel,
|
|
2887
|
+
/** @__PURE__ */ camel$1("camel"));
|
|
2888
|
+
/**
|
|
2889
|
+
* @internal
|
|
2890
|
+
*/
|
|
2891
|
+
function assertCamel() {
|
|
2892
|
+
return halt$3("assertCamel");
|
|
2893
|
+
}
|
|
2894
|
+
const assertCamelPure = /** @__PURE__ */ Object.assign(assertCamel,
|
|
2895
|
+
/** @__PURE__ */ camel$1("assertCamel"),
|
|
2896
|
+
/** @__PURE__ */ assert$1("notations.assertCamel"));
|
|
2897
|
+
/**
|
|
2898
|
+
* @internal
|
|
2899
|
+
*/
|
|
2900
|
+
function isCamel() {
|
|
2901
|
+
return halt$3("isCamel");
|
|
2902
|
+
}
|
|
2903
|
+
const isCamelPure = /** @__PURE__ */ Object.assign(isCamel,
|
|
2904
|
+
/** @__PURE__ */ camel$1("isCamel"),
|
|
2905
|
+
/** @__PURE__ */ is$1());
|
|
2906
|
+
/**
|
|
2907
|
+
* @internal
|
|
2908
|
+
*/
|
|
2909
|
+
function validateCamel() {
|
|
2910
|
+
return halt$3("validateCamel");
|
|
2911
|
+
}
|
|
2912
|
+
const validateCamelPure = /** @__PURE__ */ Object.assign(validateCamel,
|
|
2913
|
+
/** @__PURE__ */ camel$1("validateCamel"),
|
|
2914
|
+
/** @__PURE__ */ validate$1());
|
|
2915
|
+
/**
|
|
2916
|
+
* @internal
|
|
2917
|
+
*/
|
|
2918
|
+
function pascal() {
|
|
2919
|
+
return halt$3("pascal");
|
|
2920
|
+
}
|
|
2921
|
+
const pascalPure = /** @__PURE__ */ Object.assign(pascal,
|
|
2922
|
+
/** @__PURE__ */ pascal$1("pascal"));
|
|
2923
|
+
/**
|
|
2924
|
+
* @internal
|
|
2925
|
+
*/
|
|
2926
|
+
function assertPascal() {
|
|
2927
|
+
return halt$3("assertPascal");
|
|
2928
|
+
}
|
|
2929
|
+
const assertPascalPure = /** @__PURE__ */ Object.assign(assertPascal,
|
|
2930
|
+
/** @__PURE__ */ pascal$1("assertPascal"),
|
|
2931
|
+
/** @__PURE__ */ assert$1("notations.assertPascal"));
|
|
2932
|
+
/**
|
|
2933
|
+
* @internal
|
|
2934
|
+
*/
|
|
2935
|
+
function isPascal() {
|
|
2936
|
+
return halt$3("isPascal");
|
|
2937
|
+
}
|
|
2938
|
+
const isPascalPure = /** @__PURE__ */ Object.assign(isPascal,
|
|
2939
|
+
/** @__PURE__ */ pascal$1("isPascal"),
|
|
2940
|
+
/** @__PURE__ */ is$1());
|
|
2941
|
+
/**
|
|
2942
|
+
* @internal
|
|
2943
|
+
*/
|
|
2944
|
+
function validatePascal() {
|
|
2945
|
+
return halt$3("validatePascal");
|
|
2946
|
+
}
|
|
2947
|
+
const validatePascalPure = /** @__PURE__ */ Object.assign(validatePascal,
|
|
2948
|
+
/** @__PURE__ */ pascal$1("validatePascal"),
|
|
2949
|
+
/** @__PURE__ */ validate$1());
|
|
2950
|
+
/**
|
|
2951
|
+
* @internal
|
|
2952
|
+
*/
|
|
2953
|
+
function snake() {
|
|
2954
|
+
return halt$3("snake");
|
|
2955
|
+
}
|
|
2956
|
+
const snakePure = /** @__PURE__ */ Object.assign(snake,
|
|
2957
|
+
/** @__PURE__ */ snake$1("snake"));
|
|
2958
|
+
/**
|
|
2959
|
+
* @internal
|
|
2960
|
+
*/
|
|
2961
|
+
function assertSnake() {
|
|
2962
|
+
return halt$3("assertSnake");
|
|
2963
|
+
}
|
|
2964
|
+
const assertSnakePure = /** @__PURE__ */ Object.assign(assertSnake,
|
|
2965
|
+
/** @__PURE__ */ snake$1("assertSnake"),
|
|
2966
|
+
/** @__PURE__ */ assert$1("notations.assertSnake"));
|
|
2967
|
+
/**
|
|
2968
|
+
* @internal
|
|
2969
|
+
*/
|
|
2970
|
+
function isSnake() {
|
|
2971
|
+
return halt$3("isSnake");
|
|
2972
|
+
}
|
|
2973
|
+
const isSnakePure = /** @__PURE__ */ Object.assign(isSnake,
|
|
2974
|
+
/** @__PURE__ */ snake$1("isSnake"),
|
|
2975
|
+
/** @__PURE__ */ is$1());
|
|
2976
|
+
/**
|
|
2977
|
+
* @internal
|
|
2978
|
+
*/
|
|
2979
|
+
function validateSnake() {
|
|
2980
|
+
return halt$3("validateSnake");
|
|
2981
|
+
}
|
|
2982
|
+
const validateSnakePure = /** @__PURE__ */ Object.assign(validateSnake,
|
|
2983
|
+
/** @__PURE__ */ snake$1("validateSnake"),
|
|
2984
|
+
/** @__PURE__ */ validate$1());
|
|
2985
|
+
/**
|
|
2986
|
+
* @internal
|
|
2987
|
+
*/
|
|
2988
|
+
function createCamel() {
|
|
2989
|
+
halt$3("createCamel");
|
|
2990
|
+
}
|
|
2991
|
+
const createCamelPure = /** @__PURE__ */ Object.assign(createCamel,
|
|
2992
|
+
/** @__PURE__ */ camel$1("createCamel"));
|
|
2993
|
+
/**
|
|
2994
|
+
* @internal
|
|
2995
|
+
*/
|
|
2996
|
+
function createAssertCamel() {
|
|
2997
|
+
halt$3("createAssertCamel");
|
|
2998
|
+
}
|
|
2999
|
+
const createAssertCamelPure = /** @__PURE__ */ Object.assign(createAssertCamel,
|
|
3000
|
+
/** @__PURE__ */ camel$1("createAssertCamel"),
|
|
3001
|
+
/** @__PURE__ */ assert$1("notations.createAssertCamel"));
|
|
3002
|
+
/**
|
|
3003
|
+
* @internal
|
|
3004
|
+
*/
|
|
3005
|
+
function createIsCamel() {
|
|
3006
|
+
halt$3("createIsCamel");
|
|
3007
|
+
}
|
|
3008
|
+
const createIsCamelPure = /** @__PURE__ */ Object.assign(createIsCamel,
|
|
3009
|
+
/** @__PURE__ */ camel$1("createIsCamel"),
|
|
3010
|
+
/** @__PURE__ */ is$1());
|
|
3011
|
+
/**
|
|
3012
|
+
* @internal
|
|
3013
|
+
*/
|
|
3014
|
+
function createValidateCamel() {
|
|
3015
|
+
halt$3("createValidateCamel");
|
|
3016
|
+
}
|
|
3017
|
+
const createValidateCamelPure = /** @__PURE__ */ Object.assign(createValidateCamel,
|
|
3018
|
+
/** @__PURE__ */ camel$1("createValidateCamel"),
|
|
3019
|
+
/** @__PURE__ */ validate$1());
|
|
3020
|
+
/**
|
|
3021
|
+
* @internal
|
|
3022
|
+
*/
|
|
3023
|
+
function createPascal() {
|
|
3024
|
+
halt$3("createPascal");
|
|
3025
|
+
}
|
|
3026
|
+
const createPascalPure = /** @__PURE__ */ Object.assign(createPascal, /** @__PURE__ */ pascal$1("createPascal"));
|
|
3027
|
+
/**
|
|
3028
|
+
* @internal
|
|
3029
|
+
*/
|
|
3030
|
+
function createAssertPascal() {
|
|
3031
|
+
halt$3("createAssertPascal");
|
|
3032
|
+
}
|
|
3033
|
+
const createAssertPascalPure = /** @__PURE__ */ Object.assign(createAssertPascal,
|
|
3034
|
+
/** @__PURE__ */ pascal$1("createAssertPascal"),
|
|
3035
|
+
/** @__PURE__ */ assert$1("notations.createAssertPascal"));
|
|
3036
|
+
/**
|
|
3037
|
+
* @internal
|
|
3038
|
+
*/
|
|
3039
|
+
function createIsPascal() {
|
|
3040
|
+
halt$3("createIsPascal");
|
|
3041
|
+
}
|
|
3042
|
+
const createIsPascalPure = /** @__PURE__ */ Object.assign(createIsPascal,
|
|
3043
|
+
/** @__PURE__ */ pascal$1("createIsPascal"),
|
|
3044
|
+
/** @__PURE__ */ is$1());
|
|
3045
|
+
/**
|
|
3046
|
+
* @internal
|
|
3047
|
+
*/
|
|
3048
|
+
function createValidatePascal() {
|
|
3049
|
+
halt$3("createValidatePascal");
|
|
3050
|
+
}
|
|
3051
|
+
const createValidatePascalPure = /** @__PURE__ */ Object.assign(createValidatePascal,
|
|
3052
|
+
/** @__PURE__ */ pascal$1("createValidatePascal"),
|
|
3053
|
+
/** @__PURE__ */ validate$1());
|
|
3054
|
+
/**
|
|
3055
|
+
* @internal
|
|
3056
|
+
*/
|
|
3057
|
+
function createSnake() {
|
|
3058
|
+
halt$3("createSnake");
|
|
3059
|
+
}
|
|
3060
|
+
const createSnakePure = /** @__PURE__ */ Object.assign(createSnake,
|
|
3061
|
+
/** @__PURE__ */ snake$1("createSnake"));
|
|
3062
|
+
/**
|
|
3063
|
+
* @internal
|
|
3064
|
+
*/
|
|
3065
|
+
function createAssertSnake() {
|
|
3066
|
+
halt$3("createAssertSnake");
|
|
3067
|
+
}
|
|
3068
|
+
const createAssertSnakePure = /** @__PURE__ */ Object.assign(createAssertSnake,
|
|
3069
|
+
/** @__PURE__ */ snake$1("createAssertSnake"),
|
|
3070
|
+
/** @__PURE__ */ assert$1("notations.createAssertSnake"));
|
|
3071
|
+
/**
|
|
3072
|
+
* @internal
|
|
3073
|
+
*/
|
|
3074
|
+
function createIsSnake() {
|
|
3075
|
+
halt$3("createIsSnake");
|
|
3076
|
+
}
|
|
3077
|
+
const createIsSnakePure = /** @__PURE__ */ Object.assign(createIsSnake,
|
|
3078
|
+
/** @__PURE__ */ snake$1("createIsSnake"),
|
|
3079
|
+
/** @__PURE__ */ is$1());
|
|
3080
|
+
/**
|
|
3081
|
+
* @internal
|
|
3082
|
+
*/
|
|
3083
|
+
function createValidateSnake() {
|
|
3084
|
+
halt$3("createValidateSnake");
|
|
3085
|
+
}
|
|
3086
|
+
const createValidateSnakePure = /** @__PURE__ */ Object.assign(createValidateSnake,
|
|
3087
|
+
/** @__PURE__ */ snake$1("createValidateSnake"),
|
|
3088
|
+
/** @__PURE__ */ validate$1());
|
|
3089
|
+
/**
|
|
3090
|
+
* @internal
|
|
3091
|
+
*/
|
|
3092
|
+
function halt$3(name) {
|
|
3093
|
+
throw new Error(`Error on typia.notations.${name}(): no transform has been configured. Read and follow https://typia.io/docs/setup please.`);
|
|
3094
|
+
}
|
|
3095
|
+
|
|
3096
|
+
var notations = /*#__PURE__*/Object.freeze({
|
|
3097
|
+
__proto__: null,
|
|
3098
|
+
assertCamel: assertCamelPure,
|
|
3099
|
+
assertPascal: assertPascalPure,
|
|
3100
|
+
assertSnake: assertSnakePure,
|
|
3101
|
+
camel: camelPure,
|
|
3102
|
+
createAssertCamel: createAssertCamelPure,
|
|
3103
|
+
createAssertPascal: createAssertPascalPure,
|
|
3104
|
+
createAssertSnake: createAssertSnakePure,
|
|
3105
|
+
createCamel: createCamelPure,
|
|
3106
|
+
createIsCamel: createIsCamelPure,
|
|
3107
|
+
createIsPascal: createIsPascalPure,
|
|
3108
|
+
createIsSnake: createIsSnakePure,
|
|
3109
|
+
createPascal: createPascalPure,
|
|
3110
|
+
createSnake: createSnakePure,
|
|
3111
|
+
createValidateCamel: createValidateCamelPure,
|
|
3112
|
+
createValidatePascal: createValidatePascalPure,
|
|
3113
|
+
createValidateSnake: createValidateSnakePure,
|
|
3114
|
+
isCamel: isCamelPure,
|
|
3115
|
+
isPascal: isPascalPure,
|
|
3116
|
+
isSnake: isSnakePure,
|
|
3117
|
+
pascal: pascalPure,
|
|
3118
|
+
snake: snakePure,
|
|
3119
|
+
validateCamel: validateCamelPure,
|
|
3120
|
+
validatePascal: validatePascalPure,
|
|
3121
|
+
validateSnake: validateSnakePure
|
|
3122
|
+
});
|
|
3123
|
+
|
|
3124
|
+
/**
|
|
3125
|
+
* @internal
|
|
3126
|
+
*/
|
|
3127
|
+
function message() {
|
|
3128
|
+
halt$2("message");
|
|
3129
|
+
}
|
|
3130
|
+
/**
|
|
3131
|
+
* @internal
|
|
3132
|
+
*/
|
|
3133
|
+
function decode() {
|
|
3134
|
+
halt$2("decode");
|
|
3135
|
+
}
|
|
3136
|
+
const decodePure = /** @__PURE__ */ Object.assign(decode,
|
|
3137
|
+
/** @__PURE__ */ decode$1("decode"));
|
|
3138
|
+
/**
|
|
3139
|
+
* @internal
|
|
3140
|
+
*/
|
|
3141
|
+
function assertDecode() {
|
|
3142
|
+
halt$2("assertDecode");
|
|
3143
|
+
}
|
|
3144
|
+
const assertDecodePure = /** @__PURE__ */ Object.assign(assertDecode,
|
|
3145
|
+
/** @__PURE__ */ assert$1("protobuf.assertDecode"),
|
|
3146
|
+
/** @__PURE__ */ decode$1("assertDecode"));
|
|
3147
|
+
/**
|
|
3148
|
+
* @internal
|
|
3149
|
+
*/
|
|
3150
|
+
function isDecode() {
|
|
3151
|
+
halt$2("isDecode");
|
|
3152
|
+
}
|
|
3153
|
+
const isDecodePure = /** @__PURE__ */ Object.assign(isDecode,
|
|
3154
|
+
/** @__PURE__ */ is$1(),
|
|
3155
|
+
/** @__PURE__ */ decode$1("isDecode"));
|
|
3156
|
+
/**
|
|
3157
|
+
* @internal
|
|
3158
|
+
*/
|
|
3159
|
+
function validateDecode() {
|
|
3160
|
+
halt$2("validateDecode");
|
|
3161
|
+
}
|
|
3162
|
+
const validateDecodePure = /** @__PURE__ */ Object.assign(validateDecode,
|
|
3163
|
+
/** @__PURE__ */ validate$1(),
|
|
3164
|
+
/** @__PURE__ */ decode$1("validateDecode"));
|
|
3165
|
+
/**
|
|
3166
|
+
* @internal
|
|
3167
|
+
*/
|
|
3168
|
+
function encode() {
|
|
3169
|
+
halt$2("encode");
|
|
3170
|
+
}
|
|
3171
|
+
const encodePure = /** @__PURE__ */ Object.assign(encode,
|
|
3172
|
+
/** @__PURE__ */ encode$1("encode"));
|
|
3173
|
+
/**
|
|
3174
|
+
* @internal
|
|
3175
|
+
*/
|
|
3176
|
+
function assertEncode() {
|
|
3177
|
+
halt$2("assertEncode");
|
|
3178
|
+
}
|
|
3179
|
+
const assertEncodePure = /** @__PURE__ */ Object.assign(assertEncode,
|
|
3180
|
+
/** @__PURE__ */ assert$1("protobuf.assertEncode"),
|
|
3181
|
+
/** @__PURE__ */ encode$1("assertEncode"));
|
|
3182
|
+
/**
|
|
3183
|
+
* @internal
|
|
3184
|
+
*/
|
|
3185
|
+
function isEncode() {
|
|
3186
|
+
halt$2("isEncode");
|
|
3187
|
+
}
|
|
3188
|
+
const isEncodePure = /** @__PURE__ */ Object.assign(isEncode,
|
|
3189
|
+
/** @__PURE__ */ is$1(),
|
|
3190
|
+
/** @__PURE__ */ encode$1("isEncode"));
|
|
3191
|
+
/**
|
|
3192
|
+
* @internal
|
|
3193
|
+
*/
|
|
3194
|
+
function validateEncode() {
|
|
3195
|
+
halt$2("validateEncode");
|
|
3196
|
+
}
|
|
3197
|
+
const validateEncodePure = /** @__PURE__ */ Object.assign(validateEncode,
|
|
3198
|
+
/** @__PURE__ */ validate$1(),
|
|
3199
|
+
/** @__PURE__ */ encode$1("validateEncode"));
|
|
3200
|
+
/**
|
|
3201
|
+
* @internal
|
|
3202
|
+
*/
|
|
3203
|
+
function createDecode() {
|
|
3204
|
+
halt$2("createDecode");
|
|
3205
|
+
}
|
|
3206
|
+
const createDecodePure = /** @__PURE__ */ Object.assign(createDecode, /** @__PURE__ */ decode$1("createDecode"));
|
|
3207
|
+
/**
|
|
3208
|
+
* @internal
|
|
3209
|
+
*/
|
|
3210
|
+
function createIsDecode() {
|
|
3211
|
+
halt$2("createIsDecode");
|
|
3212
|
+
}
|
|
3213
|
+
const createIsDecodePure = /** @__PURE__ */ Object.assign(createIsDecode,
|
|
3214
|
+
/** @__PURE__ */ is$1(),
|
|
3215
|
+
/** @__PURE__ */ decode$1("createIsDecode"));
|
|
3216
|
+
/**
|
|
3217
|
+
* @internal
|
|
3218
|
+
*/
|
|
3219
|
+
function createAssertDecode() {
|
|
3220
|
+
halt$2("createAssertDecode");
|
|
3221
|
+
}
|
|
3222
|
+
const createAssertDecodePure = /** @__PURE__ */ Object.assign(createAssertDecode,
|
|
3223
|
+
/** @__PURE__ */ assert$1("protobuf.createAssertDecode"),
|
|
3224
|
+
/** @__PURE__ */ decode$1("createAssertDecode"));
|
|
3225
|
+
/**
|
|
3226
|
+
* @internal
|
|
3227
|
+
*/
|
|
3228
|
+
function createValidateDecode() {
|
|
3229
|
+
halt$2("createValidateDecode");
|
|
3230
|
+
}
|
|
3231
|
+
const createValidateDecodePure = /** @__PURE__ */ Object.assign(createValidateDecode,
|
|
3232
|
+
/** @__PURE__ */ validate$1(),
|
|
3233
|
+
/** @__PURE__ */ decode$1("createValidateDecode"));
|
|
3234
|
+
/**
|
|
3235
|
+
* @internal
|
|
3236
|
+
*/
|
|
3237
|
+
function createEncode() {
|
|
3238
|
+
halt$2("createEncode");
|
|
3239
|
+
}
|
|
3240
|
+
const createEncodePure = /** @__PURE__ */ Object.assign(createEncode, /** @__PURE__ */ encode$1("createEncode"));
|
|
3241
|
+
/**
|
|
3242
|
+
* @internal
|
|
3243
|
+
*/
|
|
3244
|
+
function createIsEncode() {
|
|
3245
|
+
halt$2("createIsEncode");
|
|
3246
|
+
}
|
|
3247
|
+
const createIsEncodePure = /** @__PURE__ */ Object.assign(createIsEncode,
|
|
3248
|
+
/** @__PURE__ */ is$1(),
|
|
3249
|
+
/** @__PURE__ */ encode$1("createIsEncode"));
|
|
3250
|
+
/**
|
|
3251
|
+
* @internal
|
|
3252
|
+
*/
|
|
3253
|
+
function createAssertEncode() {
|
|
3254
|
+
halt$2("createAssertEncode");
|
|
3255
|
+
}
|
|
3256
|
+
const createAssertEncodePure = /** @__PURE__ */ Object.assign(createAssertEncode,
|
|
3257
|
+
/** @__PURE__ */ assert$1("protobuf.createAssertEncode"),
|
|
3258
|
+
/** @__PURE__ */ encode$1("createAssertEncode"));
|
|
3259
|
+
/**
|
|
3260
|
+
* @internal
|
|
3261
|
+
*/
|
|
3262
|
+
function createValidateEncode() {
|
|
3263
|
+
halt$2("createValidateEncode");
|
|
3264
|
+
}
|
|
3265
|
+
const createValidateEncodePure = /** @__PURE__ */ Object.assign(createValidateEncode,
|
|
3266
|
+
/** @__PURE__ */ validate$1(),
|
|
3267
|
+
/** @__PURE__ */ encode$1("createValidateEncode"));
|
|
3268
|
+
/**
|
|
3269
|
+
* @internal
|
|
3270
|
+
*/
|
|
3271
|
+
function halt$2(name) {
|
|
3272
|
+
throw new Error(`Error on typia.protobuf.${name}(): no transform has been configured. Read and follow https://typia.io/docs/setup please.`);
|
|
3273
|
+
}
|
|
3274
|
+
|
|
3275
|
+
var protobuf = /*#__PURE__*/Object.freeze({
|
|
3276
|
+
__proto__: null,
|
|
3277
|
+
assertDecode: assertDecodePure,
|
|
3278
|
+
assertEncode: assertEncodePure,
|
|
3279
|
+
createAssertDecode: createAssertDecodePure,
|
|
3280
|
+
createAssertEncode: createAssertEncodePure,
|
|
3281
|
+
createDecode: createDecodePure,
|
|
3282
|
+
createEncode: createEncodePure,
|
|
3283
|
+
createIsDecode: createIsDecodePure,
|
|
3284
|
+
createIsEncode: createIsEncodePure,
|
|
3285
|
+
createValidateDecode: createValidateDecodePure,
|
|
3286
|
+
createValidateEncode: createValidateEncodePure,
|
|
3287
|
+
decode: decodePure,
|
|
3288
|
+
encode: encodePure,
|
|
3289
|
+
isDecode: isDecodePure,
|
|
3290
|
+
isEncode: isEncodePure,
|
|
3291
|
+
message: message,
|
|
3292
|
+
validateDecode: validateDecodePure,
|
|
3293
|
+
validateEncode: validateEncodePure
|
|
3294
|
+
});
|
|
3295
|
+
|
|
3296
|
+
/**
|
|
3297
|
+
* @internal
|
|
3298
|
+
*/
|
|
3299
|
+
function metadata() {
|
|
3300
|
+
halt$1("metadata");
|
|
3301
|
+
}
|
|
3302
|
+
const metadataPure = /** @__PURE__ */ Object.assign(metadata, { from: (input) => input });
|
|
3303
|
+
function name() {
|
|
3304
|
+
halt$1("name");
|
|
3305
|
+
}
|
|
3306
|
+
/**
|
|
3307
|
+
* @internal
|
|
3308
|
+
*/
|
|
3309
|
+
function halt$1(name) {
|
|
3310
|
+
throw new Error(`Error on typia.reflect.${name}(): no transform has been configured. Read and follow https://typia.io/docs/setup please.`);
|
|
3311
|
+
}
|
|
3312
|
+
|
|
3313
|
+
var reflect = /*#__PURE__*/Object.freeze({
|
|
3314
|
+
__proto__: null,
|
|
3315
|
+
metadata: metadataPure,
|
|
3316
|
+
name: name
|
|
3317
|
+
});
|
|
3318
|
+
|
|
3319
|
+
var index = /*#__PURE__*/Object.freeze({
|
|
3320
|
+
__proto__: null
|
|
3321
|
+
});
|
|
3322
|
+
|
|
3323
|
+
/**
|
|
3324
|
+
* @internal
|
|
3325
|
+
*/
|
|
3326
|
+
function assert() {
|
|
3327
|
+
halt("assert");
|
|
3328
|
+
}
|
|
3329
|
+
const assertPure = /** @__PURE__ */ Object.assign(assert,
|
|
3330
|
+
/** @__PURE__ */ assert$1("assert"));
|
|
3331
|
+
/**
|
|
3332
|
+
* @internal
|
|
3333
|
+
*/
|
|
3334
|
+
function assertGuard() {
|
|
3335
|
+
halt("assertGuard");
|
|
3336
|
+
}
|
|
3337
|
+
const assertGuardPure = /** @__PURE__ */ Object.assign(assertGuard,
|
|
3338
|
+
/** @__PURE__ */ assert$1("assertGuard"));
|
|
3339
|
+
/**
|
|
3340
|
+
* @internal
|
|
3341
|
+
*/
|
|
3342
|
+
function is() {
|
|
3343
|
+
halt("is");
|
|
3344
|
+
}
|
|
3345
|
+
const isPure = /** @__PURE__ */ Object.assign(is,
|
|
3346
|
+
/** @__PURE__ */ assert$1("is"));
|
|
3347
|
+
/**
|
|
3348
|
+
* @internal
|
|
3349
|
+
*/
|
|
3350
|
+
function validate() {
|
|
3351
|
+
halt("validate");
|
|
3352
|
+
}
|
|
3353
|
+
const validatePure = /** @__PURE__ */ Object.assign(validate,
|
|
3354
|
+
/** @__PURE__ */ validate$1());
|
|
3355
|
+
/**
|
|
3356
|
+
* @internal
|
|
3357
|
+
*/
|
|
3358
|
+
function assertEquals() {
|
|
3359
|
+
halt("assertEquals");
|
|
3360
|
+
}
|
|
3361
|
+
const assertEqualsPure = /** @__PURE__ */ Object.assign(assertEquals, /** @__PURE__ */ assert$1("assertEquals"));
|
|
3362
|
+
/**
|
|
3363
|
+
* @internal
|
|
3364
|
+
*/
|
|
3365
|
+
function assertGuardEquals() {
|
|
3366
|
+
halt("assertGuardEquals");
|
|
3367
|
+
}
|
|
3368
|
+
const assertGuardEqualsPure = /** @__PURE__ */ Object.assign(assertGuardEquals, /** @__PURE__ */ assert$1("assertGuardEquals"));
|
|
3369
|
+
/**
|
|
3370
|
+
* @internal
|
|
3371
|
+
*/
|
|
3372
|
+
function equals() {
|
|
3373
|
+
halt("equals");
|
|
3374
|
+
}
|
|
3375
|
+
const equalsPure = /** @__PURE__ */ Object.assign(equals,
|
|
3376
|
+
/** @__PURE__ */ is$1());
|
|
3377
|
+
/**
|
|
3378
|
+
* @internal
|
|
3379
|
+
*/
|
|
3380
|
+
function validateEquals() {
|
|
3381
|
+
halt("validateEquals");
|
|
3382
|
+
}
|
|
3383
|
+
const validateEqualsPure = /** @__PURE__ */ Object.assign(validateEquals, /** @__PURE__ */ validate$1());
|
|
3384
|
+
/**
|
|
3385
|
+
* @internal
|
|
3386
|
+
*/
|
|
3387
|
+
function random() {
|
|
3388
|
+
halt("random");
|
|
3389
|
+
}
|
|
3390
|
+
const randomPure = /** @__PURE__ */ Object.assign(random,
|
|
3391
|
+
/** @__PURE__ */ random$1());
|
|
3392
|
+
/**
|
|
3393
|
+
* @internal
|
|
3394
|
+
*/
|
|
3395
|
+
function createAssert() {
|
|
3396
|
+
halt("createAssert");
|
|
3397
|
+
}
|
|
3398
|
+
const createAssertPure = /** @__PURE__ */ Object.assign(createAssert, assertPure);
|
|
3399
|
+
/**
|
|
3400
|
+
* @internal
|
|
3401
|
+
*/
|
|
3402
|
+
function createAssertGuard() {
|
|
3403
|
+
halt("createAssertGuard");
|
|
3404
|
+
}
|
|
3405
|
+
const createAssertGuardPure = /** @__PURE__ */ Object.assign(createAssertGuard, assertGuardPure);
|
|
3406
|
+
/**
|
|
3407
|
+
* @internal
|
|
3408
|
+
*/
|
|
3409
|
+
function createIs() {
|
|
3410
|
+
halt("createIs");
|
|
3411
|
+
}
|
|
3412
|
+
const createIsPure = /** @__PURE__ */ Object.assign(createIs, isPure);
|
|
3413
|
+
/**
|
|
3414
|
+
* @internal
|
|
3415
|
+
*/
|
|
3416
|
+
function createValidate() {
|
|
3417
|
+
halt("createValidate");
|
|
3418
|
+
}
|
|
3419
|
+
const createValidatePure = /** @__PURE__ */ Object.assign(createValidate, validatePure);
|
|
3420
|
+
/**
|
|
3421
|
+
* @internal
|
|
3422
|
+
*/
|
|
3423
|
+
function createAssertEquals() {
|
|
3424
|
+
halt("createAssertEquals");
|
|
3425
|
+
}
|
|
3426
|
+
const createAssertEqualsPure = /** @__PURE__ */ Object.assign(createAssertEquals, assertEqualsPure);
|
|
3427
|
+
/**
|
|
3428
|
+
* @internal
|
|
3429
|
+
*/
|
|
3430
|
+
function createAssertGuardEquals() {
|
|
3431
|
+
halt("createAssertGuardEquals");
|
|
3432
|
+
}
|
|
3433
|
+
const createAssertGuardEqualsPure = /** @__PURE__ */ Object.assign(createAssertGuardEquals, assertGuardEqualsPure);
|
|
3434
|
+
/**
|
|
3435
|
+
* @internal
|
|
3436
|
+
*/
|
|
3437
|
+
function createEquals() {
|
|
3438
|
+
halt("createEquals");
|
|
3439
|
+
}
|
|
3440
|
+
const createEqualsPure = /** @__PURE__ */ Object.assign(createEquals, equalsPure);
|
|
3441
|
+
/**
|
|
3442
|
+
* @internal
|
|
3443
|
+
*/
|
|
3444
|
+
function createValidateEquals() {
|
|
3445
|
+
halt("createValidateEquals");
|
|
3446
|
+
}
|
|
3447
|
+
const createValidateEqualsPure = /** @__PURE__ */ Object.assign(createValidateEquals, validateEqualsPure);
|
|
3448
|
+
/**
|
|
3449
|
+
* @internal
|
|
3450
|
+
*/
|
|
3451
|
+
function createRandom() {
|
|
3452
|
+
halt("createRandom");
|
|
3453
|
+
}
|
|
3454
|
+
const createRandomPure = /** @__PURE__ */ Object.assign(createRandom, randomPure);
|
|
3455
|
+
/**
|
|
3456
|
+
* @internal
|
|
3457
|
+
*/
|
|
3458
|
+
function halt(name) {
|
|
3459
|
+
throw new Error(`Error on typia.${name}(): no transform has been configured. Read and follow https://typia.io/docs/setup please.`);
|
|
3460
|
+
}
|
|
3461
|
+
|
|
3462
|
+
var typia = /*#__PURE__*/Object.freeze({
|
|
3463
|
+
__proto__: null,
|
|
3464
|
+
TypeGuardError: TypeGuardError,
|
|
3465
|
+
assert: assertPure,
|
|
3466
|
+
assertEquals: assertEqualsPure,
|
|
3467
|
+
assertGuard: assertGuardPure,
|
|
3468
|
+
assertGuardEquals: assertGuardEqualsPure,
|
|
3469
|
+
createAssert: createAssertPure,
|
|
3470
|
+
createAssertEquals: createAssertEqualsPure,
|
|
3471
|
+
createAssertGuard: createAssertGuardPure,
|
|
3472
|
+
createAssertGuardEquals: createAssertGuardEqualsPure,
|
|
3473
|
+
createEquals: createEqualsPure,
|
|
3474
|
+
createIs: createIsPure,
|
|
3475
|
+
createRandom: createRandomPure,
|
|
3476
|
+
createValidate: createValidatePure,
|
|
3477
|
+
createValidateEquals: createValidateEqualsPure,
|
|
3478
|
+
equals: equalsPure,
|
|
3479
|
+
functional: functional,
|
|
3480
|
+
http: http,
|
|
3481
|
+
is: isPure,
|
|
3482
|
+
json: json,
|
|
3483
|
+
misc: misc,
|
|
3484
|
+
notations: notations,
|
|
3485
|
+
protobuf: protobuf,
|
|
3486
|
+
random: randomPure,
|
|
3487
|
+
reflect: reflect,
|
|
3488
|
+
tags: index,
|
|
3489
|
+
validate: validatePure,
|
|
3490
|
+
validateEquals: validateEqualsPure
|
|
3491
|
+
});
|
|
3492
|
+
|
|
3493
|
+
export { TypeGuardError, assertPure as assert, assertEqualsPure as assertEquals, assertGuardPure as assertGuard, assertGuardEqualsPure as assertGuardEquals, createAssertPure as createAssert, createAssertEqualsPure as createAssertEquals, createAssertGuardPure as createAssertGuard, createAssertGuardEqualsPure as createAssertGuardEquals, createEqualsPure as createEquals, createIsPure as createIs, createRandomPure as createRandom, createValidatePure as createValidate, createValidateEqualsPure as createValidateEquals, typia as default, equalsPure as equals, functional, http, isPure as is, json, misc, notations, protobuf, randomPure as random, reflect, index as tags, validatePure as validate, validateEqualsPure as validateEquals };
|
|
24
3494
|
//# sourceMappingURL=index.mjs.map
|