From 24ab8284572d35741d29fe88bd3c3f5b4fc167fb Mon Sep 17 00:00:00 2001 From: Vjacheslav Trushkin Date: Sun, 9 Jan 2022 22:27:47 +0200 Subject: [PATCH] Format updated files with Prettier --- packages/library-builder/src/index.ts | 8 +++++--- packages/utils/src/loader/custom.ts | 13 ++++++------- packages/utils/src/loader/types.ts | 10 ++++++++-- 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/packages/library-builder/src/index.ts b/packages/library-builder/src/index.ts index 10f4f4f..b71dd60 100644 --- a/packages/library-builder/src/index.ts +++ b/packages/library-builder/src/index.ts @@ -48,11 +48,13 @@ export async function buildFiles(params: BuildParams) { // Build files with TypeScript compiler first to make sure there are no errors and to generate .d.ts files if (typeof buildScript === 'string') { - console.log(`Executing npm script ${buildScript}...`) + console.log(`Executing npm script ${buildScript}...`); await exec(root, 'npm', ['run', buildScript]); } else { - console.log('Executing tsc...') - await exec(root, process.platform === 'win32' ? 'tsc.cmd' : 'tsc', ['-b']); + console.log('Executing tsc...'); + await exec(root, process.platform === 'win32' ? 'tsc.cmd' : 'tsc', [ + '-b', + ]); } // Build ES modules diff --git a/packages/utils/src/loader/custom.ts b/packages/utils/src/loader/custom.ts index 5ba8c90..efef755 100644 --- a/packages/utils/src/loader/custom.ts +++ b/packages/utils/src/loader/custom.ts @@ -16,18 +16,17 @@ export async function getCustomIcon( if (typeof custom === 'function') { result = await custom(icon); - } - else { + } else { const inline = custom[icon]; - result = typeof inline === 'function' - ? await inline() - : inline; + result = typeof inline === 'function' ? await inline() : inline; } if (result) { if (!result.startsWith(' Awaitable; -export type InlineCollection = Record Awaitable)>; -export type CustomCollections = Record; +export type InlineCollection = Record< + string, + string | (() => Awaitable) +>; +export type CustomCollections = Record< + string, + CustomIconLoader | InlineCollection +>;