From ae089a24f298e958718d692356337449a6e33b0a Mon Sep 17 00:00:00 2001 From: Loris Leiva Date: Tue, 16 Apr 2024 15:01:55 +0100 Subject: [PATCH] Make additionalPrograms optional in helpers --- src/Kinobi.ts | 6 +++--- src/nodes/RootNode.ts | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Kinobi.ts b/src/Kinobi.ts index af589766..291bdd18 100644 --- a/src/Kinobi.ts +++ b/src/Kinobi.ts @@ -4,7 +4,7 @@ import { KinobiVersion, Node, RootNode, - rootNodeFromIdls, + rootNodeFromIdl, } from './nodes'; import { KinobiError } from './shared'; import { defaultVisitor, visit, Visitor } from './visitors'; @@ -49,11 +49,11 @@ export function createFromRoot( export function createFromIdl( program: IdlInput, - additionalPrograms: IdlInput[], + additionalPrograms: IdlInput[] = [], useDefaultVisitor = true ): Kinobi { return createFromRoot( - rootNodeFromIdls(program, additionalPrograms), + rootNodeFromIdl(program, additionalPrograms), useDefaultVisitor ); } diff --git a/src/nodes/RootNode.ts b/src/nodes/RootNode.ts index 739943f2..9e19daa8 100644 --- a/src/nodes/RootNode.ts +++ b/src/nodes/RootNode.ts @@ -42,9 +42,9 @@ export function rootNode< }; } -export function rootNodeFromIdls( +export function rootNodeFromIdl( program: IdlInput, - additionalPrograms: IdlInput[] + additionalPrograms: IdlInput[] = [] ): RootNode { const resolveIdl = (idl: IdlInput) => typeof idl === 'string' ? readJson>(idl) : idl;