@duplojs/utils 1.5.7 → 1.5.8
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.
|
@@ -6,7 +6,7 @@ import { type EntityPropertyDefinition, type EntityProperty, type EntityRawPrope
|
|
|
6
6
|
export * from "./property";
|
|
7
7
|
export * from "./unwrap";
|
|
8
8
|
export type EntityPropertiesDefinition = Readonly<Record<string, EntityPropertyDefinition>>;
|
|
9
|
-
export type EntityProperties<GenericPropertiesDefinition extends EntityPropertiesDefinition =
|
|
9
|
+
export type EntityProperties<GenericPropertiesDefinition extends EntityPropertiesDefinition = EntityPropertiesDefinition> = SimplifyTopLevel<{
|
|
10
10
|
readonly [Prop in keyof GenericPropertiesDefinition]: EntityProperty<GenericPropertiesDefinition[Prop]>;
|
|
11
11
|
}>;
|
|
12
12
|
export type EntityRawProperties<GenericPropertiesDefinition extends EntityPropertiesDefinition = EntityPropertiesDefinition> = SimplifyTopLevel<{
|
|
@@ -19,19 +19,19 @@ export interface EntityPropertyDefinitionArray<GenericPropertyDefinition extends
|
|
|
19
19
|
export declare const entityPropertyStructureKind: import("../../common").KindHandler<import("../../common").KindDefinition<"@DuplojsUtilsClean/entity-property-structure", unknown>>;
|
|
20
20
|
export interface EntityPropertyDefinitionStructure<GenericPropertyDefinition extends Record<string, EntityPropertyDefinition> = Record<string, EntityPropertyDefinition>> extends Kind<typeof entityPropertyStructureKind.definition>, WrappedValue<GenericPropertyDefinition> {
|
|
21
21
|
}
|
|
22
|
-
export type EntityProperty<GenericProperty extends EntityPropertyDefinition =
|
|
22
|
+
export type EntityProperty<GenericProperty extends EntityPropertyDefinition = EntityPropertyDefinition> = IsEqual<GenericProperty, EntityPropertyDefinition> extends true ? unknown : GenericProperty extends NewTypeHandler ? GetNewType<GenericProperty> : GenericProperty extends EntityPropertyDefinitionUnion ? EntityProperty<Unwrap<GenericProperty>[number]> : GenericProperty extends EntityPropertyDefinitionNullable ? EntityProperty<Unwrap<GenericProperty>> | null : GenericProperty extends EntityPropertyDefinitionArray ? GetKindValue<typeof entityPropertyArrayKind, GenericProperty>["min"] extends number ? EntityProperty<Unwrap<GenericProperty>> extends infer InferredEntityProperty ? readonly [
|
|
23
23
|
...DArray.CreateTuple<InferredEntityProperty, GetKindValue<typeof entityPropertyArrayKind, GenericProperty>["min"]>,
|
|
24
24
|
...InferredEntityProperty[]
|
|
25
25
|
] : never : readonly EntityProperty<Unwrap<GenericProperty>>[] : GenericProperty extends EntityPropertyDefinitionStructure ? Unwrap<GenericProperty> extends infer InferredShape extends Record<string, any> ? {
|
|
26
26
|
readonly [Prop in keyof InferredShape]: EntityProperty<InferredShape[Prop]>;
|
|
27
27
|
} : never : never;
|
|
28
|
-
export type EntityRawProperty<GenericProperty extends EntityPropertyDefinition =
|
|
28
|
+
export type EntityRawProperty<GenericProperty extends EntityPropertyDefinition = EntityPropertyDefinition> = IsEqual<GenericProperty, EntityPropertyDefinition> extends true ? any : GenericProperty extends NewTypeHandler ? Unwrap<GetNewType<GenericProperty>> : GenericProperty extends EntityPropertyDefinitionUnion ? EntityRawProperty<Unwrap<GenericProperty>[number]> : GenericProperty extends EntityPropertyDefinitionNullable ? EntityRawProperty<Unwrap<GenericProperty>> | null : GenericProperty extends EntityPropertyDefinitionArray ? GetKindValue<typeof entityPropertyArrayKind, GenericProperty>["min"] extends number ? EntityRawProperty<Unwrap<GenericProperty>> extends infer InferredEntityProperty ? readonly [
|
|
29
29
|
...DArray.CreateTuple<InferredEntityProperty, GetKindValue<typeof entityPropertyArrayKind, GenericProperty>["min"]>,
|
|
30
30
|
...InferredEntityProperty[]
|
|
31
31
|
] : never : readonly EntityRawProperty<Unwrap<GenericProperty>>[] : GenericProperty extends EntityPropertyDefinitionStructure ? Unwrap<GenericProperty> extends infer InferredEntityShape extends Record<string, any> ? {
|
|
32
32
|
readonly [Prop in keyof InferredEntityShape]: EntityRawProperty<InferredEntityShape[Prop]>;
|
|
33
33
|
} : never : never;
|
|
34
|
-
export type EntityInputRawProperty<GenericProperty extends EntityPropertyDefinition =
|
|
34
|
+
export type EntityInputRawProperty<GenericProperty extends EntityPropertyDefinition = EntityPropertyDefinition> = IsEqual<GenericProperty, EntityPropertyDefinition> extends true ? any : GenericProperty extends NewTypeHandler<any, infer InferredValue, any, infer InferredInput> ? IsEqual<InferredInput, never> extends true ? InferredValue : InferredInput : GenericProperty extends EntityPropertyDefinitionUnion ? EntityInputRawProperty<Unwrap<GenericProperty>[number]> : GenericProperty extends EntityPropertyDefinitionNullable ? EntityInputRawProperty<Unwrap<GenericProperty>> | null : GenericProperty extends EntityPropertyDefinitionArray ? readonly EntityInputRawProperty<Unwrap<GenericProperty>>[] : GenericProperty extends EntityPropertyDefinitionStructure ? Unwrap<GenericProperty> extends infer InferredShape extends Record<string, any> ? {
|
|
35
35
|
readonly [Prop in keyof InferredShape]: EntityInputRawProperty<InferredShape[Prop]>;
|
|
36
36
|
} : never : never;
|
|
37
37
|
export declare const entityPropertyDefinitionTools: {
|