@strictly/define 0.0.30 → 0.0.32
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 +26 -26
- package/.out/index.js +26 -26
- package/.out/transformers/copies/copy.d.ts +3 -3
- package/.out/transformers/copies/copy.js +1 -1
- package/.out/transformers/copies/{copy_to.d.ts → copyTo.d.ts} +3 -3
- package/.out/transformers/copies/{copy_to.js → copyTo.js} +2 -3
- package/.out/transformers/copies/mobxCopy.d.ts +5 -0
- package/.out/transformers/copies/{mobx_copy.js → mobxCopy.js} +5 -5
- package/.out/transformers/copies/specs/{copy_to.tests.js → copyTo.tests.js} +3 -3
- package/.out/transformers/copies/specs/{mobx_copy.tests.js → mobxCopy.tests.js} +1 -1
- package/.out/transformers/equals.d.ts +2 -2
- package/.out/transformers/equals.js +1 -1
- package/.out/transformers/flatteners/{flatten_accessors_of_type.d.ts → flattenAccessorsOfType.d.ts} +4 -4
- package/.out/transformers/flatteners/{flatten_accessors_of_type.js → flattenAccessorsOfType.js} +1 -1
- package/.out/transformers/flatteners/{flatten_json_value_to_type_paths_of.d.ts → flattenJsonValueToTypePathsOf.d.ts} +2 -2
- package/.out/transformers/flatteners/{flatten_json_value_to_type_paths_of.js → flattenJsonValueToTypePathsOf.js} +1 -1
- package/.out/transformers/flatteners/{flatten_type_to.d.ts → flattenTypeTo.d.ts} +1 -1
- package/.out/transformers/flatteners/{flatten_type_to.js → flattenTypeTo.js} +2 -2
- package/.out/transformers/flatteners/flattenTypesOfType.d.ts +3 -0
- package/.out/transformers/flatteners/{flatten_types_of_type.js → flattenTypesOfType.js} +1 -1
- package/.out/transformers/flatteners/{flatten_validation_errors_of_type.d.ts → flattenValidationErrorsOfType.d.ts} +5 -5
- package/.out/transformers/flatteners/{flatten_validation_errors_of_type.js → flattenValidationErrorsOfType.js} +1 -1
- package/.out/transformers/flatteners/{flatten_validators_of_validating_type.d.ts → flattenValidatorsOfValidatingType.d.ts} +3 -3
- package/.out/transformers/flatteners/{flatten_validators_of_validating_type.js → flattenValidatorsOfValidatingType.js} +1 -1
- package/.out/transformers/flatteners/{flatten_value_to.d.ts → flattenValueTo.d.ts} +5 -5
- package/.out/transformers/flatteners/{flatten_value_to.js → flattenValueTo.js} +2 -2
- package/.out/transformers/flatteners/{flatten_values_of_type.d.ts → flattenValuesOfType.d.ts} +2 -2
- package/.out/transformers/flatteners/{flatten_values_of_type.js → flattenValuesOfType.js} +1 -1
- package/.out/transformers/flatteners/specs/{flatten_accessors_of_type.tests.js → flattenAccessorsOfType.tests.js} +1 -1
- package/.out/transformers/flatteners/specs/{flatten_json_value_to_type_paths_of.tests.js → flattenJsonValueToTypePathsOf.tests.js} +2 -1
- package/.out/transformers/flatteners/specs/{flatten_type_to.tests.js → flattenTypeTo.tests.js} +5 -3
- package/.out/transformers/flatteners/specs/{flatten_types_of_type.tests.js → flattenTypesOfType.tests.js} +1 -1
- package/.out/transformers/flatteners/specs/{flatten_validation_errors_of_type.tests.js → flattenValidationErrorsOfType.tests.js} +1 -1
- package/.out/transformers/flatteners/specs/{flatten_value_to.tests.js → flattenValueTo.tests.js} +2 -1
- package/.out/transformers/flatteners/specs/{flatten_values_of_type.tests.js → flattenValuesOfType.tests.js} +1 -1
- package/.out/transformers/flatteners/specs/{json_paths.tests.js → jsonPaths.tests.js} +1 -1
- package/.out/transformers/flatteners/specs/{value_path_to_type_path.tests.js → valuePathToTypePath.tests.js} +1 -1
- package/.out/transformers/flatteners/{value_path_to_type_path.d.ts → valuePathToTypePath.d.ts} +1 -1
- package/.out/transformers/flatteners/{value_path_to_type_path.js → valuePathToTypePath.js} +1 -1
- package/.out/tsconfig.tsbuildinfo +1 -1
- package/.out/types/{flattened_accessors_of_type.d.ts → FlattenedAccessorsOfType.d.ts} +2 -2
- package/.out/types/{flattened_types_of_type.d.ts → FlattenedTypesOfType.d.ts} +2 -2
- package/.out/types/{flattened_types_of_validating_type.d.ts → FlattenedTypesOfValidatingType.d.ts} +3 -3
- package/.out/types/{flattened_validators_of_validating_type.d.ts → FlattenedValidatorsOfValidatingType.d.ts} +4 -4
- package/.out/types/{flattened_values_of_type.d.ts → FlattenedValuesOfType.d.ts} +3 -3
- package/.out/types/{mobx_value_of_type.d.ts → MobxValueOfType.d.ts} +2 -2
- package/.out/types/{partial_type_of_type.d.ts → PartialTypeOfType.d.ts} +1 -1
- package/.out/types/{paths_of_type.d.ts → PathsOfType.d.ts} +2 -2
- package/.out/types/{readonly_type_of_type.d.ts → ReadonlyTypeOfType.d.ts} +1 -1
- package/.out/types/{strict_definitions.d.ts → StrictType.d.ts} +1 -1
- package/.out/types/{validating_definitions.d.ts → ValidatingType.d.ts} +1 -1
- package/.out/types/{validating_type_def_with_error.d.ts → ValidatingTypeDefWithError.d.ts} +2 -2
- package/.out/types/{value_of_type.d.ts → ValueOfType.d.ts} +1 -1
- package/.out/types/{value_to_type_paths_of_type.d.ts → ValueToTypePathsOfType.d.ts} +3 -3
- package/.out/types/{value_types_of_discriminated_union.d.ts → ValueTypesOfDiscriminatedUnion.d.ts} +3 -3
- package/.out/types/builders.d.ts +5 -5
- package/.out/types/builders.js +26 -4
- package/.out/types/flattened.d.ts +1 -1
- package/.out/types/specs/builder.tests.js +1 -1
- package/.out/types/{type_of_type.d.ts → typeOfType.d.ts} +1 -1
- package/.out/types/{type_of_type.js → typeOfType.js} +1 -1
- package/.out/validation/validator.js +1 -1
- package/.out/validation/validators/specs/{minimum_string_length_validator.tests.js → minimumStringLengthValidator.tests.js} +1 -1
- package/.out/validation/validators/specs/{regexp_validator.tests.js → regexpValidator.tests.js} +1 -1
- package/.turbo/turbo-build.log +8 -8
- package/.turbo/turbo-check-types.log +1 -1
- package/.turbo/turbo-release$colon$exports.log +1 -1
- package/dist/index.cjs +56 -33
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +59 -34
- package/index.ts +26 -26
- package/package.json +1 -1
- package/transformers/copies/copy.ts +4 -4
- package/transformers/copies/{copy_to.ts → copyTo.ts} +10 -18
- package/transformers/copies/{mobx_copy.ts → mobxCopy.ts} +11 -12
- package/transformers/copies/specs/{copy_to.tests.ts → copyTo.tests.ts} +4 -4
- package/transformers/copies/specs/{mobx_copy.tests.ts → mobxCopy.tests.ts} +2 -2
- package/transformers/equals.ts +2 -2
- package/transformers/flatteners/{flatten_accessors_of_type.ts → flattenAccessorsOfType.ts} +7 -7
- package/transformers/flatteners/{flatten_json_value_to_type_paths_of.ts → flattenJsonValueToTypePathsOf.ts} +3 -3
- package/transformers/flatteners/{flatten_type_to.ts → flattenTypeTo.ts} +3 -5
- package/transformers/flatteners/{flatten_types_of_type.ts → flattenTypesOfType.ts} +3 -3
- package/transformers/flatteners/{flatten_validation_errors_of_type.ts → flattenValidationErrorsOfType.ts} +8 -8
- package/transformers/flatteners/{flatten_validators_of_validating_type.ts → flattenValidatorsOfValidatingType.ts} +4 -4
- package/transformers/flatteners/{flatten_value_to.ts → flattenValueTo.ts} +10 -10
- package/transformers/flatteners/{flatten_values_of_type.ts → flattenValuesOfType.ts} +4 -4
- package/transformers/flatteners/specs/{flatten_accessors_of_type.tests.ts → flattenAccessorsOfType.tests.ts} +3 -3
- package/transformers/flatteners/specs/{flatten_json_value_to_type_paths_of.tests.ts → flattenJsonValueToTypePathsOf.tests.ts} +2 -1
- package/transformers/flatteners/specs/{flatten_type_to.tests.ts → flattenTypeTo.tests.ts} +5 -3
- package/transformers/flatteners/specs/{flatten_types_of_type.tests.ts → flattenTypesOfType.tests.ts} +1 -1
- package/transformers/flatteners/specs/{flatten_validation_errors_of_type.tests.ts → flattenValidationErrorsOfType.tests.ts} +2 -2
- package/transformers/flatteners/specs/{flatten_value_to.tests.ts → flattenValueTo.tests.ts} +5 -4
- package/transformers/flatteners/specs/{flatten_values_of_type.tests.ts → flattenValuesOfType.tests.ts} +1 -1
- package/transformers/flatteners/specs/{json_paths.tests.ts → jsonPaths.tests.ts} +1 -1
- package/transformers/flatteners/specs/{value_path_to_type_path.tests.ts → valuePathToTypePath.tests.ts} +2 -2
- package/transformers/flatteners/{value_path_to_type_path.ts → valuePathToTypePath.ts} +1 -1
- package/types/{flattened_accessors_of_type.ts → FlattenedAccessorsOfType.ts} +2 -2
- package/types/{flattened_types_of_type.ts → FlattenedTypesOfType.ts} +6 -6
- package/types/{flattened_types_of_validating_type.ts → FlattenedTypesOfValidatingType.ts} +6 -6
- package/types/{flattened_validators_of_validating_type.ts → FlattenedValidatorsOfValidatingType.ts} +4 -4
- package/types/{flattened_values_of_type.ts → FlattenedValuesOfType.ts} +3 -3
- package/types/{mobx_value_of_type.ts → MobxValueOfType.ts} +2 -2
- package/types/{partial_type_of_type.ts → PartialTypeOfType.ts} +1 -1
- package/types/{paths_of_type.ts → PathsOfType.ts} +6 -6
- package/types/{readonly_type_of_type.ts → ReadonlyTypeOfType.ts} +1 -1
- package/types/{strict_definitions.ts → StrictType.ts} +1 -1
- package/types/{validating_definitions.ts → ValidatingType.ts} +1 -1
- package/types/{validating_type_def_with_error.ts → ValidatingTypeDefWithError.ts} +2 -2
- package/types/{value_of_type.ts → ValueOfType.ts} +1 -1
- package/types/{value_to_type_paths_of_type.ts → ValueToTypePathsOfType.ts} +7 -7
- package/types/{value_types_of_discriminated_union.ts → ValueTypesOfDiscriminatedUnion.ts} +3 -3
- package/types/builders.ts +44 -6
- package/types/flattened.ts +1 -1
- package/types/specs/{flattened_accessors_of_type.tests.ts → FlattenedAccessorsOfType.tests.ts} +1 -1
- package/types/specs/{flattened_types_of_type.tests.ts → FlattenedTypesOfType.tests.ts} +2 -2
- package/types/specs/{flattened_validators_of_validating_type.tests.ts → FlattenedValidatorsOfValidatingType.tests.ts} +2 -2
- package/types/specs/{flattened_values_of_type.tests.ts → FlattenedValuesOfType.tests.ts} +1 -1
- package/types/specs/{partial_type_of_type.tests.ts → PartialTypeOfType.tests.ts} +2 -2
- package/types/specs/{paths_of_type.tests.ts → PathsOfType.tests.ts} +1 -1
- package/types/specs/{readonly_type_of_type.tests.ts → ReadonlyTypeOfType.tests.ts} +2 -2
- package/types/specs/{strict_definitions.tests.ts → StrictType.tests.ts} +5 -5
- package/types/specs/{type_of_type.tests.ts → TypeOfType.tests.ts} +2 -2
- package/types/specs/{value_of_type.tests.ts → ValueOfType.tests.ts} +2 -2
- package/types/specs/{value_to_type_paths_of_type.tests.ts → ValueToTypePathsOfType.tests.ts} +2 -2
- package/types/specs/{value_types_of_discriminated_union.tests.ts → ValueTypesOfDiscriminatedUnion.tests.ts} +1 -1
- package/types/specs/builder.tests.ts +2 -2
- package/types/{type_of_type.ts → typeOfType.ts} +1 -1
- package/validation/specs/{errors_of_validators.tests.ts → errorsOfValidators.tests.ts} +1 -1
- package/validation/specs/{validators_of_values.tests.ts → validatorsOfValues.tests.ts} +1 -1
- package/validation/validator.ts +1 -1
- package/validation/validators/specs/{minimum_string_length_validator.tests.ts → minimumStringLengthValidator.tests.ts} +1 -1
- package/validation/validators/specs/{regexp_validator.tests.ts → regexpValidator.tests.ts} +1 -1
- package/.out/transformers/copies/mobx_copy.d.ts +0 -5
- package/.out/transformers/flatteners/flatten_types_of_type.d.ts +0 -3
- /package/.out/transformers/copies/specs/{copy_to.tests.d.ts → copyTo.tests.d.ts} +0 -0
- /package/.out/transformers/copies/specs/{mobx_copy.tests.d.ts → mobxCopy.tests.d.ts} +0 -0
- /package/.out/transformers/flatteners/{json_path.d.ts → jsonPath.d.ts} +0 -0
- /package/.out/transformers/flatteners/{json_path.js → jsonPath.js} +0 -0
- /package/.out/transformers/flatteners/specs/{flatten_accessors_of_type.tests.d.ts → flattenAccessorsOfType.tests.d.ts} +0 -0
- /package/.out/transformers/flatteners/specs/{flatten_json_value_to_type_paths_of.tests.d.ts → flattenJsonValueToTypePathsOf.tests.d.ts} +0 -0
- /package/.out/transformers/flatteners/specs/{flatten_type_to.tests.d.ts → flattenTypeTo.tests.d.ts} +0 -0
- /package/.out/transformers/flatteners/specs/{flatten_types_of_type.tests.d.ts → flattenTypesOfType.tests.d.ts} +0 -0
- /package/.out/transformers/flatteners/specs/{flatten_validation_errors_of_type.tests.d.ts → flattenValidationErrorsOfType.tests.d.ts} +0 -0
- /package/.out/transformers/flatteners/specs/{flatten_value_to.tests.d.ts → flattenValueTo.tests.d.ts} +0 -0
- /package/.out/transformers/flatteners/specs/{flatten_values_of_type.tests.d.ts → flattenValuesOfType.tests.d.ts} +0 -0
- /package/.out/transformers/flatteners/specs/{json_paths.tests.d.ts → jsonPaths.tests.d.ts} +0 -0
- /package/.out/transformers/flatteners/specs/{value_path_to_type_path.tests.d.ts → valuePathToTypePath.tests.d.ts} +0 -0
- /package/.out/types/{flattened_accessors_of_type.js → FlattenedAccessorsOfType.js} +0 -0
- /package/.out/types/{flattened_types_of_type.js → FlattenedTypesOfType.js} +0 -0
- /package/.out/types/{flattened_types_of_validating_type.js → FlattenedTypesOfValidatingType.js} +0 -0
- /package/.out/types/{flattened_validators_of_validating_type.js → FlattenedValidatorsOfValidatingType.js} +0 -0
- /package/.out/types/{flattened_values_of_type.js → FlattenedValuesOfType.js} +0 -0
- /package/.out/types/{mobx_value_of_type.js → MobxValueOfType.js} +0 -0
- /package/.out/types/{partial_type_of_type.js → PartialTypeOfType.js} +0 -0
- /package/.out/types/{path_of.d.ts → PathOf.d.ts} +0 -0
- /package/.out/types/{path_of.js → PathOf.js} +0 -0
- /package/.out/types/{paths_of_type.js → PathsOfType.js} +0 -0
- /package/.out/types/{readonly_type_of_type.js → ReadonlyTypeOfType.js} +0 -0
- /package/.out/types/{specs/flattened_accessors_of_type.tests.d.ts → StrictType.js} +0 -0
- /package/.out/types/{definitions.d.ts → Type.d.ts} +0 -0
- /package/.out/types/{definitions.js → Type.js} +0 -0
- /package/.out/types/{specs/flattened_types_of_type.tests.d.ts → ValidatingType.js} +0 -0
- /package/.out/types/{specs/flattened_validators_of_validating_type.tests.d.ts → ValidatingTypeDefWithError.js} +0 -0
- /package/.out/types/{specs/flattened_values_of_type.tests.d.ts → ValueOfType.js} +0 -0
- /package/.out/types/{specs/partial_type_of_type.tests.d.ts → ValueToTypePathsOfType.js} +0 -0
- /package/.out/types/{specs/paths_of_type.tests.d.ts → ValueTypesOfDiscriminatedUnion.js} +0 -0
- /package/.out/types/specs/{readonly_type_of_type.tests.d.ts → FlattenedAccessorsOfType.tests.d.ts} +0 -0
- /package/.out/types/specs/{flattened_accessors_of_type.tests.js → FlattenedAccessorsOfType.tests.js} +0 -0
- /package/.out/types/specs/{strict_definitions.tests.d.ts → FlattenedTypesOfType.tests.d.ts} +0 -0
- /package/.out/types/specs/{flattened_types_of_type.tests.js → FlattenedTypesOfType.tests.js} +0 -0
- /package/.out/types/specs/{type_of_type.tests.d.ts → FlattenedValidatorsOfValidatingType.tests.d.ts} +0 -0
- /package/.out/types/specs/{flattened_validators_of_validating_type.tests.js → FlattenedValidatorsOfValidatingType.tests.js} +0 -0
- /package/.out/types/specs/{value_of_type.tests.d.ts → FlattenedValuesOfType.tests.d.ts} +0 -0
- /package/.out/types/specs/{flattened_values_of_type.tests.js → FlattenedValuesOfType.tests.js} +0 -0
- /package/.out/types/specs/{value_to_type_paths_of_type.tests.d.ts → PartialTypeOfType.tests.d.ts} +0 -0
- /package/.out/types/specs/{partial_type_of_type.tests.js → PartialTypeOfType.tests.js} +0 -0
- /package/.out/types/specs/{value_types_of_discriminated_union.tests.d.ts → PathsOfType.tests.d.ts} +0 -0
- /package/.out/types/specs/{paths_of_type.tests.js → PathsOfType.tests.js} +0 -0
- /package/.out/types/{strict_definitions.js → specs/ReadonlyTypeOfType.tests.d.ts} +0 -0
- /package/.out/types/specs/{readonly_type_of_type.tests.js → ReadonlyTypeOfType.tests.js} +0 -0
- /package/.out/types/{validating_definitions.js → specs/StrictType.tests.d.ts} +0 -0
- /package/.out/types/specs/{strict_definitions.tests.js → StrictType.tests.js} +0 -0
- /package/.out/types/{validating_type_def_with_error.js → specs/TypeOfType.tests.d.ts} +0 -0
- /package/.out/types/specs/{type_of_type.tests.js → TypeOfType.tests.js} +0 -0
- /package/.out/types/{value_of_type.js → specs/ValueOfType.tests.d.ts} +0 -0
- /package/.out/types/specs/{value_of_type.tests.js → ValueOfType.tests.js} +0 -0
- /package/.out/types/{value_to_type_paths_of_type.js → specs/ValueToTypePathsOfType.tests.d.ts} +0 -0
- /package/.out/types/specs/{value_to_type_paths_of_type.tests.js → ValueToTypePathsOfType.tests.js} +0 -0
- /package/.out/types/{value_types_of_discriminated_union.js → specs/ValueTypesOfDiscriminatedUnion.tests.d.ts} +0 -0
- /package/.out/types/specs/{value_types_of_discriminated_union.tests.js → ValueTypesOfDiscriminatedUnion.tests.js} +0 -0
- /package/.out/validation/{errors_of_validators.d.ts → ErrorsOfValidators.d.ts} +0 -0
- /package/.out/validation/{errors_of_validators.js → ErrorsOfValidators.js} +0 -0
- /package/.out/validation/{validators_of_values.d.ts → ValidatorsOfValues.d.ts} +0 -0
- /package/.out/validation/{specs/errors_of_validators.tests.d.ts → ValidatorsOfValues.js} +0 -0
- /package/.out/validation/specs/{validators_of_values.tests.d.ts → errorsOfValidators.tests.d.ts} +0 -0
- /package/.out/validation/specs/{errors_of_validators.tests.js → errorsOfValidators.tests.js} +0 -0
- /package/.out/validation/{validators/specs/minimum_string_length_validator.tests.d.ts → specs/validatorsOfValues.tests.d.ts} +0 -0
- /package/.out/validation/specs/{validators_of_values.tests.js → validatorsOfValues.tests.js} +0 -0
- /package/.out/validation/validators/{composite_validator.d.ts → CompositeValidator.d.ts} +0 -0
- /package/.out/validation/validators/{composite_validator.js → CompositeValidator.js} +0 -0
- /package/.out/validation/validators/{defined_validator.d.ts → DefinedValidator.d.ts} +0 -0
- /package/.out/validation/validators/{defined_validator.js → DefinedValidator.js} +0 -0
- /package/.out/validation/validators/{maximum_string_length_validator.d.ts → MaximumStringLengthValidator.d.ts} +0 -0
- /package/.out/validation/validators/{maximum_string_length_validator.js → MaximumStringLengthValidator.js} +0 -0
- /package/.out/validation/validators/{minimum_string_length_validator.d.ts → MinimumStringLengthValidator.d.ts} +0 -0
- /package/.out/validation/validators/{minimum_string_length_validator.js → MinimumStringLengthValidator.js} +0 -0
- /package/.out/validation/validators/{optional_validator_proxy.d.ts → OptionalValidatorProxy.d.ts} +0 -0
- /package/.out/validation/validators/{optional_validator_proxy.js → OptionalValidatorProxy.js} +0 -0
- /package/.out/validation/validators/{regexp_validator.d.ts → RegexpValidator.d.ts} +0 -0
- /package/.out/validation/validators/{regexp_validator.js → RegexpValidator.js} +0 -0
- /package/.out/validation/validators/specs/{regexp_validator.tests.d.ts → minimumStringLengthValidator.tests.d.ts} +0 -0
- /package/.out/validation/{validators_of_values.js → validators/specs/regexpValidator.tests.d.ts} +0 -0
- /package/transformers/flatteners/{json_path.ts → jsonPath.ts} +0 -0
- /package/types/{path_of.ts → PathOf.ts} +0 -0
- /package/types/{definitions.ts → Type.ts} +0 -0
- /package/validation/{errors_of_validators.ts → ErrorsOfValidators.ts} +0 -0
- /package/validation/{validators_of_values.ts → ValidatorsOfValues.ts} +0 -0
- /package/validation/validators/{composite_validator.ts → CompositeValidator.ts} +0 -0
- /package/validation/validators/{defined_validator.ts → DefinedValidator.ts} +0 -0
- /package/validation/validators/{maximum_string_length_validator.ts → MaximumStringLengthValidator.ts} +0 -0
- /package/validation/validators/{minimum_string_length_validator.ts → MinimumStringLengthValidator.ts} +0 -0
- /package/validation/validators/{optional_validator_proxy.ts → OptionalValidatorProxy.ts} +0 -0
- /package/validation/validators/{regexp_validator.ts → RegexpValidator.ts} +0 -0
package/dist/index.js
CHANGED
|
@@ -19,7 +19,7 @@ var __spreadValues = (a, b) => {
|
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
20
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
21
21
|
|
|
22
|
-
// transformers/copies/
|
|
22
|
+
// transformers/copies/copyTo.ts
|
|
23
23
|
import {
|
|
24
24
|
map,
|
|
25
25
|
reduce,
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
UnreachableError
|
|
28
28
|
} from "@strictly/base";
|
|
29
29
|
|
|
30
|
-
// types/
|
|
30
|
+
// types/Type.ts
|
|
31
31
|
var TypeDefType = /* @__PURE__ */ ((TypeDefType2) => {
|
|
32
32
|
TypeDefType2[TypeDefType2["Literal"] = 1] = "Literal";
|
|
33
33
|
TypeDefType2[TypeDefType2["List"] = 2] = "List";
|
|
@@ -37,7 +37,7 @@ var TypeDefType = /* @__PURE__ */ ((TypeDefType2) => {
|
|
|
37
37
|
return TypeDefType2;
|
|
38
38
|
})(TypeDefType || {});
|
|
39
39
|
|
|
40
|
-
// transformers/copies/
|
|
40
|
+
// transformers/copies/copyTo.ts
|
|
41
41
|
function copyTo({ definition }, value, copier) {
|
|
42
42
|
return internalCopyTo(
|
|
43
43
|
definition,
|
|
@@ -136,14 +136,7 @@ function copyUnion(typeDef, value, copier) {
|
|
|
136
136
|
} = typeDef;
|
|
137
137
|
if (discriminator != null) {
|
|
138
138
|
const discriminatorValue = value[discriminator];
|
|
139
|
-
|
|
140
|
-
unions[discriminatorValue],
|
|
141
|
-
value,
|
|
142
|
-
copier
|
|
143
|
-
)), {
|
|
144
|
-
[discriminator]: discriminatorValue
|
|
145
|
-
});
|
|
146
|
-
return copier(discriminatingUnion, typeDef);
|
|
139
|
+
return internalCopyTo(unions[discriminatorValue], value, copier);
|
|
147
140
|
}
|
|
148
141
|
const allTypeDefs = Object.values(unions);
|
|
149
142
|
const variableTypeDefs = allTypeDefs.filter(function(typeDef2) {
|
|
@@ -168,23 +161,22 @@ function copy(t, proto) {
|
|
|
168
161
|
return copyTo(t, proto, identity);
|
|
169
162
|
}
|
|
170
163
|
|
|
171
|
-
// transformers/copies/
|
|
164
|
+
// transformers/copies/mobxCopy.ts
|
|
172
165
|
import {
|
|
173
166
|
reduce as reduce3,
|
|
174
167
|
UnreachableError as UnreachableError3
|
|
175
168
|
} from "@strictly/base";
|
|
176
169
|
import {
|
|
177
|
-
makeObservable,
|
|
178
170
|
observable
|
|
179
171
|
} from "mobx";
|
|
180
172
|
|
|
181
|
-
// transformers/flatteners/
|
|
173
|
+
// transformers/flatteners/flattenValueTo.ts
|
|
182
174
|
import {
|
|
183
175
|
reduce as reduce2,
|
|
184
176
|
UnreachableError as UnreachableError2
|
|
185
177
|
} from "@strictly/base";
|
|
186
178
|
|
|
187
|
-
// transformers/flatteners/
|
|
179
|
+
// transformers/flatteners/jsonPath.ts
|
|
188
180
|
import {
|
|
189
181
|
assertEqual,
|
|
190
182
|
assertState
|
|
@@ -212,7 +204,7 @@ function jsonPathUnprefix(prefix, path) {
|
|
|
212
204
|
return `$${path.slice(prefix.length)}`;
|
|
213
205
|
}
|
|
214
206
|
|
|
215
|
-
// transformers/flatteners/
|
|
207
|
+
// transformers/flatteners/flattenValueTo.ts
|
|
216
208
|
function flattenValueTo({ definition }, v, setter, mapper2, listIndicesToKeys = {}) {
|
|
217
209
|
const r = {};
|
|
218
210
|
internalFlattenValue(
|
|
@@ -353,7 +345,7 @@ function getUnionTypeDef(typeDef, v) {
|
|
|
353
345
|
return typeDef.unions[v[typeDef.discriminator]];
|
|
354
346
|
}
|
|
355
347
|
|
|
356
|
-
// transformers/copies/
|
|
348
|
+
// transformers/copies/mobxCopy.ts
|
|
357
349
|
function observeValue(v, def) {
|
|
358
350
|
if (v == null) {
|
|
359
351
|
return v;
|
|
@@ -372,7 +364,7 @@ function observeValue(v, def) {
|
|
|
372
364
|
}
|
|
373
365
|
);
|
|
374
366
|
case 4 /* Object */:
|
|
375
|
-
return
|
|
367
|
+
return observable(
|
|
376
368
|
v,
|
|
377
369
|
reduce3(
|
|
378
370
|
def.fields,
|
|
@@ -463,7 +455,7 @@ function internalUnionEquals({
|
|
|
463
455
|
return o1 === o2 || variableTypeDefs.length === 1 && internalEquals(variableTypeDefs[0], o1, o2);
|
|
464
456
|
}
|
|
465
457
|
|
|
466
|
-
// transformers/flatteners/
|
|
458
|
+
// transformers/flatteners/flattenAccessorsOfType.ts
|
|
467
459
|
function mapAccessor(_t, value, set) {
|
|
468
460
|
return {
|
|
469
461
|
value,
|
|
@@ -480,7 +472,7 @@ function flattenAccessorsOfType(t, value, setValue, listIndicesToKeys) {
|
|
|
480
472
|
);
|
|
481
473
|
}
|
|
482
474
|
|
|
483
|
-
// transformers/flatteners/
|
|
475
|
+
// transformers/flatteners/flattenJsonValueToTypePathsOf.ts
|
|
484
476
|
function mapTypePaths(_t, _value, _set, typePath) {
|
|
485
477
|
return typePath;
|
|
486
478
|
}
|
|
@@ -495,7 +487,7 @@ function flattenJsonValueToTypePathsOf(t, value, listIndicesToKeys) {
|
|
|
495
487
|
);
|
|
496
488
|
}
|
|
497
489
|
|
|
498
|
-
// transformers/flatteners/
|
|
490
|
+
// transformers/flatteners/flattenTypeTo.ts
|
|
499
491
|
import {
|
|
500
492
|
reduce as reduce4,
|
|
501
493
|
UnreachableError as UnreachableError5
|
|
@@ -569,7 +561,7 @@ function internalFlattenUnionTypeDefChildren(path, qualifier, {
|
|
|
569
561
|
);
|
|
570
562
|
}
|
|
571
563
|
|
|
572
|
-
// transformers/flatteners/
|
|
564
|
+
// transformers/flatteners/flattenTypesOfType.ts
|
|
573
565
|
function flattenTypesOfType(t) {
|
|
574
566
|
return flattenTypeTo(
|
|
575
567
|
t,
|
|
@@ -579,7 +571,7 @@ function flattenTypesOfType(t) {
|
|
|
579
571
|
);
|
|
580
572
|
}
|
|
581
573
|
|
|
582
|
-
// transformers/flatteners/
|
|
574
|
+
// transformers/flatteners/flattenValidatorsOfValidatingType.ts
|
|
583
575
|
function flattenValidatorsOfValidatingType(type) {
|
|
584
576
|
return flattenTypeTo(type, function(definition) {
|
|
585
577
|
const {
|
|
@@ -600,7 +592,7 @@ function flattenValidatorsOfValidatingType(type) {
|
|
|
600
592
|
});
|
|
601
593
|
}
|
|
602
594
|
|
|
603
|
-
// transformers/flatteners/
|
|
595
|
+
// transformers/flatteners/flattenValuesOfType.ts
|
|
604
596
|
function mapper(_t, v) {
|
|
605
597
|
return v;
|
|
606
598
|
}
|
|
@@ -615,7 +607,7 @@ function flattenValuesOfType(typeDef, value, listIndicesToKeys) {
|
|
|
615
607
|
);
|
|
616
608
|
}
|
|
617
609
|
|
|
618
|
-
// transformers/flatteners/
|
|
610
|
+
// transformers/flatteners/valuePathToTypePath.ts
|
|
619
611
|
import {
|
|
620
612
|
assertEqual as assertEqual2,
|
|
621
613
|
assertExists,
|
|
@@ -767,7 +759,13 @@ function internalJsonValuePathToTypePath(typeDef, qualifiers, valueSteps, allowM
|
|
|
767
759
|
}
|
|
768
760
|
}
|
|
769
761
|
|
|
770
|
-
//
|
|
762
|
+
// types/builders.ts
|
|
763
|
+
import {
|
|
764
|
+
map as map3,
|
|
765
|
+
UnreachableError as UnreachableError8
|
|
766
|
+
} from "@strictly/base";
|
|
767
|
+
|
|
768
|
+
// validation/validators/CompositeValidator.ts
|
|
771
769
|
var CompositeValidator = class {
|
|
772
770
|
constructor(...validators) {
|
|
773
771
|
__publicField(this, "validators");
|
|
@@ -835,7 +833,7 @@ function mergeAnnotations(a1, a2) {
|
|
|
835
833
|
};
|
|
836
834
|
}
|
|
837
835
|
|
|
838
|
-
// types/
|
|
836
|
+
// types/typeOfType.ts
|
|
839
837
|
import {
|
|
840
838
|
map as map2,
|
|
841
839
|
UnreachableError as UnreachableError7
|
|
@@ -1036,18 +1034,45 @@ var UnionTypeDefBuilder = class _UnionTypeDefBuilder extends TypeDefBuilder {
|
|
|
1036
1034
|
definition: typeDef
|
|
1037
1035
|
}) {
|
|
1038
1036
|
const {
|
|
1039
|
-
unions
|
|
1037
|
+
unions,
|
|
1038
|
+
discriminator
|
|
1040
1039
|
} = this.definition;
|
|
1040
|
+
const enhancedTypeDef = maybeAddDiscriminatorField(typeDef, discriminator, k);
|
|
1041
1041
|
return new _UnionTypeDefBuilder(
|
|
1042
1042
|
__spreadProps(__spreadValues({}, this.definition), {
|
|
1043
1043
|
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
1044
1044
|
unions: __spreadProps(__spreadValues({}, unions), {
|
|
1045
|
-
[k]:
|
|
1045
|
+
[k]: enhancedTypeDef
|
|
1046
1046
|
})
|
|
1047
1047
|
})
|
|
1048
1048
|
);
|
|
1049
1049
|
}
|
|
1050
1050
|
};
|
|
1051
|
+
function maybeAddDiscriminatorField(t, discriminatorKey, discriminatorLiteral) {
|
|
1052
|
+
if (discriminatorKey == null) {
|
|
1053
|
+
return t;
|
|
1054
|
+
}
|
|
1055
|
+
switch (t.type) {
|
|
1056
|
+
case 2 /* List */:
|
|
1057
|
+
case 1 /* Literal */:
|
|
1058
|
+
case 3 /* Record */:
|
|
1059
|
+
return t;
|
|
1060
|
+
case 4 /* Object */:
|
|
1061
|
+
return __spreadProps(__spreadValues({}, t), {
|
|
1062
|
+
fields: __spreadProps(__spreadValues({}, t.fields), {
|
|
1063
|
+
[discriminatorKey]: literal([discriminatorLiteral]).readonly().required().narrow.definition
|
|
1064
|
+
})
|
|
1065
|
+
});
|
|
1066
|
+
case 5 /* Union */:
|
|
1067
|
+
return __spreadProps(__spreadValues({}, t), {
|
|
1068
|
+
unions: map3(t.unions, (_k, v) => {
|
|
1069
|
+
return maybeAddDiscriminatorField(v, discriminatorKey, discriminatorLiteral);
|
|
1070
|
+
})
|
|
1071
|
+
});
|
|
1072
|
+
default:
|
|
1073
|
+
throw new UnreachableError8(t);
|
|
1074
|
+
}
|
|
1075
|
+
}
|
|
1051
1076
|
function literal(value) {
|
|
1052
1077
|
return new TypeDefBuilder({
|
|
1053
1078
|
type: 1 /* Literal */,
|
|
@@ -1119,7 +1144,7 @@ function union(discriminator) {
|
|
|
1119
1144
|
);
|
|
1120
1145
|
}
|
|
1121
1146
|
|
|
1122
|
-
// validation/validators/
|
|
1147
|
+
// validation/validators/DefinedValidator.ts
|
|
1123
1148
|
var DefinedValidator = class {
|
|
1124
1149
|
constructor(error) {
|
|
1125
1150
|
this.error = error;
|
|
@@ -1138,7 +1163,7 @@ var DefinedValidator = class {
|
|
|
1138
1163
|
}
|
|
1139
1164
|
};
|
|
1140
1165
|
|
|
1141
|
-
// validation/validators/
|
|
1166
|
+
// validation/validators/MaximumStringLengthValidator.ts
|
|
1142
1167
|
var MaximumStringLengthValidationErrorType = "maximum_string_length";
|
|
1143
1168
|
var MaximumStringLengthValidator = class {
|
|
1144
1169
|
constructor(maximumLength) {
|
|
@@ -1162,7 +1187,7 @@ var MaximumStringLengthValidator = class {
|
|
|
1162
1187
|
}
|
|
1163
1188
|
};
|
|
1164
1189
|
|
|
1165
|
-
// validation/validators/
|
|
1190
|
+
// validation/validators/MinimumStringLengthValidator.ts
|
|
1166
1191
|
var MinimumStringLengthValidationErrorType = "minimum_string_length";
|
|
1167
1192
|
var MinimumStringLengthValidator = class {
|
|
1168
1193
|
constructor(minimumLength) {
|
|
@@ -1186,7 +1211,7 @@ var MinimumStringLengthValidator = class {
|
|
|
1186
1211
|
}
|
|
1187
1212
|
};
|
|
1188
1213
|
|
|
1189
|
-
// validation/validators/
|
|
1214
|
+
// validation/validators/OptionalValidatorProxy.ts
|
|
1190
1215
|
var OptionalValidatorProxy = class _OptionalValidatorProxy {
|
|
1191
1216
|
constructor(proxied, isRequired) {
|
|
1192
1217
|
this.proxied = proxied;
|
|
@@ -1211,7 +1236,7 @@ var OptionalValidatorProxy = class _OptionalValidatorProxy {
|
|
|
1211
1236
|
}
|
|
1212
1237
|
};
|
|
1213
1238
|
|
|
1214
|
-
// validation/validators/
|
|
1239
|
+
// validation/validators/RegexpValidator.ts
|
|
1215
1240
|
var RegexpValidationErrorType = "regexp";
|
|
1216
1241
|
var _RegexpValidator = class _RegexpValidator {
|
|
1217
1242
|
constructor(regexp, intent, {
|
package/index.ts
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
export * from './transformers/copies/copy'
|
|
2
|
-
export * from './transformers/copies/
|
|
2
|
+
export * from './transformers/copies/mobxCopy'
|
|
3
3
|
export * from './transformers/equals'
|
|
4
|
-
export * from './transformers/flatteners/
|
|
5
|
-
export * from './transformers/flatteners/
|
|
6
|
-
export * from './transformers/flatteners/
|
|
7
|
-
export * from './transformers/flatteners/
|
|
8
|
-
export * from './transformers/flatteners/
|
|
9
|
-
export * from './transformers/flatteners/
|
|
10
|
-
export * from './transformers/flatteners/
|
|
11
|
-
export * from './transformers/flatteners/
|
|
4
|
+
export * from './transformers/flatteners/flattenAccessorsOfType'
|
|
5
|
+
export * from './transformers/flatteners/flattenJsonValueToTypePathsOf'
|
|
6
|
+
export * from './transformers/flatteners/flattenTypesOfType'
|
|
7
|
+
export * from './transformers/flatteners/flattenValidatorsOfValidatingType'
|
|
8
|
+
export * from './transformers/flatteners/flattenValuesOfType'
|
|
9
|
+
export * from './transformers/flatteners/flattenValueTo'
|
|
10
|
+
export * from './transformers/flatteners/jsonPath'
|
|
11
|
+
export * from './transformers/flatteners/valuePathToTypePath'
|
|
12
12
|
export * from './types/builders'
|
|
13
|
-
export * from './types/
|
|
14
|
-
export * from './types/
|
|
15
|
-
export * from './types/
|
|
16
|
-
export * from './types/
|
|
17
|
-
export * from './types/
|
|
18
|
-
export * from './types/
|
|
19
|
-
export * from './types/
|
|
20
|
-
export * from './types/
|
|
21
|
-
export * from './types/
|
|
22
|
-
export * from './types/
|
|
23
|
-
export * from './types/
|
|
13
|
+
export * from './types/FlattenedAccessorsOfType'
|
|
14
|
+
export * from './types/FlattenedTypesOfType'
|
|
15
|
+
export * from './types/FlattenedValuesOfType'
|
|
16
|
+
export * from './types/MobxValueOfType'
|
|
17
|
+
export * from './types/PathsOfType'
|
|
18
|
+
export * from './types/ReadonlyTypeOfType'
|
|
19
|
+
export * from './types/StrictType'
|
|
20
|
+
export * from './types/Type'
|
|
21
|
+
export * from './types/ValueOfType'
|
|
22
|
+
export * from './types/ValueToTypePathsOfType'
|
|
23
|
+
export * from './types/ValueTypesOfDiscriminatedUnion'
|
|
24
24
|
export * from './validation/validator'
|
|
25
|
-
export * from './validation/validators/
|
|
26
|
-
export * from './validation/validators/
|
|
27
|
-
export * from './validation/validators/
|
|
28
|
-
export * from './validation/validators/
|
|
29
|
-
export * from './validation/validators/
|
|
30
|
-
export * from './validation/
|
|
25
|
+
export * from './validation/validators/DefinedValidator'
|
|
26
|
+
export * from './validation/validators/MaximumStringLengthValidator'
|
|
27
|
+
export * from './validation/validators/MinimumStringLengthValidator'
|
|
28
|
+
export * from './validation/validators/OptionalValidatorProxy'
|
|
29
|
+
export * from './validation/validators/RegexpValidator'
|
|
30
|
+
export * from './validation/ValidatorsOfValues'
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { type ReadonlyTypeOfType } from 'types/
|
|
2
|
-
import { type StrictType } from 'types/
|
|
3
|
-
import { type ValueOfType } from 'types/
|
|
1
|
+
import { type ReadonlyTypeOfType } from 'types/ReadonlyTypeOfType'
|
|
2
|
+
import { type StrictType } from 'types/StrictType'
|
|
3
|
+
import { type ValueOfType } from 'types/ValueOfType'
|
|
4
4
|
import {
|
|
5
5
|
type AnyValueType,
|
|
6
6
|
copyTo,
|
|
7
|
-
} from './
|
|
7
|
+
} from './copyTo'
|
|
8
8
|
|
|
9
9
|
function identity(v: AnyValueType): AnyValueType {
|
|
10
10
|
return v
|
|
@@ -4,13 +4,7 @@ import {
|
|
|
4
4
|
UnexpectedImplementationError,
|
|
5
5
|
UnreachableError,
|
|
6
6
|
} from '@strictly/base'
|
|
7
|
-
import {
|
|
8
|
-
type ObjectFieldKey,
|
|
9
|
-
type TypeDef,
|
|
10
|
-
TypeDefType,
|
|
11
|
-
type UnionKey,
|
|
12
|
-
} from 'types/definitions'
|
|
13
|
-
import { type ReadonlyTypeOfType } from 'types/readonly_type_of_type'
|
|
7
|
+
import { type ReadonlyTypeOfType } from 'types/ReadonlyTypeOfType'
|
|
14
8
|
import {
|
|
15
9
|
type StrictListTypeDef,
|
|
16
10
|
type StrictLiteralTypeDef,
|
|
@@ -20,8 +14,14 @@ import {
|
|
|
20
14
|
type StrictType,
|
|
21
15
|
type StrictTypeDef,
|
|
22
16
|
type StrictUnionTypeDef,
|
|
23
|
-
} from 'types/
|
|
24
|
-
import {
|
|
17
|
+
} from 'types/StrictType'
|
|
18
|
+
import {
|
|
19
|
+
type ObjectFieldKey,
|
|
20
|
+
type TypeDef,
|
|
21
|
+
TypeDefType,
|
|
22
|
+
type UnionKey,
|
|
23
|
+
} from 'types/Type'
|
|
24
|
+
import { type ValueOfType } from 'types/ValueOfType'
|
|
25
25
|
|
|
26
26
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
27
27
|
export type AnyValueType = any
|
|
@@ -195,15 +195,7 @@ function copyUnion<
|
|
|
195
195
|
// is it a discriminated union with a struct?
|
|
196
196
|
if (discriminator != null) {
|
|
197
197
|
const discriminatorValue = value[discriminator]
|
|
198
|
-
|
|
199
|
-
...internalCopyTo(
|
|
200
|
-
unions[discriminatorValue],
|
|
201
|
-
value,
|
|
202
|
-
copier,
|
|
203
|
-
),
|
|
204
|
-
[discriminator]: discriminatorValue,
|
|
205
|
-
}
|
|
206
|
-
return copier(discriminatingUnion, typeDef)
|
|
198
|
+
return internalCopyTo(unions[discriminatorValue], value, copier)
|
|
207
199
|
}
|
|
208
200
|
|
|
209
201
|
// is it a `<constant1> | <constant2> | X`? We can handle that
|
|
@@ -4,25 +4,24 @@ import {
|
|
|
4
4
|
} from '@strictly/base'
|
|
5
5
|
import {
|
|
6
6
|
type IObservableFactory,
|
|
7
|
-
makeObservable,
|
|
8
7
|
observable,
|
|
9
8
|
} from 'mobx'
|
|
10
|
-
import { getUnionTypeDef } from 'transformers/flatteners/
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
TypeDefType,
|
|
14
|
-
} from 'types/definitions'
|
|
15
|
-
import { type MobxValueOfType } from 'types/mobx_value_of_type'
|
|
16
|
-
import { type ReadonlyTypeOfType } from 'types/readonly_type_of_type'
|
|
9
|
+
import { getUnionTypeDef } from 'transformers/flatteners/flattenValueTo'
|
|
10
|
+
import { type MobxValueOfType } from 'types/MobxValueOfType'
|
|
11
|
+
import { type ReadonlyTypeOfType } from 'types/ReadonlyTypeOfType'
|
|
17
12
|
import {
|
|
18
13
|
type StrictType,
|
|
19
14
|
type StrictTypeDef,
|
|
20
|
-
} from 'types/
|
|
21
|
-
import {
|
|
15
|
+
} from 'types/StrictType'
|
|
16
|
+
import {
|
|
17
|
+
type ObjectFieldKey,
|
|
18
|
+
TypeDefType,
|
|
19
|
+
} from 'types/Type'
|
|
20
|
+
import { type ValueOfType } from 'types/ValueOfType'
|
|
22
21
|
import {
|
|
23
22
|
type AnyValueType,
|
|
24
23
|
copyTo,
|
|
25
|
-
} from './
|
|
24
|
+
} from './copyTo'
|
|
26
25
|
|
|
27
26
|
function observeValue(
|
|
28
27
|
v: AnyValueType,
|
|
@@ -49,7 +48,7 @@ function observeValue(
|
|
|
49
48
|
)
|
|
50
49
|
case TypeDefType.Object:
|
|
51
50
|
// `makeObservable` only observes the specified props
|
|
52
|
-
return
|
|
51
|
+
return observable(
|
|
53
52
|
v,
|
|
54
53
|
reduce(
|
|
55
54
|
def.fields,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
type AnyValueType,
|
|
3
3
|
copyTo,
|
|
4
|
-
} from 'transformers/copies/
|
|
4
|
+
} from 'transformers/copies/copyTo'
|
|
5
5
|
import {
|
|
6
6
|
booleanType,
|
|
7
7
|
list,
|
|
@@ -12,8 +12,8 @@ import {
|
|
|
12
12
|
stringType,
|
|
13
13
|
union,
|
|
14
14
|
} from 'types/builders'
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
15
|
+
import { type StrictTypeDef } from 'types/StrictType'
|
|
16
|
+
import { TypeDefType } from 'types/Type'
|
|
17
17
|
|
|
18
18
|
describe('copyTo', function () {
|
|
19
19
|
function toString(v: AnyValueType, t: StrictTypeDef) {
|
|
@@ -134,7 +134,7 @@ describe('copyTo', function () {
|
|
|
134
134
|
)
|
|
135
135
|
|
|
136
136
|
expect(c).toEqual({
|
|
137
|
-
d: 'a',
|
|
137
|
+
d: '"a"',
|
|
138
138
|
x: '1',
|
|
139
139
|
})
|
|
140
140
|
})
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { mobxCopy } from 'transformers/copies/
|
|
1
|
+
import { mobxCopy } from 'transformers/copies/mobxCopy'
|
|
2
2
|
import {
|
|
3
3
|
numberType,
|
|
4
4
|
object,
|
|
5
5
|
} from 'types/builders'
|
|
6
|
-
import { type ValueOfType } from 'types/
|
|
6
|
+
import { type ValueOfType } from 'types/ValueOfType'
|
|
7
7
|
|
|
8
8
|
describe('mobxCopy', function () {
|
|
9
9
|
describe('object', function () {
|
package/transformers/equals.ts
CHANGED
|
@@ -9,8 +9,8 @@ import {
|
|
|
9
9
|
type TypeDef,
|
|
10
10
|
TypeDefType,
|
|
11
11
|
type UnionTypeDef,
|
|
12
|
-
} from 'types/
|
|
13
|
-
import { type ValueOfType } from 'types/
|
|
12
|
+
} from 'types/Type'
|
|
13
|
+
import { type ValueOfType } from 'types/ValueOfType'
|
|
14
14
|
|
|
15
15
|
export function equals<T extends Type>({ definition }: T, o1: ValueOfType<T>, o2: ValueOfType<T>): boolean {
|
|
16
16
|
return internalEquals(definition, o1, o2)
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type Type,
|
|
3
|
-
type TypeDef,
|
|
4
|
-
} from 'types/definitions'
|
|
5
1
|
import {
|
|
6
2
|
type Accessor,
|
|
7
3
|
type FlattenedAccessorsOfType,
|
|
8
|
-
} from 'types/
|
|
9
|
-
import {
|
|
4
|
+
} from 'types/FlattenedAccessorsOfType'
|
|
5
|
+
import {
|
|
6
|
+
type Type,
|
|
7
|
+
type TypeDef,
|
|
8
|
+
} from 'types/Type'
|
|
9
|
+
import { type ValueOfType } from 'types/ValueOfType'
|
|
10
10
|
import {
|
|
11
11
|
type AnyValueType,
|
|
12
12
|
flattenValueTo,
|
|
13
13
|
type Setter,
|
|
14
|
-
} from './
|
|
14
|
+
} from './flattenValueTo'
|
|
15
15
|
|
|
16
16
|
function mapAccessor(
|
|
17
17
|
_t: TypeDef,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
type Type,
|
|
3
3
|
type TypeDef,
|
|
4
|
-
} from 'types/
|
|
5
|
-
import { type ValueOfType } from 'types/
|
|
4
|
+
} from 'types/Type'
|
|
5
|
+
import { type ValueOfType } from 'types/ValueOfType'
|
|
6
6
|
import {
|
|
7
7
|
type AnyValueType,
|
|
8
8
|
flattenValueTo,
|
|
9
9
|
type Setter,
|
|
10
|
-
} from './
|
|
10
|
+
} from './flattenValueTo'
|
|
11
11
|
|
|
12
12
|
function mapTypePaths(
|
|
13
13
|
_t: TypeDef,
|
|
@@ -2,9 +2,6 @@ import {
|
|
|
2
2
|
reduce,
|
|
3
3
|
UnreachableError,
|
|
4
4
|
} from '@strictly/base'
|
|
5
|
-
import {
|
|
6
|
-
TypeDefType,
|
|
7
|
-
} from 'types/definitions'
|
|
8
5
|
import {
|
|
9
6
|
type StrictListTypeDef,
|
|
10
7
|
type StrictObjectTypeDef,
|
|
@@ -12,8 +9,9 @@ import {
|
|
|
12
9
|
type StrictType,
|
|
13
10
|
type StrictTypeDef,
|
|
14
11
|
type StrictUnionTypeDef,
|
|
15
|
-
} from 'types/
|
|
16
|
-
import {
|
|
12
|
+
} from 'types/StrictType'
|
|
13
|
+
import { TypeDefType } from 'types/Type'
|
|
14
|
+
import { jsonPath } from './jsonPath'
|
|
17
15
|
|
|
18
16
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
19
17
|
export type AnyValueType = any
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { type StrictType } from 'types/StrictType'
|
|
1
2
|
import {
|
|
2
3
|
type Type,
|
|
3
4
|
type TypeDef,
|
|
4
|
-
} from 'types/
|
|
5
|
-
import {
|
|
6
|
-
import { flattenTypeTo } from './flatten_type_to'
|
|
5
|
+
} from 'types/Type'
|
|
6
|
+
import { flattenTypeTo } from './flattenTypeTo'
|
|
7
7
|
|
|
8
8
|
export function flattenTypesOfType<T extends StrictType>(t: T) {
|
|
9
9
|
// Type should be FlattenedTypeDefsOf<T>, but infinite depth error
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { type AnyValueType } from 'transformers/copies/
|
|
1
|
+
import { type AnyValueType } from 'transformers/copies/copyTo'
|
|
2
2
|
import {
|
|
3
3
|
flattenValueTo,
|
|
4
4
|
type Setter,
|
|
5
|
-
} from 'transformers/flatteners/
|
|
5
|
+
} from 'transformers/flatteners/flattenValueTo'
|
|
6
6
|
import {
|
|
7
7
|
type ReadonlyDeep,
|
|
8
8
|
type ValueOf,
|
|
9
9
|
} from 'type-fest'
|
|
10
|
-
import { type
|
|
11
|
-
import { type
|
|
12
|
-
import { type
|
|
13
|
-
import { type
|
|
14
|
-
import { type
|
|
15
|
-
import { type ValueOfType } from 'types/
|
|
10
|
+
import { type FlattenedTypesOfType } from 'types/FlattenedTypesOfType'
|
|
11
|
+
import { type FlattenedValuesOfType } from 'types/FlattenedValuesOfType'
|
|
12
|
+
import { type ReadonlyTypeOfType } from 'types/ReadonlyTypeOfType'
|
|
13
|
+
import { type StrictTypeDef } from 'types/StrictType'
|
|
14
|
+
import { type Type } from 'types/Type'
|
|
15
|
+
import { type ValueOfType } from 'types/ValueOfType'
|
|
16
16
|
import {
|
|
17
17
|
validate,
|
|
18
18
|
type Validator,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { type FlattenedTypesOfValidatingType } from 'types/
|
|
2
|
-
import { type FlattenedValidatorsOfValidatingType } from 'types/
|
|
1
|
+
import { type FlattenedTypesOfValidatingType } from 'types/FlattenedTypesOfValidatingType'
|
|
2
|
+
import { type FlattenedValidatorsOfValidatingType } from 'types/FlattenedValidatorsOfValidatingType'
|
|
3
3
|
import {
|
|
4
4
|
type ValidatingType,
|
|
5
5
|
type ValidatingTypeDef,
|
|
6
|
-
} from 'types/
|
|
6
|
+
} from 'types/ValidatingType'
|
|
7
7
|
import { type Validator } from 'validation/validator'
|
|
8
|
-
import { flattenTypeTo } from './
|
|
8
|
+
import { flattenTypeTo } from './flattenTypeTo'
|
|
9
9
|
|
|
10
10
|
export function flattenValidatorsOfValidatingType<
|
|
11
11
|
T extends ValidatingType,
|
|
@@ -2,12 +2,7 @@ import {
|
|
|
2
2
|
reduce,
|
|
3
3
|
UnreachableError,
|
|
4
4
|
} from '@strictly/base'
|
|
5
|
-
import {
|
|
6
|
-
type TypeDef,
|
|
7
|
-
TypeDefType,
|
|
8
|
-
type UnionTypeDef,
|
|
9
|
-
} from 'types/definitions'
|
|
10
|
-
import { type ReadonlyTypeOfType } from 'types/readonly_type_of_type'
|
|
5
|
+
import { type ReadonlyTypeOfType } from 'types/ReadonlyTypeOfType'
|
|
11
6
|
import {
|
|
12
7
|
type StrictListTypeDef,
|
|
13
8
|
type StrictObjectTypeDef,
|
|
@@ -15,9 +10,14 @@ import {
|
|
|
15
10
|
type StrictType,
|
|
16
11
|
type StrictTypeDef,
|
|
17
12
|
type StrictUnionTypeDef,
|
|
18
|
-
} from 'types/
|
|
19
|
-
import {
|
|
20
|
-
|
|
13
|
+
} from 'types/StrictType'
|
|
14
|
+
import {
|
|
15
|
+
type TypeDef,
|
|
16
|
+
TypeDefType,
|
|
17
|
+
type UnionTypeDef,
|
|
18
|
+
} from 'types/Type'
|
|
19
|
+
import { type ValueOfType } from 'types/ValueOfType'
|
|
20
|
+
import { jsonPath } from './jsonPath'
|
|
21
21
|
|
|
22
22
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
23
23
|
export type AnyValueType = any
|
|
@@ -37,7 +37,7 @@ export function flattenValueTo<
|
|
|
37
37
|
R extends Readonly<Record<string, M>>,
|
|
38
38
|
>(
|
|
39
39
|
{ definition }: T,
|
|
40
|
-
v: ValueOfType<T
|
|
40
|
+
v: ValueOfType<ReadonlyTypeOfType<T>>,
|
|
41
41
|
setter: Setter<ValueOfType<T>>,
|
|
42
42
|
mapper: Mapper<M>,
|
|
43
43
|
// used to maintain keys when changing lists, note that the format for a list of three elements is
|