From e61bf590c7a570376062a23634e1aa275e5baa1e Mon Sep 17 00:00:00 2001 From: dabutvin Date: Mon, 4 Feb 2019 09:45:58 -0800 Subject: [PATCH] exit early if no components found --- index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/index.js b/index.js index 5918722..1d4bea5 100644 --- a/index.js +++ b/index.js @@ -40,6 +40,10 @@ async function go() { `npm/npmjs/${x.name}/${x.version}` : `npm/npmjs/-/${x.name}/${x.version}` ) + if (!coordinates.length) { + console.log('no components detected') + return + } const clearlydefinedSource = new ClearlyDefinedSource(JSON.stringify({ coordinates }))