@based/cli
Advanced tools
@@ -7,2 +7,3 @@ "use strict"; | ||
const find_up_1 = __importDefault(require("find-up")); | ||
const path_1 = require("path"); | ||
exports.default = async (basedFile) => { | ||
@@ -13,2 +14,13 @@ // OR BASED FIELD IN PKG.json | ||
} | ||
if (typeof basedFile === 'string') { | ||
const path = (0, path_1.resolve)(basedFile); | ||
try { | ||
const x = require(path); | ||
return x; | ||
} | ||
catch (err) { | ||
console.error(`invalid based config path ${path}`); | ||
return; | ||
} | ||
} | ||
const x = await (0, find_up_1.default)(['based.js', 'based.json']); | ||
@@ -15,0 +27,0 @@ if (x) { |
{ | ||
"name": "@based/cli", | ||
"version": "2.7.0", | ||
"version": "2.7.1", | ||
"license": "MIT", | ||
@@ -15,3 +15,3 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@based/client": "2.5.1", | ||
"@based/client": "2.7.0", | ||
"@based/ids": "2.4.2", | ||
@@ -18,0 +18,0 @@ "@based/pretty-date": "^1.0.4", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
313863
0.19%4323
0.28%21
5%