From b4f83138510a61869b8fc0582580963b27468dfd Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Thu, 13 Oct 2022 15:16:57 -0700 Subject: [PATCH] Fix some TS in workspace.ts --- scripts/release/utils/workspace.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/scripts/release/utils/workspace.ts b/scripts/release/utils/workspace.ts index 357b320d894..b18330f0eb4 100644 --- a/scripts/release/utils/workspace.ts +++ b/scripts/release/utils/workspace.ts @@ -33,7 +33,16 @@ const workspaces = rawWorkspaces.map(workspace => `${root}/${workspace}`); export function mapWorkspaceToPackages( workspaces: string[] ): Promise { - return Promise.all( + const workspacePromises: Promise[] = workspaces.map( + workspace => + new Promise(resolve => { + glob(workspace, (err, paths) => { + if (err) throw err; + resolve(paths); + }); + }) + ); + return Promise.all[]>( workspaces.map( workspace => new Promise(resolve => { @@ -43,7 +52,7 @@ export function mapWorkspaceToPackages( }); }) ) - ).then(paths => paths.reduce((arr, val) => arr.concat(val), [])); + ).then(paths => paths.reduce((arr: string[], val: string[]) => arr.concat(val), [])); } function mapPackagestoPkgJson(packagePaths: string[]) {