ts-pattern
Advanced tools
Comparing version 5.0.0-rc.2 to 5.0.0-rc.3
import type { Override } from './Pattern.js'; | ||
import type { BuiltInObjects, Compute, ExcludeObjectIfContainsNever, IsPlainObject, IsReadonlyArray, LeastUpperBound, MaybeAddReadonly, ValueOf } from './helpers.js'; | ||
export type ExtractPreciseValue<a, b> = b extends Override<infer b1> ? b1 : unknown extends b ? a : 0 extends 1 & b ? a : 0 extends 1 & a ? b : b extends readonly [] ? [] : b extends readonly any[] ? ExtractPreciseArrayValue<a, b, IsReadonlyArray<a>> : b extends Map<infer bk, infer bv> ? a extends Map<infer ak, infer av> ? Map<ExtractPreciseValue<ak, bk>, ExtractPreciseValue<av, bv>> : LeastUpperBound<a, b> : b extends Set<infer bv> ? a extends Set<infer av> ? Set<ExtractPreciseValue<av, bv>> : LeastUpperBound<a, b> : IsPlainObject<b, BuiltInObjects | Error> extends true ? a extends object ? a extends b ? a : b extends a ? [Exclude<keyof a, keyof b>] extends [never] ? b : ExcludeObjectIfContainsNever<Compute<b & Omit<a, keyof b>>> : [keyof a & keyof b] extends [never] ? never : ExcludeObjectIfContainsNever<Compute<{ | ||
export type ExtractPreciseValue<a, b> = b extends Override<infer b1> ? b1 : unknown extends b ? a : 0 extends 1 & b ? a : 0 extends 1 & a ? b : b extends readonly [] ? [] : b extends readonly any[] ? ExtractPreciseArrayValue<a, b, IsReadonlyArray<a>> : b extends Map<infer bk, infer bv> ? a extends Map<infer ak, infer av> ? Map<ExtractPreciseValue<ak, bk>, ExtractPreciseValue<av, bv>> : LeastUpperBound<a, b> : b extends Set<infer bv> ? a extends Set<infer av> ? Set<ExtractPreciseValue<av, bv>> : LeastUpperBound<a, b> : IsPlainObject<b, BuiltInObjects | Error> extends true ? a extends object ? a extends b ? a : b extends a ? [Exclude<keyof a, keyof b>] extends [never] ? b : Compute<ExcludeObjectIfContainsNever<b> & Omit<a, keyof b>> : [keyof a & keyof b] extends [never] ? never : ExcludeObjectIfContainsNever<Compute<{ | ||
[k in Exclude<keyof a, keyof b>]: a[k]; | ||
@@ -5,0 +5,0 @@ } & { |
{ | ||
"name": "ts-pattern", | ||
"version": "5.0.0-rc.2", | ||
"version": "5.0.0-rc.3", | ||
"description": " The exhaustive Pattern Matching library for TypeScript.", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -1150,3 +1150,3 @@ <h1 align="center">TS-Pattern</h1> | ||
{ | ||
author: P.select({ age: P.when((age) => age > 18) }), | ||
author: P.select({ age: P.number.gt(18) }), | ||
}, | ||
@@ -1157,3 +1157,3 @@ (author) => author // author: User | ||
{ | ||
author: P.select('author', { age: P.when((age) => age > 18) }), | ||
author: P.select('author', { age: P.number.gt(18) }), | ||
content: P.select(), | ||
@@ -1160,0 +1160,0 @@ }, |
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
471599