diff --git a/type-plus/ts/bigint/strict_bigint_type.ts b/type-plus/ts/bigint/strict_bigint_type.ts index e0183e6f91..b6174387a6 100644 --- a/type-plus/ts/bigint/strict_bigint_type.ts +++ b/type-plus/ts/bigint/strict_bigint_type.ts @@ -32,7 +32,13 @@ export type StrictBigintType = IsAnyOrNever< * type R = IsStrictBigint // false * ``` */ -export type IsStrictBigint = StrictBigintType +export type IsStrictBigint = IsAnyOrNever< + T, + $SelectionBranch> extends infer R + ? R extends $Then ? Else + : R extends $Else ? [bigint] extends [T] ? ([T] extends [bigint] ? (`${T}` extends `${number}` ? Else : Then) : Else) : Else + : never : never + /** * Check if the type `T` is not exactly `bigint`. @@ -60,4 +66,10 @@ export type NotStrictBigintType = StrictBigintType // true * ``` */ -export type IsNotStrictBigint = StrictBigintType +export type IsNotStrictBigint = IsAnyOrNever< + T, + $SelectionBranch> extends infer R + ? R extends $Then ? Then + : R extends $Else ? [bigint] extends [T] ? ([T] extends [bigint] ? (`${T}` extends `${number}` ? Then : Else) : Then) : Then + : never : never +