Skip to content

Commit

Permalink
Don't use BigInt (#412)
Browse files Browse the repository at this point in the history
  • Loading branch information
frontsideair committed Jun 30, 2022
1 parent f171b70 commit 095831c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion source/jsonify.d.ts
Expand Up @@ -66,7 +66,7 @@ type Jsonify<T> =
// Check if there are any non-JSONable types represented in the union.
// Note: The use of tuples in this first condition side-steps distributive conditional types
// (see https://github.com/microsoft/TypeScript/issues/29368#issuecomment-453529532)
[Extract<T, NotJsonable | BigInt>] extends [never]
[Extract<T, NotJsonable | bigint>] extends [never]
? T extends PositiveInfinity | NegativeInfinity ? null
: T extends JsonPrimitive
? T // Primitive is acceptable
Expand Down
2 changes: 1 addition & 1 deletion test-d/jsonify.ts
Expand Up @@ -187,7 +187,7 @@ declare const booleanJson: Jsonify<typeof boolean>;
expectType<boolean>(booleanJson);

// BigInt fails JSON.stringify
declare const bigInt: Jsonify<BigInt>;
declare const bigInt: Jsonify<bigint>;
expectType<never>(bigInt);

declare const int8Array: Int8Array;
Expand Down

0 comments on commit 095831c

Please sign in to comment.