From a3d1801d3d0e5c718965daf6401b390ea07b9409 Mon Sep 17 00:00:00 2001 From: JonLuca DeCaro Date: Wed, 6 Mar 2024 15:11:43 -0800 Subject: [PATCH] fix(types): fix types to accept spread or list of strings --- lib/refs.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/refs.ts b/lib/refs.ts index dc40dc27..a2cd418a 100644 --- a/lib/refs.ts +++ b/lib/refs.ts @@ -31,8 +31,8 @@ export default class $Refs { * * @param types (optional) Optionally only return certain types of paths ("file", "http", etc.) */ - paths(...types: string[]): string[] { - const paths = getPaths(this._$refs, types); + paths(...types: (string | string[])[]): string[] { + const paths = getPaths(this._$refs, types.flat()); return paths.map((path) => { return convertPathToPosix(path.decoded); }); @@ -45,9 +45,9 @@ export default class $Refs { * * @param types (optional) Optionally only return values from certain locations ("file", "http", etc.) */ - values(...types: string[]): S { + values(...types: (string | string[])[]): S { const $refs = this._$refs; - const paths = getPaths($refs, types); + const paths = getPaths($refs, types.flat()); return paths.reduce>((obj, path) => { obj[convertPathToPosix(path.decoded)] = $refs[path.encoded].value; return obj;