From 7ba7852d1219a2166cb6899c5f64519f0e9efb77 Mon Sep 17 00:00:00 2001 From: Vjacheslav Trushkin Date: Tue, 15 Mar 2022 21:07:35 +0200 Subject: [PATCH] Remove duplicate warnOnce in utils --- packages/utils/src/loader/install-pkg.ts | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/packages/utils/src/loader/install-pkg.ts b/packages/utils/src/loader/install-pkg.ts index 282b1e9..8edcfd5 100644 --- a/packages/utils/src/loader/install-pkg.ts +++ b/packages/utils/src/loader/install-pkg.ts @@ -1,15 +1,7 @@ import { installPackage } from '@antfu/install-pkg'; import { sleep } from '@antfu/utils'; -import { cyan, yellow } from 'kolorist'; - -const warned = new Set(); - -export function warnOnce(msg: string): void { - if (!warned.has(msg)) { - warned.add(msg); - console.warn(yellow(`[@iconify-loader] ${msg}`)); - } -} +import { cyan } from 'kolorist'; +import { warnOnce } from './warn'; let pending: Promise | undefined; const tasks: Record | undefined> = {};