@naturalcycles/nodejs-lib 15.106.2 → 15.106.3
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.
|
@@ -634,7 +634,7 @@ type HasAllowExtraKeys<T> = T extends {
|
|
|
634
634
|
type IsAny<T> = 0 extends 1 & T ? true : false;
|
|
635
635
|
type IsAssignableRelaxed<A, B> = IsAny<RelaxIndexSignature<A>> extends true ? true : [RelaxIndexSignature<A>] extends [B] ? true : false;
|
|
636
636
|
type ExactMatchBase<A, B> = (<T>() => T extends A ? 1 : 2) extends <T>() => (T extends B ? 1 : 2) ? (<T>() => T extends B ? 1 : 2) extends <T>() => (T extends A ? 1 : 2) ? true : false : false;
|
|
637
|
-
type ExactMatch<A, B> = HasAllowExtraKeys<B> extends true ? IsAssignableRelaxed<B, A> : ExactMatchBase<Expand<A>, Expand<B>> extends true ? true : ExactMatchBase<Expand<StripIndexSignatureDeep<A>>, Expand<StripIndexSignatureDeep<B
|
|
637
|
+
type ExactMatch<A, B> = HasAllowExtraKeys<B> extends true ? IsAssignableRelaxed<B, A> : ExactMatchBase<Expand<A>, Expand<B>> extends true ? true : ExactMatchBase<Expand<StripIndexSignatureDeep<A>>, Expand<StripIndexSignatureDeep<B>>> extends true ? true : ExactMatchBase<keyof Expand<A>, keyof Expand<B>> extends true ? [Expand<A>] extends [Expand<B>] ? [Expand<B>] extends [Expand<A>] ? true : false : false : false;
|
|
638
638
|
type BuilderOutUnion<B extends readonly JSchema<any, any>[]> = {
|
|
639
639
|
[K in keyof B]: B[K] extends JSchema<infer O, any> ? O : never;
|
|
640
640
|
}[number];
|
package/package.json
CHANGED
|
@@ -2141,7 +2141,21 @@ type ExactMatch<A, B> =
|
|
|
2141
2141
|
? IsAssignableRelaxed<B, A>
|
|
2142
2142
|
: ExactMatchBase<Expand<A>, Expand<B>> extends true
|
|
2143
2143
|
? true
|
|
2144
|
-
: ExactMatchBase<
|
|
2144
|
+
: ExactMatchBase<
|
|
2145
|
+
Expand<StripIndexSignatureDeep<A>>,
|
|
2146
|
+
Expand<StripIndexSignatureDeep<B>>
|
|
2147
|
+
> extends true
|
|
2148
|
+
? true
|
|
2149
|
+
: // Fallback for types that are structurally identical but have different internal
|
|
2150
|
+
// representations (e.g. enum values from T[keyof T] vs direct enum references).
|
|
2151
|
+
// Keys must match exactly; then check mutual structural assignability.
|
|
2152
|
+
ExactMatchBase<keyof Expand<A>, keyof Expand<B>> extends true
|
|
2153
|
+
? [Expand<A>] extends [Expand<B>]
|
|
2154
|
+
? [Expand<B>] extends [Expand<A>]
|
|
2155
|
+
? true
|
|
2156
|
+
: false
|
|
2157
|
+
: false
|
|
2158
|
+
: false
|
|
2145
2159
|
|
|
2146
2160
|
type BuilderOutUnion<B extends readonly JSchema<any, any>[]> = {
|
|
2147
2161
|
[K in keyof B]: B[K] extends JSchema<infer O, any> ? O : never
|