From 73df554bb76334365e7bd564939e8f543c8b44cb Mon Sep 17 00:00:00 2001 From: Simon Date: Sun, 5 Mar 2023 15:04:10 -0800 Subject: [PATCH] Use "as" to prevent TS from auto-narrowing --- src/tests/json-stringify.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tests/json-stringify.ts b/src/tests/json-stringify.ts index 1b12354..2371aa7 100644 --- a/src/tests/json-stringify.ts +++ b/src/tests/json-stringify.ts @@ -23,7 +23,7 @@ doNotExecute(() => { }); doNotExecute(() => { - const value: null | string | number | boolean | object | Array = null; + const value = null as null | string | number | boolean | object | any[]; const result = JSON.stringify(value); type tests = [Expect>]; });