@strictly/define 0.0.1 → 0.0.2
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/.out/index.d.ts +17 -11
- package/.out/index.js +17 -11
- package/.out/transformers/copies/copy.d.ts +3 -3
- package/.out/transformers/copies/copy_to.d.ts +3 -3
- package/.out/transformers/copies/copy_to.js +4 -0
- package/.out/transformers/copies/mobx_copy.d.ts +4 -4
- package/.out/transformers/copies/mobx_copy.js +1 -1
- package/.out/transformers/copies/specs/copy_to.tests.js +8 -8
- package/.out/transformers/copies/specs/mobx_copy.tests.js +1 -1
- package/.out/transformers/flatteners/flatten_accessors_of_type.d.ts +5 -0
- package/.out/transformers/flatteners/flatten_accessors_of_type.js +11 -0
- package/.out/transformers/flatteners/flatten_json_value_to_type_paths_of.d.ts +2 -2
- package/.out/transformers/flatteners/flatten_json_value_to_type_paths_of.js +2 -2
- package/.out/transformers/flatteners/{flatten_type_def_to.d.ts → flatten_type_to.d.ts} +1 -1
- package/.out/transformers/flatteners/{flatten_type_def_to.js → flatten_type_to.js} +1 -1
- package/.out/transformers/flatteners/{flatten_type_defs_of.d.ts → flatten_types_of_type.d.ts} +1 -1
- package/.out/transformers/flatteners/flatten_types_of_type.js +7 -0
- package/.out/transformers/flatteners/flatten_validation_errors_of_type.d.ts +22 -0
- package/.out/transformers/flatteners/flatten_validation_errors_of_type.js +10 -0
- package/.out/transformers/flatteners/flatten_validators_of_validating_type.d.ts +4 -0
- package/.out/transformers/flatteners/flatten_validators_of_validating_type.js +17 -0
- package/.out/transformers/flatteners/{flatten_value_type_to.d.ts → flatten_value_to.d.ts} +4 -4
- package/.out/transformers/flatteners/{flatten_value_type_to.js → flatten_value_to.js} +7 -2
- package/.out/transformers/flatteners/flatten_values_of_type.d.ts +3 -0
- package/.out/transformers/flatteners/flatten_values_of_type.js +7 -0
- package/.out/transformers/flatteners/specs/{flatten_accessors_of.tests.js → flatten_accessors_of_type.tests.js} +5 -6
- package/.out/transformers/flatteners/specs/flatten_json_value_to_type_paths_of.tests.js +6 -6
- package/.out/transformers/flatteners/specs/{flatten_type_def_to.tests.js → flatten_type_to.tests.js} +15 -13
- package/.out/transformers/flatteners/specs/flatten_types_of_type.tests.js +18 -0
- package/.out/transformers/flatteners/specs/flatten_validation_errors_of_type.tests.js +25 -0
- package/.out/transformers/flatteners/specs/{flatten_value_type_to.tests.js → flatten_value_to.tests.js} +81 -58
- package/.out/transformers/flatteners/specs/{flatten_value_types_of.tests.js → flatten_values_of_type.tests.js} +4 -4
- package/.out/transformers/flatteners/specs/value_path_to_type_path.tests.js +5 -3
- package/.out/transformers/flatteners/value_path_to_type_path.d.ts +1 -1
- package/.out/tsconfig.tsbuildinfo +1 -1
- package/.out/types/builders.d.ts +55 -29
- package/.out/types/builders.js +116 -32
- package/.out/types/definitions.d.ts +1 -1
- package/.out/types/flattened_accessors_of_type.d.ts +9 -0
- package/.out/types/{flattened_type_defs_of.d.ts → flattened_types_of_type.d.ts} +9 -6
- package/.out/types/flattened_types_of_validating_type.d.ts +25 -0
- package/.out/types/flattened_validators_of_validating_type.d.ts +10 -0
- package/.out/types/flattened_values_of_type.d.ts +6 -0
- package/.out/types/{mobx_value_type_of.d.ts → mobx_value_of_type.d.ts} +2 -2
- package/.out/types/{partial_type_def_of.d.ts → partial_type_of_type.d.ts} +1 -1
- package/.out/types/path_of.d.ts +1 -0
- package/.out/types/{json_paths_of.d.ts → paths_of_type.d.ts} +5 -5
- package/.out/types/readonly_type_of_type.d.ts +29 -0
- package/.out/types/specs/builder.tests.js +73 -23
- package/.out/types/specs/{flattened_accessors_of.tests.js → flattened_accessors_of_type.tests.js} +1 -1
- package/.out/types/specs/{flattened_type_defs_of.tests.js → flattened_types_of_type.tests.js} +22 -15
- package/.out/types/specs/flattened_validators_of_validating_type.tests.js +24 -0
- package/.out/types/specs/flattened_values_of_type.tests.js +18 -0
- package/.out/types/specs/{partial_type_def_of.tests.js → partial_type_of_type.tests.js} +4 -4
- package/.out/types/specs/{json_paths_of.tests.js → paths_of_type.tests.js} +19 -19
- package/.out/types/specs/{readonly_type_def_of.tests.js → readonly_type_of_type.tests.js} +6 -6
- package/.out/types/specs/type_of_type.tests.d.ts +1 -0
- package/.out/types/specs/type_of_type.tests.js +27 -0
- package/.out/types/specs/value_of_type.tests.d.ts +1 -0
- package/.out/types/specs/{value_type_of.tests.js → value_of_type.tests.js} +1 -1
- package/.out/types/specs/value_to_type_paths_of_type.tests.d.ts +1 -0
- package/.out/types/specs/{value_to_type_paths_of.tests.js → value_to_type_paths_of_type.tests.js} +9 -9
- package/.out/types/specs/value_types_of_discriminated_union.tests.js +2 -2
- package/.out/types/strict_definitions.d.ts +2 -2
- package/.out/types/type_of_type.d.ts +49 -0
- package/.out/types/type_of_type.js +70 -0
- package/.out/types/validating_definitions.d.ts +49 -0
- package/.out/types/validating_definitions.js +1 -0
- package/.out/types/validating_type_def_with_error.d.ts +55 -0
- package/.out/types/validating_type_def_with_error.js +1 -0
- package/.out/types/value_of_type.d.ts +24 -0
- package/.out/types/value_of_type.js +1 -0
- package/.out/types/{value_to_type_paths_of.d.ts → value_to_type_paths_of_type.d.ts} +13 -13
- package/.out/types/value_to_type_paths_of_type.js +1 -0
- package/.out/types/value_types_of_discriminated_union.d.ts +5 -4
- package/.out/validation/errors_of_validators.d.ts +4 -0
- package/.out/validation/errors_of_validators.js +1 -0
- package/.out/validation/specs/errors_of_validators.tests.d.ts +1 -0
- package/.out/validation/specs/errors_of_validators.tests.js +9 -0
- package/.out/validation/specs/validators_of_values.tests.d.ts +1 -0
- package/.out/validation/specs/validators_of_values.tests.js +21 -0
- package/.out/validation/validator.d.ts +21 -0
- package/.out/validation/validator.js +26 -0
- package/.out/validation/validators/defined_validator.d.ts +10 -0
- package/.out/validation/validators/defined_validator.js +18 -0
- package/.out/validation/validators/minimum_string_length_validator.d.ts +16 -0
- package/.out/validation/validators/minimum_string_length_validator.js +23 -0
- package/.out/validation/validators_of_values.d.ts +4 -0
- package/.out/validation/validators_of_values.js +1 -0
- package/.turbo/turbo-build.log +9 -9
- package/.turbo/turbo-check-types.log +1 -1
- package/.turbo/turbo-release$colon$exports.log +1 -1
- package/README.md +16 -2
- package/dist/index.cjs +364 -76
- package/dist/index.d.cts +365 -114
- package/dist/index.d.ts +365 -114
- package/dist/index.js +355 -73
- package/index.ts +17 -11
- package/package.json +11 -3
- package/transformers/copies/copy.ts +4 -4
- package/transformers/copies/copy_to.ts +11 -7
- package/transformers/copies/mobx_copy.ts +6 -6
- package/transformers/copies/specs/copy_to.tests.ts +8 -8
- package/transformers/copies/specs/mobx_copy.tests.ts +3 -3
- package/transformers/flatteners/{flatten_accessors_of.ts → flatten_accessors_of_type.ts} +10 -10
- package/transformers/flatteners/flatten_json_value_to_type_paths_of.ts +5 -5
- package/transformers/flatteners/{flatten_type_def_to.ts → flatten_type_to.ts} +1 -1
- package/transformers/flatteners/{flatten_type_defs_of.ts → flatten_types_of_type.ts} +3 -3
- package/transformers/flatteners/flatten_validation_errors_of_type.ts +93 -0
- package/transformers/flatteners/flatten_validators_of_validating_type.ts +32 -0
- package/transformers/flatteners/{flatten_value_type_to.ts → flatten_value_to.ts} +12 -7
- package/transformers/flatteners/{flatten_value_types_of.ts → flatten_values_of_type.ts} +6 -6
- package/transformers/flatteners/specs/{flatten_accessors_of.tests.ts → flatten_accessors_of_type.tests.ts} +10 -11
- package/transformers/flatteners/specs/flatten_json_value_to_type_paths_of.tests.ts +6 -6
- package/transformers/flatteners/specs/{flatten_type_def_to.tests.ts → flatten_type_to.tests.ts} +15 -13
- package/transformers/flatteners/specs/flatten_types_of_type.tests.ts +27 -0
- package/transformers/flatteners/specs/flatten_validation_errors_of_type.tests.ts +48 -0
- package/transformers/flatteners/specs/{flatten_value_type_to.tests.ts → flatten_value_to.tests.ts} +124 -91
- package/transformers/flatteners/specs/{flatten_value_types_of.tests.ts → flatten_values_of_type.tests.ts} +4 -4
- package/transformers/flatteners/specs/value_path_to_type_path.tests.ts +20 -18
- package/transformers/flatteners/value_path_to_type_path.ts +4 -4
- package/types/builders.ts +239 -71
- package/types/definitions.ts +2 -2
- package/types/{flattened_accessors_of.ts → flattened_accessors_of_type.ts} +3 -3
- package/types/{flattened_type_defs_of.ts → flattened_types_of_type.ts} +22 -12
- package/types/flattened_types_of_validating_type.ts +152 -0
- package/types/flattened_validators_of_validating_type.ts +33 -0
- package/types/flattened_values_of_type.ts +11 -0
- package/types/{mobx_value_type_of.ts → mobx_value_of_type.ts} +2 -2
- package/types/{partial_type_def_of.ts → partial_type_of_type.ts} +3 -1
- package/types/{json_path_of.ts → path_of.ts} +1 -1
- package/types/{json_paths_of.ts → paths_of_type.ts} +5 -5
- package/types/readonly_type_of_type.ts +54 -0
- package/types/specs/builder.tests.ts +205 -54
- package/types/specs/{flattened_accessors_of.tests.ts → flattened_accessors_of_type.tests.ts} +3 -3
- package/types/specs/{flattened_type_defs_of.tests.ts → flattened_types_of_type.tests.ts} +82 -34
- package/types/specs/flattened_validators_of_validating_type.tests.ts +47 -0
- package/types/specs/flattened_values_of_type.tests.ts +39 -0
- package/types/specs/{partial_type_def_of.tests.ts → partial_type_of_type.tests.ts} +11 -11
- package/types/specs/{json_paths_of.tests.ts → paths_of_type.tests.ts} +47 -47
- package/types/specs/{readonly_type_def_of.tests.ts → readonly_type_of_type.tests.ts} +14 -14
- package/types/specs/type_of_type.tests.ts +60 -0
- package/types/specs/{value_type_of.tests.ts → value_of_type.tests.ts} +15 -15
- package/types/specs/{value_to_type_paths_of.tests.ts → value_to_type_paths_of_type.tests.ts} +26 -25
- package/types/specs/value_types_of_discriminated_union.tests.ts +6 -6
- package/types/strict_definitions.ts +3 -3
- package/types/type_of_type.ts +178 -0
- package/types/validating_definitions.ts +109 -0
- package/types/validating_type_def_with_error.ts +93 -0
- package/types/value_of_type.ts +84 -0
- package/types/{value_to_type_paths_of.ts → value_to_type_paths_of_type.ts} +30 -29
- package/types/value_types_of_discriminated_union.ts +4 -3
- package/validation/errors_of_validators.ts +10 -0
- package/validation/specs/errors_of_validators.tests.ts +20 -0
- package/validation/specs/validators_of_values.tests.ts +68 -0
- package/validation/validator.ts +103 -0
- package/validation/validators/defined_validator.ts +22 -0
- package/validation/validators/minimum_string_length_validator.ts +36 -0
- package/validation/validators_of_values.ts +17 -0
- package/.out/transformers/flatteners/flatten_accessors_of.d.ts +0 -5
- package/.out/transformers/flatteners/flatten_accessors_of.js +0 -11
- package/.out/transformers/flatteners/flatten_type_defs_of.js +0 -7
- package/.out/transformers/flatteners/flatten_value_types_of.d.ts +0 -3
- package/.out/transformers/flatteners/flatten_value_types_of.js +0 -7
- package/.out/transformers/flatteners/specs/flatten_type_defs_of.tests.js +0 -17
- package/.out/types/flattened_accessors_of.d.ts +0 -9
- package/.out/types/flattened_value_types_of.d.ts +0 -6
- package/.out/types/json_path_of.d.ts +0 -1
- package/.out/types/readonly_type_def_of.d.ts +0 -29
- package/.out/types/specs/flattened_value_types_of.tests.js +0 -11
- package/.out/types/value_type_of.d.ts +0 -24
- package/transformers/flatteners/specs/flatten_type_defs_of.tests.ts +0 -26
- package/types/flattened_value_types_of.ts +0 -11
- package/types/readonly_type_def_of.ts +0 -53
- package/types/specs/flattened_value_types_of.tests.ts +0 -21
- package/types/value_type_of.ts +0 -84
- /package/.out/transformers/flatteners/specs/{flatten_accessors_of.tests.d.ts → flatten_accessors_of_type.tests.d.ts} +0 -0
- /package/.out/transformers/flatteners/specs/{flatten_type_def_to.tests.d.ts → flatten_type_to.tests.d.ts} +0 -0
- /package/.out/transformers/flatteners/specs/{flatten_type_defs_of.tests.d.ts → flatten_types_of_type.tests.d.ts} +0 -0
- /package/.out/transformers/flatteners/specs/{flatten_value_type_to.tests.d.ts → flatten_validation_errors_of_type.tests.d.ts} +0 -0
- /package/.out/transformers/flatteners/specs/{flatten_value_types_of.tests.d.ts → flatten_value_to.tests.d.ts} +0 -0
- /package/.out/{types/flattened_accessors_of.js → transformers/flatteners/specs/flatten_values_of_type.tests.d.ts} +0 -0
- /package/.out/types/{flattened_type_defs_of.js → flattened_accessors_of_type.js} +0 -0
- /package/.out/types/{flattened_value_types_of.js → flattened_types_of_type.js} +0 -0
- /package/.out/types/{json_path_of.js → flattened_types_of_validating_type.js} +0 -0
- /package/.out/types/{json_paths_of.js → flattened_validators_of_validating_type.js} +0 -0
- /package/.out/types/{partial_type_def_of.js → flattened_values_of_type.js} +0 -0
- /package/.out/types/{mobx_value_type_of.js → mobx_value_of_type.js} +0 -0
- /package/.out/types/{readonly_type_def_of.js → partial_type_of_type.js} +0 -0
- /package/.out/types/{specs/flattened_accessors_of.tests.d.ts → path_of.js} +0 -0
- /package/.out/types/{specs/flattened_type_defs_of.tests.d.ts → paths_of_type.js} +0 -0
- /package/.out/types/{specs/flattened_value_types_of.tests.d.ts → readonly_type_of_type.js} +0 -0
- /package/.out/types/specs/{json_paths_of.tests.d.ts → flattened_accessors_of_type.tests.d.ts} +0 -0
- /package/.out/types/specs/{partial_type_def_of.tests.d.ts → flattened_types_of_type.tests.d.ts} +0 -0
- /package/.out/types/specs/{readonly_type_def_of.tests.d.ts → flattened_validators_of_validating_type.tests.d.ts} +0 -0
- /package/.out/types/specs/{value_to_type_paths_of.tests.d.ts → flattened_values_of_type.tests.d.ts} +0 -0
- /package/.out/types/specs/{value_type_of.tests.d.ts → partial_type_of_type.tests.d.ts} +0 -0
- /package/.out/types/{value_to_type_paths_of.js → specs/paths_of_type.tests.d.ts} +0 -0
- /package/.out/types/{value_type_of.js → specs/readonly_type_of_type.tests.d.ts} +0 -0
package/.out/index.d.ts
CHANGED
|
@@ -1,20 +1,26 @@
|
|
|
1
1
|
export * from './transformers/copies/copy';
|
|
2
2
|
export * from './transformers/copies/mobx_copy';
|
|
3
|
-
export * from './transformers/flatteners/
|
|
3
|
+
export * from './transformers/flatteners/flatten_accessors_of_type';
|
|
4
4
|
export * from './transformers/flatteners/flatten_json_value_to_type_paths_of';
|
|
5
|
-
export * from './transformers/flatteners/
|
|
6
|
-
export * from './transformers/flatteners/
|
|
5
|
+
export * from './transformers/flatteners/flatten_types_of_type';
|
|
6
|
+
export * from './transformers/flatteners/flatten_validators_of_validating_type';
|
|
7
|
+
export * from './transformers/flatteners/flatten_value_to';
|
|
8
|
+
export * from './transformers/flatteners/flatten_values_of_type';
|
|
7
9
|
export * from './transformers/flatteners/json_path';
|
|
8
10
|
export * from './transformers/flatteners/value_path_to_type_path';
|
|
9
11
|
export * from './types/builders';
|
|
10
12
|
export * from './types/definitions';
|
|
11
|
-
export * from './types/
|
|
12
|
-
export * from './types/
|
|
13
|
-
export * from './types/
|
|
14
|
-
export * from './types/
|
|
15
|
-
export * from './types/
|
|
16
|
-
export * from './types/
|
|
13
|
+
export * from './types/flattened_accessors_of_type';
|
|
14
|
+
export * from './types/flattened_types_of_type';
|
|
15
|
+
export * from './types/flattened_values_of_type';
|
|
16
|
+
export * from './types/mobx_value_of_type';
|
|
17
|
+
export * from './types/paths_of_type';
|
|
18
|
+
export * from './types/readonly_type_of_type';
|
|
17
19
|
export * from './types/strict_definitions';
|
|
18
|
-
export * from './types/
|
|
19
|
-
export * from './types/
|
|
20
|
+
export * from './types/value_of_type';
|
|
21
|
+
export * from './types/value_to_type_paths_of_type';
|
|
20
22
|
export * from './types/value_types_of_discriminated_union';
|
|
23
|
+
export * from './validation/validator';
|
|
24
|
+
export * from './validation/validators/defined_validator';
|
|
25
|
+
export * from './validation/validators/minimum_string_length_validator';
|
|
26
|
+
export * from './validation/validators_of_values';
|
package/.out/index.js
CHANGED
|
@@ -1,20 +1,26 @@
|
|
|
1
1
|
export * from './transformers/copies/copy';
|
|
2
2
|
export * from './transformers/copies/mobx_copy';
|
|
3
|
-
export * from './transformers/flatteners/
|
|
3
|
+
export * from './transformers/flatteners/flatten_accessors_of_type';
|
|
4
4
|
export * from './transformers/flatteners/flatten_json_value_to_type_paths_of';
|
|
5
|
-
export * from './transformers/flatteners/
|
|
6
|
-
export * from './transformers/flatteners/
|
|
5
|
+
export * from './transformers/flatteners/flatten_types_of_type';
|
|
6
|
+
export * from './transformers/flatteners/flatten_validators_of_validating_type';
|
|
7
|
+
export * from './transformers/flatteners/flatten_value_to';
|
|
8
|
+
export * from './transformers/flatteners/flatten_values_of_type';
|
|
7
9
|
export * from './transformers/flatteners/json_path';
|
|
8
10
|
export * from './transformers/flatteners/value_path_to_type_path';
|
|
9
11
|
export * from './types/builders';
|
|
10
12
|
export * from './types/definitions';
|
|
11
|
-
export * from './types/
|
|
12
|
-
export * from './types/
|
|
13
|
-
export * from './types/
|
|
14
|
-
export * from './types/
|
|
15
|
-
export * from './types/
|
|
16
|
-
export * from './types/
|
|
13
|
+
export * from './types/flattened_accessors_of_type';
|
|
14
|
+
export * from './types/flattened_types_of_type';
|
|
15
|
+
export * from './types/flattened_values_of_type';
|
|
16
|
+
export * from './types/mobx_value_of_type';
|
|
17
|
+
export * from './types/paths_of_type';
|
|
18
|
+
export * from './types/readonly_type_of_type';
|
|
17
19
|
export * from './types/strict_definitions';
|
|
18
|
-
export * from './types/
|
|
19
|
-
export * from './types/
|
|
20
|
+
export * from './types/value_of_type';
|
|
21
|
+
export * from './types/value_to_type_paths_of_type';
|
|
20
22
|
export * from './types/value_types_of_discriminated_union';
|
|
23
|
+
export * from './validation/validator';
|
|
24
|
+
export * from './validation/validators/defined_validator';
|
|
25
|
+
export * from './validation/validators/minimum_string_length_validator';
|
|
26
|
+
export * from './validation/validators_of_values';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type ReadonlyTypeOfType } from 'types/readonly_type_of_type';
|
|
2
2
|
import { type StrictType } from 'types/strict_definitions';
|
|
3
|
-
import { type
|
|
4
|
-
export declare function copy<T extends StrictType>(t: T, proto:
|
|
3
|
+
import { type ValueOfType } from 'types/value_of_type';
|
|
4
|
+
export declare function copy<T extends StrictType>(t: T, proto: ValueOfType<ReadonlyTypeOfType<T>>): ValueOfType<T>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type ReadonlyTypeOfType } from 'types/readonly_type_of_type';
|
|
2
2
|
import { type StrictType, type StrictTypeDef } from 'types/strict_definitions';
|
|
3
|
-
import { type
|
|
3
|
+
import { type ValueOfType } from 'types/value_of_type';
|
|
4
4
|
export type AnyValueType = any;
|
|
5
5
|
export type Copier<R> = (v: AnyValueType, t: StrictTypeDef) => R;
|
|
6
|
-
export declare function copyTo<T extends StrictType, R extends
|
|
6
|
+
export declare function copyTo<T extends StrictType, R extends ValueOfType<ReadonlyTypeOfType<T>>>({ definition }: T, value: ValueOfType<ReadonlyTypeOfType<T>>, copier: Copier<R>): R;
|
|
@@ -10,6 +10,10 @@ export function copyTo({ definition }, value, copier) {
|
|
|
10
10
|
* @returns a copy of the supplied value
|
|
11
11
|
*/
|
|
12
12
|
function internalCopyTo(definition, value, copier) {
|
|
13
|
+
if (value === undefined) {
|
|
14
|
+
// don't copy things that don't exist
|
|
15
|
+
return undefined;
|
|
16
|
+
}
|
|
13
17
|
switch (definition.type) {
|
|
14
18
|
case TypeDefType.Literal:
|
|
15
19
|
return copyLiteral(definition, value, copier);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import { type
|
|
1
|
+
import { type MobxValueOfType } from 'types/mobx_value_of_type';
|
|
2
|
+
import { type ReadonlyTypeOfType } from 'types/readonly_type_of_type';
|
|
3
3
|
import { type StrictType } from 'types/strict_definitions';
|
|
4
|
-
import { type
|
|
5
|
-
export declare function mobxCopy<T extends StrictType>(t: T, proto:
|
|
4
|
+
import { type ValueOfType } from 'types/value_of_type';
|
|
5
|
+
export declare function mobxCopy<T extends StrictType>(t: T, proto: ValueOfType<ReadonlyTypeOfType<T>>): MobxValueOfType<T>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { reduce, UnreachableError, } from '@strictly/base';
|
|
2
2
|
import { makeObservable, observable, } from 'mobx';
|
|
3
|
-
import { getUnionTypeDef } from 'transformers/flatteners/
|
|
3
|
+
import { getUnionTypeDef } from 'transformers/flatteners/flatten_value_to';
|
|
4
4
|
import { TypeDefType, } from 'types/definitions';
|
|
5
5
|
import { copyTo, } from './copy_to';
|
|
6
6
|
function observeValue(v, def) {
|
|
@@ -47,9 +47,9 @@ describe('copyTo', function () {
|
|
|
47
47
|
});
|
|
48
48
|
describe('object', function () {
|
|
49
49
|
const typeDef = object()
|
|
50
|
-
.
|
|
51
|
-
.
|
|
52
|
-
.
|
|
50
|
+
.field('a', numberType)
|
|
51
|
+
.field('b', booleanType)
|
|
52
|
+
.field('c', stringType);
|
|
53
53
|
it('copies', function () {
|
|
54
54
|
const c = copyTo(typeDef, {
|
|
55
55
|
a: 1,
|
|
@@ -66,9 +66,9 @@ describe('copyTo', function () {
|
|
|
66
66
|
describe('union', function () {
|
|
67
67
|
describe('non-discriminated', function () {
|
|
68
68
|
const typeDef = union()
|
|
69
|
-
.
|
|
70
|
-
.
|
|
71
|
-
.
|
|
69
|
+
.or('0', list(numberType))
|
|
70
|
+
.or('1', literal(['b']))
|
|
71
|
+
.or('2', literal([false]));
|
|
72
72
|
it('copies string literal', function () {
|
|
73
73
|
const c = copyTo(typeDef, 'b', toString);
|
|
74
74
|
expect(c).toEqual('"b"');
|
|
@@ -80,8 +80,8 @@ describe('copyTo', function () {
|
|
|
80
80
|
});
|
|
81
81
|
describe('discriminated', function () {
|
|
82
82
|
const typeDef = union('d')
|
|
83
|
-
.
|
|
84
|
-
.
|
|
83
|
+
.or('a', object().field('x', numberType))
|
|
84
|
+
.or('b', object().field('y', booleanType));
|
|
85
85
|
it('copies', function () {
|
|
86
86
|
const c = copyTo(typeDef, {
|
|
87
87
|
d: 'a',
|
|
@@ -3,7 +3,7 @@ import { numberType, object, } from 'types/builders';
|
|
|
3
3
|
describe('mobxCopy', function () {
|
|
4
4
|
describe('object', function () {
|
|
5
5
|
describe('optional field', function () {
|
|
6
|
-
const type = object().
|
|
6
|
+
const type = object().optionalField('n', numberType);
|
|
7
7
|
it('copies unpopulated', function () {
|
|
8
8
|
const v = {};
|
|
9
9
|
const c = mobxCopy(type, v);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type Type } from 'types/definitions';
|
|
2
|
+
import { type Accessor, type FlattenedAccessorsOfType } from 'types/flattened_accessors_of_type';
|
|
3
|
+
import { type ValueOfType } from 'types/value_of_type';
|
|
4
|
+
import { type Setter } from './flatten_value_to';
|
|
5
|
+
export declare function flattenAccessorsOfType<T extends Type, R extends Readonly<Record<string, Accessor<any>>> = FlattenedAccessorsOfType<T>>(t: T, value: ValueOfType<T>, setValue: Setter<ValueOfType<T>>): R;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { flattenValueTo, } from './flatten_value_to';
|
|
2
|
+
function mapAccessor(_t, value, set) {
|
|
3
|
+
return {
|
|
4
|
+
value,
|
|
5
|
+
set,
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
export function flattenAccessorsOfType(t, value, setValue) {
|
|
9
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10
|
+
return flattenValueTo(t, value, setValue, mapAccessor);
|
|
11
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type Type } from 'types/definitions';
|
|
2
|
-
import { type
|
|
3
|
-
export declare function flattenJsonValueToTypePathsOf<T extends Type, R extends Record<string, string | number | symbol>>(t: T, value:
|
|
2
|
+
import { type ValueOfType } from 'types/value_of_type';
|
|
3
|
+
export declare function flattenJsonValueToTypePathsOf<T extends Type, R extends Record<string, string | number | symbol>>(t: T, value: ValueOfType<T>): R;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { flattenValueTo, } from './flatten_value_to';
|
|
2
2
|
function mapTypePaths(_t, _value, _set, typePath) {
|
|
3
3
|
return typePath;
|
|
4
4
|
}
|
|
5
5
|
export function flattenJsonValueToTypePathsOf(t, value) {
|
|
6
6
|
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
7
|
-
return
|
|
7
|
+
return flattenValueTo(t, value, function () {
|
|
8
8
|
// do nothing
|
|
9
9
|
}, mapTypePaths);
|
|
10
10
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type StrictType, type StrictTypeDef } from 'types/strict_definitions';
|
|
2
2
|
export type AnyValueType = any;
|
|
3
3
|
export type Mapper<R> = (t: StrictTypeDef) => R;
|
|
4
|
-
export declare function
|
|
4
|
+
export declare function flattenTypeTo<M, R extends Readonly<Record<string, M>>>({ definition }: StrictType, mapper: Mapper<M>): R;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { reduce, UnreachableError, } from '@strictly/base';
|
|
2
2
|
import { TypeDefType, } from 'types/definitions';
|
|
3
3
|
import { jsonPath } from './json_path';
|
|
4
|
-
export function
|
|
4
|
+
export function flattenTypeTo({ definition }, mapper) {
|
|
5
5
|
const typeDefs = internalFlattenTypeDef('$', definition, {});
|
|
6
6
|
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
7
7
|
return reduce(typeDefs, function (acc, key, typeDef) {
|
package/.out/transformers/flatteners/{flatten_type_defs_of.d.ts → flatten_types_of_type.d.ts}
RENAMED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type Type } from 'types/definitions';
|
|
2
2
|
import { type StrictType } from 'types/strict_definitions';
|
|
3
|
-
export declare function
|
|
3
|
+
export declare function flattenTypesOfType<T extends StrictType>(t: T): Record<string, Type>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type ReadonlyDeep, type ValueOf } from 'type-fest';
|
|
2
|
+
import { type Type } from 'types/definitions';
|
|
3
|
+
import { type FlattenedTypesOfType } from 'types/flattened_types_of_type';
|
|
4
|
+
import { type FlattenedValuesOfType } from 'types/flattened_values_of_type';
|
|
5
|
+
import { type ReadonlyTypeOfType } from 'types/readonly_type_of_type';
|
|
6
|
+
import { type ValueOfType } from 'types/value_of_type';
|
|
7
|
+
import { type Validator } from 'validation/validator';
|
|
8
|
+
type ErrorOfValidator<V extends Validator> = V extends Validator<infer _V, infer E> ? E | null : never;
|
|
9
|
+
export type ErrorsOfFlattenedValidators<TypePathsToValidators extends Readonly<Record<string, Validator>>> = {
|
|
10
|
+
[K in keyof TypePathsToValidators]: ErrorOfValidator<TypePathsToValidators[K]>;
|
|
11
|
+
};
|
|
12
|
+
export type FlattenedTypePathsToValidatorsOf<FlattenedValues extends Readonly<Record<string, any>>, Context> = {
|
|
13
|
+
readonly [K in keyof FlattenedValues]?: Validator<ReadonlyDeep<FlattenedValues[K]>, any, any, Context>;
|
|
14
|
+
};
|
|
15
|
+
export type ValuePathsToValidatorsOf<TypePathsToAdapters extends Partial<Readonly<Record<string, Validator>>>, ValuePathsToTypePaths extends Readonly<Record<string, string>>> = keyof TypePathsToAdapters extends ValueOf<ValuePathsToTypePaths> ? {
|
|
16
|
+
readonly [K in keyof ValuePathsToTypePaths as unknown extends TypePathsToAdapters[ValuePathsToTypePaths[K]] ? never : K]: NonNullable<TypePathsToAdapters[ValuePathsToTypePaths[K]]>;
|
|
17
|
+
} : never;
|
|
18
|
+
export type FlattenedValidatorsOfType<T extends Type, Flattened extends Readonly<Record<string, Type>> = FlattenedTypesOfType<T, '*'>> = {
|
|
19
|
+
[K in keyof Flattened]: Validator;
|
|
20
|
+
};
|
|
21
|
+
export declare function flattenValidationErrorsOfType<T extends Type, ValueToTypePaths extends Readonly<Record<string, string>>, TypePathsToValidators extends FlattenedTypePathsToValidatorsOf<FlattenedValuesOfType<T, '*'>, ValueOfType<ReadonlyTypeOfType<T>>>, ValuePathsToValidators extends ValuePathsToValidatorsOf<TypePathsToValidators, ValueToTypePaths> = ValuePathsToValidatorsOf<TypePathsToValidators, ValueToTypePaths>>(type: T, value: ValueOfType<T>, validators: TypePathsToValidators): ErrorsOfFlattenedValidators<ValuePathsToValidators>;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { flattenValueTo, } from 'transformers/flatteners/flatten_value_to';
|
|
2
|
+
import { validate, } from 'validation/validator';
|
|
3
|
+
export function flattenValidationErrorsOfType(type, value, validators) {
|
|
4
|
+
return flattenValueTo(type, value, () => { }, function (_t, v, _setter, typePath, valuePath) {
|
|
5
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
6
|
+
const validator = validators[typePath];
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
8
|
+
return validator != null ? validate(validator, v, valuePath, value) : null;
|
|
9
|
+
});
|
|
10
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type FlattenedTypesOfValidatingType } from 'types/flattened_types_of_validating_type';
|
|
2
|
+
import { type FlattenedValidatorsOfValidatingType } from 'types/flattened_validators_of_validating_type';
|
|
3
|
+
import { type ValidatingType } from 'types/validating_definitions';
|
|
4
|
+
export declare function flattenValidatorsOfValidatingType<T extends ValidatingType, TypePathsToValuePaths extends Readonly<Record<keyof FlattenedTypes, string>>, FlattenedTypes extends Readonly<Record<string, ValidatingType>> = FlattenedTypesOfValidatingType<T, '*'>>(type: T): FlattenedValidatorsOfValidatingType<T, TypePathsToValuePaths, FlattenedTypes>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { flattenTypeTo } from './flatten_type_to';
|
|
2
|
+
export function flattenValidatorsOfValidatingType(type) {
|
|
3
|
+
return flattenTypeTo(type, function (definition) {
|
|
4
|
+
const { rule, readonly, required,
|
|
5
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
6
|
+
} = definition;
|
|
7
|
+
return {
|
|
8
|
+
annotations: function () {
|
|
9
|
+
return {
|
|
10
|
+
readonly,
|
|
11
|
+
required,
|
|
12
|
+
};
|
|
13
|
+
},
|
|
14
|
+
validate: rule,
|
|
15
|
+
};
|
|
16
|
+
});
|
|
17
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { type UnionTypeDef } from 'types/definitions';
|
|
2
|
-
import { type
|
|
2
|
+
import { type ReadonlyTypeOfType } from 'types/readonly_type_of_type';
|
|
3
3
|
import { type StrictType, type StrictTypeDef } from 'types/strict_definitions';
|
|
4
|
-
import { type
|
|
4
|
+
import { type ValueOfType } from 'types/value_of_type';
|
|
5
5
|
export type AnyValueType = any;
|
|
6
6
|
export type Setter<V> = (v: V) => void;
|
|
7
7
|
export type Mapper<R> = (t: StrictTypeDef, v: AnyValueType, setter: Setter<AnyValueType>, typePath: string, valuePath: string) => R;
|
|
8
|
-
export declare function
|
|
9
|
-
export declare function getUnionTypeDef<T extends UnionTypeDef>(typeDef: T, v:
|
|
8
|
+
export declare function flattenValueTo<T extends StrictType, M, R extends Readonly<Record<string, M>>>({ definition }: T, v: ValueOfType<T>, setter: Setter<ValueOfType<T>>, mapper: Mapper<M>): R;
|
|
9
|
+
export declare function getUnionTypeDef<T extends UnionTypeDef>(typeDef: T, v: ValueOfType<ReadonlyTypeOfType<{
|
|
10
10
|
definition: T;
|
|
11
11
|
}>>): any;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { reduce, UnreachableError, } from '@strictly/base';
|
|
2
2
|
import { TypeDefType, } from 'types/definitions';
|
|
3
3
|
import { jsonPath } from './json_path';
|
|
4
|
-
export function
|
|
4
|
+
export function flattenValueTo({ definition }, v, setter, mapper) {
|
|
5
5
|
const r = {};
|
|
6
6
|
internalFlattenValue('$', '$', definition, v, setter, mapper, r);
|
|
7
7
|
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
@@ -9,7 +9,12 @@ export function flattenValueTypeTo({ definition }, v, setter, mapper) {
|
|
|
9
9
|
}
|
|
10
10
|
function internalFlattenValue(valuePath, typePath, typeDef, v, setter, mapper, r) {
|
|
11
11
|
r[valuePath] = mapper(typeDef, v, setter, typePath, valuePath);
|
|
12
|
-
|
|
12
|
+
// assume undefined means the field is optional and not populated
|
|
13
|
+
// TODO: actually capture if field is optional in typedef (or in builder for creating validator)
|
|
14
|
+
if (v !== undefined) {
|
|
15
|
+
return internalFlattenValueChildren(valuePath, typePath, '', typeDef, v, mapper, r);
|
|
16
|
+
}
|
|
17
|
+
return r;
|
|
13
18
|
}
|
|
14
19
|
function internalFlattenValueChildren(valuePath, typePath, qualifier, typeDef, v, mapper, r) {
|
|
15
20
|
switch (typeDef.type) {
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { expectDefinedAndReturn } from '@strictly/base';
|
|
2
|
-
import {
|
|
2
|
+
import { flattenAccessorsOfType } from 'transformers/flatteners/flatten_accessors_of_type';
|
|
3
3
|
import { booleanType, list, numberType, object, } from 'types/builders';
|
|
4
4
|
import { vi, } from 'vitest';
|
|
5
|
-
describe('
|
|
5
|
+
describe('flattenAccessorsOfType', function () {
|
|
6
6
|
let setter;
|
|
7
7
|
const builder = object()
|
|
8
|
-
.
|
|
9
|
-
.
|
|
10
|
-
.narrow;
|
|
8
|
+
.field('a', list(numberType))
|
|
9
|
+
.field('b', booleanType);
|
|
11
10
|
let flattened;
|
|
12
11
|
let value;
|
|
13
12
|
beforeEach(function () {
|
|
@@ -20,7 +19,7 @@ describe('flattenAccessorsOf', function () {
|
|
|
20
19
|
],
|
|
21
20
|
b: false,
|
|
22
21
|
};
|
|
23
|
-
flattened =
|
|
22
|
+
flattened = flattenAccessorsOfType(builder, value, setter);
|
|
24
23
|
});
|
|
25
24
|
// note that we already have tests for the type and the function that this calls, so
|
|
26
25
|
// this is only a sanity check
|
|
@@ -40,8 +40,8 @@ describe('flattenJsonValueToTypePathsOf', function () {
|
|
|
40
40
|
});
|
|
41
41
|
describe('object', function () {
|
|
42
42
|
const typeDef = object()
|
|
43
|
-
.
|
|
44
|
-
.
|
|
43
|
+
.field('a', numberType)
|
|
44
|
+
.field('b', booleanType);
|
|
45
45
|
const flattened = flattenJsonValueToTypePathsOf(typeDef, {
|
|
46
46
|
a: 1,
|
|
47
47
|
b: true,
|
|
@@ -57,8 +57,8 @@ describe('flattenJsonValueToTypePathsOf', function () {
|
|
|
57
57
|
describe('union', function () {
|
|
58
58
|
describe('non-discriminated', function () {
|
|
59
59
|
const typeDef = union()
|
|
60
|
-
.
|
|
61
|
-
.
|
|
60
|
+
.or('a', list(numberType))
|
|
61
|
+
.or('b', nullType);
|
|
62
62
|
const flattened = flattenJsonValueToTypePathsOf(typeDef, [
|
|
63
63
|
1,
|
|
64
64
|
2,
|
|
@@ -75,8 +75,8 @@ describe('flattenJsonValueToTypePathsOf', function () {
|
|
|
75
75
|
});
|
|
76
76
|
describe('discriminated', function () {
|
|
77
77
|
const typeDef = union('d')
|
|
78
|
-
.
|
|
79
|
-
.
|
|
78
|
+
.or('x', object().field('a', numberType).field('b', booleanType))
|
|
79
|
+
.or('y', object().field('c', stringType).field('d', booleanType));
|
|
80
80
|
const flattened = flattenJsonValueToTypePathsOf(typeDef, {
|
|
81
81
|
d: 'x',
|
|
82
82
|
a: 1,
|
package/.out/transformers/flatteners/specs/{flatten_type_def_to.tests.js → flatten_type_to.tests.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { flattenTypeTo } from 'transformers/flatteners/flatten_type_to';
|
|
2
2
|
import { booleanType, list, nullType, numberType, object, record, union, } from 'types/builders';
|
|
3
3
|
import { TypeDefType, } from 'types/definitions';
|
|
4
4
|
import { vi, } from 'vitest';
|
|
@@ -12,7 +12,7 @@ describe('flattenTypeDefTo', function () {
|
|
|
12
12
|
});
|
|
13
13
|
describe('literal', function () {
|
|
14
14
|
beforeEach(function () {
|
|
15
|
-
flattened =
|
|
15
|
+
flattened = flattenTypeTo(numberType, toTypeDefType);
|
|
16
16
|
});
|
|
17
17
|
it('equals expected type', function () {
|
|
18
18
|
expect(flattened).toEqual({
|
|
@@ -26,7 +26,7 @@ describe('flattenTypeDefTo', function () {
|
|
|
26
26
|
describe('list', function () {
|
|
27
27
|
const type = list(numberType);
|
|
28
28
|
beforeEach(function () {
|
|
29
|
-
flattened =
|
|
29
|
+
flattened = flattenTypeTo(type, toTypeDefType);
|
|
30
30
|
});
|
|
31
31
|
it('equals expected type', function () {
|
|
32
32
|
expect(flattened).toEqual({
|
|
@@ -41,7 +41,7 @@ describe('flattenTypeDefTo', function () {
|
|
|
41
41
|
describe('record', function () {
|
|
42
42
|
const type = record(numberType);
|
|
43
43
|
beforeEach(function () {
|
|
44
|
-
flattened =
|
|
44
|
+
flattened = flattenTypeTo(type, toTypeDefType);
|
|
45
45
|
});
|
|
46
46
|
it('equals expected type', function () {
|
|
47
47
|
expect(flattened).toEqual({
|
|
@@ -54,9 +54,11 @@ describe('flattenTypeDefTo', function () {
|
|
|
54
54
|
});
|
|
55
55
|
});
|
|
56
56
|
describe('object', function () {
|
|
57
|
-
const type = object()
|
|
57
|
+
const type = object()
|
|
58
|
+
.field('a', numberType)
|
|
59
|
+
.field('b', list(booleanType));
|
|
58
60
|
beforeEach(function () {
|
|
59
|
-
flattened =
|
|
61
|
+
flattened = flattenTypeTo(type, toTypeDefType);
|
|
60
62
|
});
|
|
61
63
|
it('equals expected type', function () {
|
|
62
64
|
expect(flattened).toEqual({
|
|
@@ -73,11 +75,11 @@ describe('flattenTypeDefTo', function () {
|
|
|
73
75
|
describe('union', function () {
|
|
74
76
|
describe('non-discriminated', function () {
|
|
75
77
|
const type = union()
|
|
76
|
-
.
|
|
77
|
-
.
|
|
78
|
-
.
|
|
78
|
+
.or('a', nullType)
|
|
79
|
+
.or('b', booleanType)
|
|
80
|
+
.or('c', numberType);
|
|
79
81
|
beforeEach(function () {
|
|
80
|
-
flattened =
|
|
82
|
+
flattened = flattenTypeTo(type, toTypeDefType);
|
|
81
83
|
});
|
|
82
84
|
it('equals expected type', function () {
|
|
83
85
|
expect(flattened).toEqual({
|
|
@@ -90,10 +92,10 @@ describe('flattenTypeDefTo', function () {
|
|
|
90
92
|
});
|
|
91
93
|
describe('discriminated', function () {
|
|
92
94
|
const type = union('d')
|
|
93
|
-
.
|
|
94
|
-
.
|
|
95
|
+
.or('a', object().field('a', booleanType))
|
|
96
|
+
.or('b', object().field('b', numberType));
|
|
95
97
|
beforeEach(function () {
|
|
96
|
-
flattened =
|
|
98
|
+
flattened = flattenTypeTo(type, toTypeDefType);
|
|
97
99
|
});
|
|
98
100
|
it('equals expected type', function () {
|
|
99
101
|
expect(flattened).toEqual({
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { flattenTypesOfType } from 'transformers/flatteners/flatten_types_of_type';
|
|
2
|
+
import { booleanType, list, numberType, object, } from 'types/builders';
|
|
3
|
+
describe('flattenTypeDefsOf', function () {
|
|
4
|
+
it('flattens', function () {
|
|
5
|
+
const listTypeDef = list(numberType);
|
|
6
|
+
const structTypeDef = object()
|
|
7
|
+
.field('a', listTypeDef)
|
|
8
|
+
.field('b', booleanType)
|
|
9
|
+
._type;
|
|
10
|
+
const flattened = flattenTypesOfType(structTypeDef);
|
|
11
|
+
expect(flattened).toEqual({
|
|
12
|
+
$: structTypeDef,
|
|
13
|
+
'$.a': listTypeDef._type,
|
|
14
|
+
'$.a.*': numberType._type,
|
|
15
|
+
'$.b': booleanType._type,
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { flattenValidationErrorsOfType } from 'transformers/flatteners/flatten_validation_errors_of_type';
|
|
2
|
+
import { literal } from 'types/builders';
|
|
3
|
+
describe('flattenValidationsOfType', function () {
|
|
4
|
+
describe('literal', function () {
|
|
5
|
+
const type = literal();
|
|
6
|
+
describe('failures', function () {
|
|
7
|
+
const validators = {
|
|
8
|
+
$: () => 'error',
|
|
9
|
+
};
|
|
10
|
+
const errors = flattenValidationErrorsOfType(type, 'a', validators);
|
|
11
|
+
it('reports an error', function () {
|
|
12
|
+
expect(errors.$).toBe('error');
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
describe('success', function () {
|
|
16
|
+
const validators = {
|
|
17
|
+
$: () => null,
|
|
18
|
+
};
|
|
19
|
+
const errors = flattenValidationErrorsOfType(type, 'a', validators);
|
|
20
|
+
it('reports no error', function () {
|
|
21
|
+
expect(errors.$).toBe(null);
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
});
|