From d5424a8bb4a06216726fef45087eb2948282e7a7 Mon Sep 17 00:00:00 2001 From: Matt Kantor Date: Wed, 8 Dec 2021 12:31:22 -0500 Subject: [PATCH] Accept readonly arrays as JSON values This allows things like `search(['a'] as const, '[0]')`. Previously that would be rejected by the type checker. --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 0244e61..72461fd 100644 --- a/src/index.ts +++ b/src/index.ts @@ -10,7 +10,7 @@ export type ObjectDict = Record; export type JSONPrimitive = string | number | boolean | null; export type JSONValue = JSONPrimitive | JSONObject | JSONArray; export type JSONObject = { [member: string]: JSONValue }; -export type JSONArray = JSONValue[]; +export type JSONArray = readonly JSONValue[]; export const TYPE_ANY = InputArgument.TYPE_ANY; export const TYPE_ARRAY = InputArgument.TYPE_ARRAY;