Comparing version 0.2.0 to 0.2.1
@@ -67,3 +67,6 @@ "use strict"; | ||
const data = yield loadScriptFile(filePath); | ||
return (0, utils_1.getExportItem)(data, filterFn); | ||
if (typeof data === 'object') { | ||
return (0, utils_1.getExportItem)(data, filterFn); | ||
} | ||
return undefined; | ||
} | ||
@@ -70,0 +73,0 @@ catch (e) { |
@@ -33,3 +33,6 @@ "use strict"; | ||
const data = loadScriptFileSync(filePath); | ||
return (0, utils_1.getExportItem)(data, filterFn); | ||
if (typeof data === 'object') { | ||
return (0, utils_1.getExportItem)(data, filterFn); | ||
} | ||
return undefined; | ||
} | ||
@@ -36,0 +39,0 @@ catch (e) { |
@@ -15,5 +15,6 @@ "use strict"; | ||
function buildLoaderFilePath(info) { | ||
return path_1.default.join(info.path, info.name) + info.extension; | ||
return path_1.default.join(info.path, info.name) + | ||
(info.extension === '.json' ? '.json' : ''); | ||
} | ||
exports.buildLoaderFilePath = buildLoaderFilePath; | ||
//# sourceMappingURL=utils.js.map |
@@ -30,10 +30,10 @@ "use strict"; | ||
} | ||
if (!(0, utils_1.hasOwnProperty)(data, 'fileName') || | ||
typeof data.fileName !== 'string') { | ||
if (!(0, utils_1.hasOwnProperty)(data, 'name') || | ||
typeof data.name !== 'string') { | ||
return false; | ||
} | ||
return !(!(0, utils_1.hasOwnProperty)(data, 'fileExtension') || | ||
typeof data.fileExtension !== 'string'); | ||
return !(!(0, utils_1.hasOwnProperty)(data, 'extension') || | ||
typeof data.extension !== 'string'); | ||
} | ||
exports.isLocatorInfo = isLocatorInfo; | ||
//# sourceMappingURL=utils.js.map |
{ | ||
"name": "locter", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "Locter is a library to locate a file by criteria and load it", | ||
@@ -5,0 +5,0 @@ "author": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
46519
710