Comparing version 0.0.1-17 to 0.0.1-18
@@ -9,5 +9,3 @@ import type { ArrayType, AtomicType, Denominalize, IntersectionType, ObjectType, OptionalType, RecordType, RecursiveType, RefinedType, TupleType, Type, UnionType, __nominal, __type } from './type'; | ||
[TKey in __KeyOfNonOptional<TDefinition>]: __MediumTypeOf<TDefinition[TKey], TMediumTypes>; | ||
} extends infer TObject ? { | ||
[TKey in keyof TObject]: TObject[TKey]; | ||
} : never; | ||
}; | ||
export declare type __TypeOfRecordKeyType<TType> = __MediumTypeOfRecordKeyType<TType, XValue.Types>; | ||
@@ -18,7 +16,4 @@ export declare type __MediumTypeOfRecordKeyType<TType, TMediumTypes> = __MediumTypeOf<TType, TMediumTypes> extends infer TKey ? Extract<TKey, string | symbol> : never; | ||
}; | ||
export declare type __RefinedMediumType<TType, TRefinement, TNominal, TMediumTypes> = __MediumTypeOf<TType, TMediumTypes> & TRefinement extends infer T ? unknown extends TNominal ? T : T & (TNominal & { | ||
[TNominalTypeSymbol in typeof __type]: Denominalize<T>; | ||
} extends infer TNominalPart ? { | ||
[TKey in keyof TNominalPart]: TNominalPart[TKey]; | ||
} : never) : never; | ||
export declare type __RefinedMediumType<TType, TRefinement, TNominal, TMediumTypes> = unknown extends TNominal ? __MediumTypeOf<TType, TMediumTypes> & TRefinement : __RefinedNominalType<__MediumTypeOf<TType, TMediumTypes> & TRefinement, TNominal>; | ||
export declare type __RefinedNominalType<T, TNominal> = T & (TNominal & Record<__type, Denominalize<T>>); | ||
export declare type __AtomicMediumType<TSymbol extends symbol, TMediumTypes> = TMediumTypes extends { | ||
@@ -42,5 +37,3 @@ [TKey in TSymbol]: infer TMediumType; | ||
}; | ||
export declare type __NominalPartial = { | ||
[TNominalSymbol in typeof __nominal]: unknown; | ||
}; | ||
export declare type __NominalPartial = Record<__nominal, unknown>; | ||
export declare function merge(partials: unknown[]): unknown; |
@@ -27,2 +27,3 @@ import type { __ElementOrArray, __MediumTypesPackedType, __RefinedMediumType, __RefinedType } from '../@internal'; | ||
export declare const __nominal: unique symbol; | ||
export declare type __nominal = typeof __nominal; | ||
/** | ||
@@ -35,11 +36,6 @@ * DECLARATION ONLY. | ||
export declare const __type: unique symbol; | ||
export declare type Nominal<TNominalKey extends string | symbol, T = unknown> = T & (unknown extends T ? unknown : { | ||
[TTypeSymbol in typeof __type]: T; | ||
}) & { | ||
[TNominalSymbol in typeof __nominal]: { | ||
[TKey in TNominalKey]: true; | ||
}; | ||
}; | ||
export declare type Denominalize<T> = T extends { | ||
[TNominalTypeSymbol in typeof __type]: infer TDenominalized; | ||
} ? TDenominalized : T; | ||
export declare type __type = typeof __type; | ||
export declare type Nominal<TNominalKey extends string | symbol, T = unknown> = T & (unknown extends T ? unknown : Record<__type, T>) & Record<__nominal, { | ||
[TKey in TNominalKey]: true; | ||
}>; | ||
export declare type Denominalize<T> = T extends Record<__type, infer TDenominalized> ? TDenominalized : T; |
@@ -11,6 +11,2 @@ import type { __NominalPartial } from './@internal'; | ||
export declare function equal<T extends TypeOf<TType>, TType extends Type>(comparison: T, Type: TType): RefinedType<TType, T, unknown>; | ||
export declare type TransformNominal<TFrom, T> = TFrom extends __NominalPartial ? T & { | ||
[TTypeSymbol in typeof __type]: T; | ||
} & { | ||
[TNominalSymbol in typeof __nominal]: TFrom[TNominalSymbol]; | ||
} : T; | ||
export declare type TransformNominal<TFrom, T> = TFrom extends __NominalPartial ? T & Record<__type, T> & Record<__nominal, TFrom[__nominal]> : T; |
{ | ||
"name": "x-value", | ||
"version": "0.0.1-17", | ||
"version": "0.0.1-18", | ||
"repository": "https://github.com/vilic/x-value.git", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -60,7 +60,3 @@ import type { | ||
>; | ||
} extends infer TObject | ||
? { | ||
[TKey in keyof TObject]: TObject[TKey]; | ||
} | ||
: never; | ||
}; | ||
@@ -87,13 +83,12 @@ export type __TypeOfRecordKeyType<TType> = __MediumTypeOfRecordKeyType< | ||
export type __RefinedMediumType<TType, TRefinement, TNominal, TMediumTypes> = | ||
__MediumTypeOf<TType, TMediumTypes> & TRefinement extends infer T | ||
? unknown extends TNominal | ||
? T | ||
: T & | ||
(TNominal & { | ||
[TNominalTypeSymbol in typeof __type]: Denominalize<T>; | ||
} extends infer TNominalPart | ||
? {[TKey in keyof TNominalPart]: TNominalPart[TKey]} | ||
: never) | ||
: never; | ||
unknown extends TNominal | ||
? __MediumTypeOf<TType, TMediumTypes> & TRefinement | ||
: __RefinedNominalType< | ||
__MediumTypeOf<TType, TMediumTypes> & TRefinement, | ||
TNominal | ||
>; | ||
export type __RefinedNominalType<T, TNominal> = T & | ||
(TNominal & Record<__type, Denominalize<T>>); | ||
export type __AtomicMediumType< | ||
@@ -161,5 +156,3 @@ TSymbol extends symbol, | ||
export type __NominalPartial = { | ||
[TNominalSymbol in typeof __nominal]: unknown; | ||
}; | ||
export type __NominalPartial = Record<__nominal, unknown>; | ||
@@ -166,0 +159,0 @@ export function merge(partials: unknown[]): unknown { |
@@ -158,2 +158,4 @@ import type { | ||
export type __nominal = typeof __nominal; | ||
/** | ||
@@ -167,17 +169,15 @@ * DECLARATION ONLY. | ||
export type __type = typeof __type; | ||
export type Nominal<TNominalKey extends string | symbol, T = unknown> = T & | ||
(unknown extends T | ||
? unknown | ||
: { | ||
[TTypeSymbol in typeof __type]: T; | ||
}) & { | ||
[TNominalSymbol in typeof __nominal]: { | ||
(unknown extends T ? unknown : Record<__type, T>) & | ||
Record< | ||
__nominal, | ||
{ | ||
[TKey in TNominalKey]: true; | ||
}; | ||
}; | ||
} | ||
>; | ||
export type Denominalize<T> = T extends { | ||
[TNominalTypeSymbol in typeof __type]: infer TDenominalized; | ||
} | ||
export type Denominalize<T> = T extends Record<__type, infer TDenominalized> | ||
? TDenominalized | ||
: T; |
@@ -47,7 +47,3 @@ import isEqual from 'lodash.isequal'; | ||
export type TransformNominal<TFrom, T> = TFrom extends __NominalPartial | ||
? T & { | ||
[TTypeSymbol in typeof __type]: T; | ||
} & { | ||
[TNominalSymbol in typeof __nominal]: TFrom[TNominalSymbol]; | ||
} | ||
? T & Record<__type, T> & Record<__nominal, TFrom[__nominal]> | ||
: T; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
195255
4121