From 095831c506a88af10aff3493d3e06ba7b7ac56d6 Mon Sep 17 00:00:00 2001 From: Fatih Altinok Date: Thu, 30 Jun 2022 20:44:13 +0300 Subject: [PATCH] Don't use `BigInt` (#412) --- source/jsonify.d.ts | 2 +- test-d/jsonify.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/jsonify.d.ts b/source/jsonify.d.ts index 46b253d21..d75d4db04 100644 --- a/source/jsonify.d.ts +++ b/source/jsonify.d.ts @@ -66,7 +66,7 @@ type Jsonify = // 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] extends [never] + [Extract] extends [never] ? T extends PositiveInfinity | NegativeInfinity ? null : T extends JsonPrimitive ? T // Primitive is acceptable diff --git a/test-d/jsonify.ts b/test-d/jsonify.ts index 19ca26fcb..c8309a311 100644 --- a/test-d/jsonify.ts +++ b/test-d/jsonify.ts @@ -187,7 +187,7 @@ declare const booleanJson: Jsonify; expectType(booleanJson); // BigInt fails JSON.stringify -declare const bigInt: Jsonify; +declare const bigInt: Jsonify; expectType(bigInt); declare const int8Array: Int8Array;