From 6f667590d2f78093d53e513a6e4ae119810e12df Mon Sep 17 00:00:00 2001 From: Kanit Wongsuphasawat Date: Mon, 9 Oct 2023 10:32:17 -0700 Subject: [PATCH] fix: correct types for domain unionWith (#9131) * fix: correct types for domain unionWith * chore: update schema [CI] --------- Co-authored-by: GitHub Actions Bot --- build/vega-lite-schema.json | 31 +++++++++++-------------------- src/scale.ts | 2 +- 2 files changed, 12 insertions(+), 21 deletions(-) diff --git a/build/vega-lite-schema.json b/build/vega-lite-schema.json index ee01f9dafd..104d8bb29c 100644 --- a/build/vega-lite-schema.json +++ b/build/vega-lite-schema.json @@ -8330,33 +8330,24 @@ "additionalProperties": false, "properties": { "unionWith": { - "anyOf": [ - { - "items": { + "description": "Customized domain values to be union with the field's values or explicitly defined domain. Should be an array of valid scale domain values.", + "items": { + "anyOf": [ + { "type": "number" }, - "type": "array" - }, - { - "items": { + { "type": "string" }, - "type": "array" - }, - { - "items": { + { "type": "boolean" }, - "type": "array" - }, - { - "items": { + { "$ref": "#/definitions/DateTime" - }, - "type": "array" - } - ], - "description": "Customized domain values to be union with the field's values or explicitly defined domain. Should be an array of valid scale domain values." + } + ] + }, + "type": "array" } }, "required": [ diff --git a/src/scale.ts b/src/scale.ts index 395cf47783..1a889d701f 100644 --- a/src/scale.ts +++ b/src/scale.ts @@ -494,7 +494,7 @@ export interface DomainUnionWith { * Customized domain values to be union with the field's values or explicitly defined domain. * Should be an array of valid scale domain values. */ - unionWith: number[] | string[] | boolean[] | DateTime[]; + unionWith: (number | string | boolean | DateTime)[]; } export function isDomainUnionWith(domain: Domain): domain is DomainUnionWith {