From c5c31819e8e3ca41aa017cf14091cf997fb6afc8 Mon Sep 17 00:00:00 2001 From: Daniel Wykerd Date: Mon, 11 Dec 2023 23:00:02 +0200 Subject: [PATCH] fix(parser): add overload for non array validTypes Add Parser#parse overload to support non array validTypes. Fixes issue in generator generating invalid Parser#parse calls introduced in #551. --- src/parser/parser.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/parser/parser.ts b/src/parser/parser.ts index 84f13415b..0c0ee4ddb 100644 --- a/src/parser/parser.ts +++ b/src/parser/parser.ts @@ -567,6 +567,7 @@ export function parseArray(data?: RawNode[], validTypes?: YTNodeConstructor | YT * @param validTypes - YTNode types that are allowed to be parsed. */ export function parse[]>(data: RawData, requireArray: true, validTypes?: K): ObservedArray> | null; +export function parse>(data: RawData, requireArray: true, validTypes?: K): ObservedArray> | null; export function parse(data?: RawData, requireArray?: false | undefined, validTypes?: YTNodeConstructor | YTNodeConstructor[]): SuperParsedResult; export function parse(data?: RawData, requireArray?: boolean, validTypes?: YTNodeConstructor | YTNodeConstructor[]) { if (!data) return null;