@oscarpalmer/jhunal 0.26.0 → 0.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/constants.d.mts +15 -7
- package/dist/constants.mjs +15 -6
- package/dist/handler/base.handler.d.mts +6 -0
- package/dist/{validator/base.validator.mjs → handler/base.handler.mjs} +5 -5
- package/dist/handler/function.handler.d.mts +6 -0
- package/dist/handler/function.handler.mjs +9 -0
- package/dist/handler/object.handler.d.mts +7 -0
- package/dist/handler/object.handler.mjs +130 -0
- package/dist/handler/schema.handler.d.mts +7 -0
- package/dist/handler/schema.handler.mjs +16 -0
- package/dist/handler/type.handler.d.mts +9 -0
- package/dist/handler/type.handler.mjs +71 -0
- package/dist/handler/validator.handler.d.mts +10 -0
- package/dist/handler/validator.handler.mjs +34 -0
- package/dist/handler/value.handler.d.mts +14 -0
- package/dist/handler/value.handler.mjs +98 -0
- package/dist/helpers/message.helper.d.mts +9 -7
- package/dist/helpers/message.helper.mjs +34 -16
- package/dist/helpers/misc.helper.d.mts +13 -6
- package/dist/helpers/misc.helper.mjs +12 -4
- package/dist/helpers/report.helper.d.mts +23 -0
- package/dist/helpers/report.helper.mjs +19 -0
- package/dist/helpers/result.helper.d.mts +7 -0
- package/dist/helpers/result.helper.mjs +17 -0
- package/dist/index.d.mts +170 -71
- package/dist/index.mjs +354 -215
- package/dist/models/infer.model.d.mts +11 -8
- package/dist/models/misc.model.d.mts +8 -8
- package/dist/models/schematic.plain.model.d.mts +10 -9
- package/dist/models/schematic.typed.model.d.mts +1 -1
- package/dist/models/transform.model.d.mts +2 -2
- package/dist/models/validation.model.d.mts +56 -25
- package/dist/models/validation.model.mjs +11 -2
- package/dist/schema.d.mts +32 -32
- package/dist/schema.mjs +11 -19
- package/dist/validator.d.mts +83 -0
- package/dist/validator.mjs +25 -0
- package/package.json +2 -2
- package/src/constants.ts +30 -8
- package/src/{validator/base.validator.ts → handler/base.handler.ts} +6 -6
- package/src/handler/function.handler.ts +9 -0
- package/src/handler/object.handler.ts +245 -0
- package/src/handler/schema.handler.ts +25 -0
- package/src/handler/type.handler.ts +160 -0
- package/src/handler/validator.handler.ts +49 -0
- package/src/handler/value.handler.ts +202 -0
- package/src/helpers/message.helper.ts +72 -30
- package/src/helpers/misc.helper.ts +23 -6
- package/src/helpers/report.helper.ts +72 -0
- package/src/helpers/result.helper.ts +33 -0
- package/src/index.ts +1 -0
- package/src/models/infer.model.ts +31 -13
- package/src/models/misc.model.ts +9 -9
- package/src/models/schematic.plain.model.ts +12 -9
- package/src/models/schematic.typed.model.ts +3 -3
- package/src/models/transform.model.ts +2 -2
- package/src/models/validation.model.ts +75 -37
- package/src/schema.ts +42 -70
- package/src/validator.ts +135 -0
- package/dist/validator/base.validator.d.mts +0 -6
- package/dist/validator/function.validator.d.mts +0 -6
- package/dist/validator/function.validator.mjs +0 -9
- package/dist/validator/named.handler.d.mts +0 -6
- package/dist/validator/named.handler.mjs +0 -23
- package/dist/validator/named.validator.d.mts +0 -7
- package/dist/validator/named.validator.mjs +0 -38
- package/dist/validator/object.validator.d.mts +0 -7
- package/dist/validator/object.validator.mjs +0 -207
- package/dist/validator/schema.validator.d.mts +0 -7
- package/dist/validator/schema.validator.mjs +0 -16
- package/src/validator/function.validator.ts +0 -9
- package/src/validator/named.handler.ts +0 -65
- package/src/validator/named.validator.ts +0 -61
- package/src/validator/object.validator.ts +0 -426
- package/src/validator/schema.validator.ts +0 -25
|
@@ -1,426 +0,0 @@
|
|
|
1
|
-
import {isPlainObject} from '@oscarpalmer/atoms/is';
|
|
2
|
-
import type {PlainObject} from '@oscarpalmer/atoms/models';
|
|
3
|
-
import {join} from '@oscarpalmer/atoms/string';
|
|
4
|
-
import {clone} from '@oscarpalmer/atoms/value/clone';
|
|
5
|
-
import {
|
|
6
|
-
PROPERTY_DEFAULT,
|
|
7
|
-
PROPERTY_REQUIRED,
|
|
8
|
-
PROPERTY_TYPE,
|
|
9
|
-
PROPERTY_VALIDATORS,
|
|
10
|
-
SCHEMATIC_MESSAGE_SCHEMA_INVALID_EMPTY,
|
|
11
|
-
TYPE_ALL,
|
|
12
|
-
TYPE_UNDEFINED,
|
|
13
|
-
} from '../constants';
|
|
14
|
-
import {
|
|
15
|
-
getDefaultRequiredMessage,
|
|
16
|
-
getDefaultTypeMessage,
|
|
17
|
-
getDisallowedMessage,
|
|
18
|
-
getInputPropertyMissingMessage,
|
|
19
|
-
getInputPropertyTypeMessage,
|
|
20
|
-
getInputTypeMessage,
|
|
21
|
-
getRequiredMessage,
|
|
22
|
-
getSchematicPropertyNullableMessage,
|
|
23
|
-
getSchematicPropertyTypeMessage,
|
|
24
|
-
getUnknownKeysMessage,
|
|
25
|
-
} from '../helpers/message.helper';
|
|
26
|
-
import {getParameters, isSchema} from '../helpers/misc.helper';
|
|
27
|
-
import type {ValueName} from '../models/misc.model';
|
|
28
|
-
import {
|
|
29
|
-
type NamedValidatorHandlers,
|
|
30
|
-
SchematicError,
|
|
31
|
-
ValidationError,
|
|
32
|
-
type ValidationInformation,
|
|
33
|
-
type ValidationInformationKey,
|
|
34
|
-
type Validator,
|
|
35
|
-
type ValidatorDefaults,
|
|
36
|
-
type ValidatorItem,
|
|
37
|
-
type ValidatorParameters,
|
|
38
|
-
type ValidatorType,
|
|
39
|
-
} from '../models/validation.model';
|
|
40
|
-
import {getBaseValidator} from './base.validator';
|
|
41
|
-
import {getFunctionValidator} from './function.validator';
|
|
42
|
-
import {getNamedHandlers} from './named.handler';
|
|
43
|
-
import {getNamedValidator} from './named.validator';
|
|
44
|
-
import {getSchemaValidator} from './schema.validator';
|
|
45
|
-
|
|
46
|
-
type ReportParameters<Callback extends (...args: any[]) => string> = {
|
|
47
|
-
extract?: boolean;
|
|
48
|
-
information?: ReportParametersInformation;
|
|
49
|
-
key: ValidationInformationKey;
|
|
50
|
-
message: ReportParametersMessage<Callback>;
|
|
51
|
-
original: ValidatorParameters;
|
|
52
|
-
value: unknown;
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
type ReportParametersMessage<Callback extends (...args: any[]) => string> = {
|
|
56
|
-
arguments: Parameters<Callback>;
|
|
57
|
-
callback: Callback;
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
type ReportParametersInformation = {
|
|
61
|
-
all: ValidationInformation[];
|
|
62
|
-
existing?: ValidationInformation[];
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
function getDefaults(
|
|
66
|
-
obj: PlainObject,
|
|
67
|
-
key: string,
|
|
68
|
-
allowed: boolean,
|
|
69
|
-
): ValidatorDefaults | undefined {
|
|
70
|
-
if (!(PROPERTY_DEFAULT in obj)) {
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
if (!allowed) {
|
|
75
|
-
throw new SchematicError(getDisallowedMessage(key, PROPERTY_DEFAULT));
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
return {
|
|
79
|
-
value: obj[PROPERTY_DEFAULT],
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
function getDisallowedProperty(obj: PlainObject): string | undefined {
|
|
84
|
-
if (PROPERTY_DEFAULT in obj) {
|
|
85
|
-
return PROPERTY_DEFAULT;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
if (PROPERTY_REQUIRED in obj) {
|
|
89
|
-
return PROPERTY_REQUIRED;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
if (PROPERTY_TYPE in obj) {
|
|
93
|
-
return PROPERTY_TYPE;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
if (PROPERTY_VALIDATORS in obj) {
|
|
97
|
-
return PROPERTY_VALIDATORS;
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
export function getObjectValidator(
|
|
102
|
-
original: PlainObject,
|
|
103
|
-
origin?: ValidationInformationKey,
|
|
104
|
-
fromType?: boolean,
|
|
105
|
-
): Validator {
|
|
106
|
-
const keys = Object.keys(original);
|
|
107
|
-
const keysLength = keys.length;
|
|
108
|
-
|
|
109
|
-
if (keysLength === 0) {
|
|
110
|
-
throw new SchematicError(SCHEMATIC_MESSAGE_SCHEMA_INVALID_EMPTY);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
if (fromType ?? false) {
|
|
114
|
-
const property = getDisallowedProperty(original);
|
|
115
|
-
|
|
116
|
-
if (property != null) {
|
|
117
|
-
throw new SchematicError(getDisallowedMessage(origin!.full, property));
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
const set = new Set<string>();
|
|
122
|
-
|
|
123
|
-
const items: ValidatorItem[] = [];
|
|
124
|
-
|
|
125
|
-
for (let keyIndex = 0; keyIndex < keysLength; keyIndex += 1) {
|
|
126
|
-
const key = keys[keyIndex];
|
|
127
|
-
const value = original[key];
|
|
128
|
-
|
|
129
|
-
const prefixedKey = origin == null ? key : join([origin.full, key], '.');
|
|
130
|
-
|
|
131
|
-
if (value == null) {
|
|
132
|
-
throw new SchematicError(getSchematicPropertyNullableMessage(prefixedKey));
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
const fullKey: ValidationInformationKey = {
|
|
136
|
-
full: prefixedKey,
|
|
137
|
-
short: key,
|
|
138
|
-
};
|
|
139
|
-
|
|
140
|
-
let handlers: NamedValidatorHandlers = {};
|
|
141
|
-
let required = true;
|
|
142
|
-
let typed = false;
|
|
143
|
-
|
|
144
|
-
let defaults: ValidatorDefaults | undefined;
|
|
145
|
-
|
|
146
|
-
let types: ValidatorType[];
|
|
147
|
-
|
|
148
|
-
const validators: Validator[] = [];
|
|
149
|
-
|
|
150
|
-
if (isPlainObject(value)) {
|
|
151
|
-
typed = PROPERTY_TYPE in value;
|
|
152
|
-
|
|
153
|
-
const type = typed ? value[PROPERTY_TYPE] : value;
|
|
154
|
-
|
|
155
|
-
defaults = getDefaults(value, prefixedKey, typed);
|
|
156
|
-
handlers = getNamedHandlers(value[PROPERTY_VALIDATORS], prefixedKey, typed);
|
|
157
|
-
required = getRequired(value, prefixedKey, typed) ?? required;
|
|
158
|
-
|
|
159
|
-
types = Array.isArray(type) ? type : [type];
|
|
160
|
-
} else {
|
|
161
|
-
types = Array.isArray(value) ? value : [value];
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
if (types.length === 0) {
|
|
165
|
-
throw new SchematicError(getSchematicPropertyTypeMessage(prefixedKey));
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
const typesLength = types.length;
|
|
169
|
-
|
|
170
|
-
for (let typeIndex = 0; typeIndex < typesLength; typeIndex += 1) {
|
|
171
|
-
const type = types[typeIndex];
|
|
172
|
-
|
|
173
|
-
let validator: Validator;
|
|
174
|
-
|
|
175
|
-
switch (true) {
|
|
176
|
-
case typeof type === 'function':
|
|
177
|
-
validator = getFunctionValidator(type);
|
|
178
|
-
break;
|
|
179
|
-
|
|
180
|
-
case isPlainObject(type):
|
|
181
|
-
validator = getObjectValidator(type, fullKey, typed);
|
|
182
|
-
break;
|
|
183
|
-
|
|
184
|
-
case isSchema(type):
|
|
185
|
-
validator = getSchemaValidator(type);
|
|
186
|
-
break;
|
|
187
|
-
|
|
188
|
-
case TYPE_ALL.has(type as ValueName):
|
|
189
|
-
validator = getNamedValidator(fullKey, type as ValueName, handlers);
|
|
190
|
-
break;
|
|
191
|
-
|
|
192
|
-
default:
|
|
193
|
-
throw new SchematicError(getSchematicPropertyTypeMessage(prefixedKey));
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
validators.push(validator);
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
required = required && !types.includes(TYPE_UNDEFINED);
|
|
200
|
-
|
|
201
|
-
if (defaults != null && !required) {
|
|
202
|
-
throw new SchematicError(getDefaultRequiredMessage(prefixedKey));
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
const validator = getBaseValidator(validators);
|
|
206
|
-
|
|
207
|
-
if (defaults != null && Array.isArray(validator(defaults.value, getParameters(), false))) {
|
|
208
|
-
throw new SchematicError(getDefaultTypeMessage(prefixedKey, types));
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
items.push({
|
|
212
|
-
defaults,
|
|
213
|
-
required,
|
|
214
|
-
types,
|
|
215
|
-
validator,
|
|
216
|
-
key: fullKey,
|
|
217
|
-
});
|
|
218
|
-
|
|
219
|
-
set.add(key);
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
const validatorsLength = items.length;
|
|
223
|
-
|
|
224
|
-
return (input, parameters, get) => {
|
|
225
|
-
if (!isPlainObject(input)) {
|
|
226
|
-
return origin == null
|
|
227
|
-
? report(
|
|
228
|
-
{
|
|
229
|
-
key: {
|
|
230
|
-
full: '',
|
|
231
|
-
short: '',
|
|
232
|
-
},
|
|
233
|
-
message: {
|
|
234
|
-
arguments: [input],
|
|
235
|
-
callback: getInputTypeMessage,
|
|
236
|
-
},
|
|
237
|
-
original: parameters,
|
|
238
|
-
value: input,
|
|
239
|
-
},
|
|
240
|
-
true,
|
|
241
|
-
)
|
|
242
|
-
: [];
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
if (parameters.strict) {
|
|
246
|
-
const inputKeys = Object.keys(input);
|
|
247
|
-
const unknownKeys = inputKeys.filter(key => !set.has(key));
|
|
248
|
-
|
|
249
|
-
if (unknownKeys.length > 0) {
|
|
250
|
-
const information: ValidationInformation = {
|
|
251
|
-
key: origin ?? {
|
|
252
|
-
full: '',
|
|
253
|
-
short: '',
|
|
254
|
-
},
|
|
255
|
-
message: getUnknownKeysMessage(unknownKeys),
|
|
256
|
-
value: input,
|
|
257
|
-
};
|
|
258
|
-
|
|
259
|
-
if (parameters.reporting.throw) {
|
|
260
|
-
throw new ValidationError([information]);
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
parameters.information?.push(information);
|
|
264
|
-
|
|
265
|
-
return [information];
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
const getAndClone = get && parameters.clone;
|
|
270
|
-
|
|
271
|
-
const allInformation: ValidationInformation[] = [];
|
|
272
|
-
const output: PlainObject = {};
|
|
273
|
-
|
|
274
|
-
for (let validatorIndex = 0; validatorIndex < validatorsLength; validatorIndex += 1) {
|
|
275
|
-
const {defaults, key, required, types, validator} = items[validatorIndex];
|
|
276
|
-
|
|
277
|
-
const value = (input as PlainObject)[key.short];
|
|
278
|
-
|
|
279
|
-
if (value === undefined) {
|
|
280
|
-
if (required) {
|
|
281
|
-
if (get && defaults != null) {
|
|
282
|
-
const defaultValue = clone(defaults.value);
|
|
283
|
-
|
|
284
|
-
if (parameters.clone) {
|
|
285
|
-
output[key.short] = defaultValue;
|
|
286
|
-
} else {
|
|
287
|
-
input[key.short] = defaultValue;
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
continue;
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
if (parameters.reporting.none) {
|
|
294
|
-
return [];
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
const reported = report({
|
|
298
|
-
key,
|
|
299
|
-
value,
|
|
300
|
-
information: {
|
|
301
|
-
all: allInformation,
|
|
302
|
-
},
|
|
303
|
-
message: {
|
|
304
|
-
arguments: [key.full, types],
|
|
305
|
-
callback: getInputPropertyMissingMessage,
|
|
306
|
-
},
|
|
307
|
-
original: parameters,
|
|
308
|
-
});
|
|
309
|
-
|
|
310
|
-
if (reported == null) {
|
|
311
|
-
continue;
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
return reported;
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
continue;
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
const previousOutput = parameters.output;
|
|
321
|
-
|
|
322
|
-
parameters.output = output;
|
|
323
|
-
|
|
324
|
-
const result = validator(value, parameters, get);
|
|
325
|
-
|
|
326
|
-
parameters.output = previousOutput;
|
|
327
|
-
|
|
328
|
-
if (result === true) {
|
|
329
|
-
if (getAndClone && !isPlainObject(value)) {
|
|
330
|
-
output[key.short] = clone(value);
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
continue;
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
if (parameters.reporting.none) {
|
|
337
|
-
return [];
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
const reported = report({
|
|
341
|
-
key,
|
|
342
|
-
value,
|
|
343
|
-
extract: false,
|
|
344
|
-
information: {
|
|
345
|
-
all: allInformation,
|
|
346
|
-
existing: typeof result !== 'boolean' && result.length > 0 ? result : undefined,
|
|
347
|
-
},
|
|
348
|
-
message: {
|
|
349
|
-
arguments: [key.full, types, value],
|
|
350
|
-
callback: getInputPropertyTypeMessage,
|
|
351
|
-
},
|
|
352
|
-
original: parameters,
|
|
353
|
-
});
|
|
354
|
-
|
|
355
|
-
if (reported == null) {
|
|
356
|
-
continue;
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
return reported;
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
if (getAndClone) {
|
|
363
|
-
if (origin == null) {
|
|
364
|
-
parameters.output = output;
|
|
365
|
-
} else {
|
|
366
|
-
parameters.output[origin.short] = output;
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
return allInformation.length === 0 ? true : allInformation;
|
|
371
|
-
};
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
function getRequired(obj: PlainObject, key: string, allowed: boolean): boolean | undefined {
|
|
375
|
-
if (!(PROPERTY_REQUIRED in obj)) {
|
|
376
|
-
return;
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
if (!allowed) {
|
|
380
|
-
throw new SchematicError(getDisallowedMessage(key, PROPERTY_REQUIRED));
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
if (typeof obj[PROPERTY_REQUIRED] !== 'boolean') {
|
|
384
|
-
throw new SchematicError(getRequiredMessage(key));
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
return obj[PROPERTY_REQUIRED];
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
function report<Callback extends (...args: any[]) => string>(
|
|
391
|
-
parameters: ReportParameters<Callback>,
|
|
392
|
-
getReports: true,
|
|
393
|
-
): ValidationInformation[];
|
|
394
|
-
|
|
395
|
-
function report<Callback extends (...args: any[]) => string>(
|
|
396
|
-
parameters: ReportParameters<Callback>,
|
|
397
|
-
): ValidationInformation[] | undefined;
|
|
398
|
-
|
|
399
|
-
function report<Callback extends (...args: any[]) => string>(
|
|
400
|
-
parameters: ReportParameters<Callback>,
|
|
401
|
-
getReports?: boolean,
|
|
402
|
-
): ValidationInformation[] | undefined {
|
|
403
|
-
const {information, message, original} = parameters;
|
|
404
|
-
|
|
405
|
-
const reported: ValidationInformation[] = information?.existing ?? [
|
|
406
|
-
{
|
|
407
|
-
key: parameters.key,
|
|
408
|
-
value: parameters.value,
|
|
409
|
-
message: message.callback(...message.arguments),
|
|
410
|
-
},
|
|
411
|
-
];
|
|
412
|
-
|
|
413
|
-
if (original.reporting.throw) {
|
|
414
|
-
throw new ValidationError(reported);
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
information?.all.push(...reported);
|
|
418
|
-
|
|
419
|
-
if (parameters.extract ?? true) {
|
|
420
|
-
original.information?.push(...reported);
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
if ((getReports ?? false) || !original.reporting.all) {
|
|
424
|
-
return reported;
|
|
425
|
-
}
|
|
426
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import {isPlainObject} from '@oscarpalmer/atoms/is';
|
|
2
|
-
import type {Validator} from '../models/validation.model';
|
|
3
|
-
import {Schema, schemaValidators} from '../schema';
|
|
4
|
-
|
|
5
|
-
export function getSchemaValidator(schematic: Schema<unknown>): Validator {
|
|
6
|
-
const validator = schemaValidators.get(schematic)!;
|
|
7
|
-
|
|
8
|
-
return (input, parameters, get) => {
|
|
9
|
-
let result: ReturnType<Validator>;
|
|
10
|
-
|
|
11
|
-
if (isPlainObject(input)) {
|
|
12
|
-
result = validator(input, parameters, get);
|
|
13
|
-
} else {
|
|
14
|
-
result = [];
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
if (result === true) {
|
|
18
|
-
return result;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
parameters.information?.push(...result);
|
|
22
|
-
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
}
|