better handle example file at any depth

This commit is contained in:
Dave Conway-Jones 2019-06-29 01:16:02 +01:00
parent d918bb568c
commit c4f4115bcb
No known key found for this signature in database
GPG Key ID: 9E7F9C73F5168CD4
1 changed files with 2 additions and 4 deletions

View File

@ -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];