From 908750b472b8f0c2be6f4695b96ee0a036108c81 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Tue, 15 Jun 2021 14:36:16 +0200 Subject: [PATCH] scripts/check-type-dependencies: fix handling of duplicate imports Signed-off-by: Patrik Oldsberg --- scripts/check-type-dependencies.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/check-type-dependencies.js b/scripts/check-type-dependencies.js index f3862214a1..59594d9cda 100755 --- a/scripts/check-type-dependencies.js +++ b/scripts/check-type-dependencies.js @@ -85,9 +85,10 @@ function checkTypes(pkg) { resolvePath(pkg.location, 'dist/index.d.ts'), 'utf8', ); - const deps = (typeDecl.match(/from '.*'/g) || []) + const allDeps = (typeDecl.match(/from '.*'/g) || []) .map(match => match.replace(/from '(.*)'/, '$1')) .filter(n => !n.startsWith('.')); + const deps = Array.from(new Set(allDeps)); const errors = []; const typeDeps = [];