From c4f4115bcbce847f89e8997c5d859b886969cf48 Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Sat, 29 Jun 2019 01:16:02 +0100 Subject: [PATCH] better handle example file at any depth --- packages/node_modules/@node-red/registry/lib/library.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/node_modules/@node-red/registry/lib/library.js b/packages/node_modules/@node-red/registry/lib/library.js index fcb5e1eac..a8ca8a775 100644 --- a/packages/node_modules/@node-red/registry/lib/library.js +++ b/packages/node_modules/@node-red/registry/lib/library.js @@ -51,9 +51,6 @@ function getFlowsFromPath(path) { } i++; }) - if (!result.hasOwnProperty("f")) { - reject(result); - } resolve(result); }) }); @@ -63,9 +60,10 @@ function getFlowsFromPath(path) { function addNodeExamplesDir(module,path) { exampleRoots[module] = path; return getFlowsFromPath(path).then(function(result) { + if (JSON.stringify(result).indexOf('{"f":') === -1) { return; } exampleFlows = exampleFlows||{}; exampleFlows[module] = result; - }, function() { return; }); + }); } function removeNodeExamplesDir(module) { delete exampleRoots[module];