@artus/core
Advanced tools
Comparing version 2.1.2-alpha.1 to 2.1.2-alpha.2
@@ -39,3 +39,3 @@ "use strict"; | ||
async setConfigByFile(fileItem) { | ||
const configContent = await (0, compatible_require_1.default)(fileItem.path); | ||
const configContent = await (0, compatible_require_1.default)(fileItem.path + fileItem.extname); | ||
if (configContent) { | ||
@@ -42,0 +42,0 @@ const env = ConfigurationHandler_1.getEnvFromFilename(fileItem.filename); |
@@ -47,3 +47,3 @@ "use strict"; | ||
async loadConfigFile(item) { | ||
const originConfigObj = await (0, compatible_require_1.default)(item.path); | ||
const originConfigObj = await (0, compatible_require_1.default)(item.path + item.extname); | ||
let configObj = originConfigObj; | ||
@@ -50,0 +50,0 @@ if (typeof originConfigObj === 'function') { |
@@ -15,3 +15,3 @@ "use strict"; | ||
async load(item) { | ||
const origin = await (0, compatible_require_1.default)(item.path, true); | ||
const origin = await (0, compatible_require_1.default)(item.path + item.extname, true); | ||
item.loaderState = Object.assign({ exportNames: ['default'] }, item.loaderState); | ||
@@ -18,0 +18,0 @@ const { loaderState: state } = item; |
@@ -13,3 +13,3 @@ "use strict"; | ||
async load(item) { | ||
const origin = await (0, compatible_require_1.default)(item.path, true); | ||
const origin = await (0, compatible_require_1.default)(item.path + item.extname, true); | ||
item.loaderState = Object.assign({ exportNames: ['default'] }, item.loaderState); | ||
@@ -16,0 +16,0 @@ const { loaderState: state } = item; |
@@ -10,6 +10,11 @@ "use strict"; | ||
async function compatibleRequire(path, origin = false) { | ||
const requiredModule = await import(path); | ||
var _a; | ||
if (path.endsWith('.json')) { | ||
return require(path); | ||
} | ||
let requiredModule = await import(path); | ||
(0, assert_1.default)(requiredModule, `module '${path}' exports is undefined`); | ||
requiredModule = requiredModule.__esModule ? (_a = requiredModule.default) !== null && _a !== void 0 ? _a : requiredModule : requiredModule; | ||
return origin ? requiredModule : (requiredModule.default || requiredModule); | ||
} | ||
exports.default = compatibleRequire; |
{ | ||
"name": "@artus/core", | ||
"version": "2.1.2-alpha.1", | ||
"version": "2.1.2-alpha.2", | ||
"description": "Core package of Artus", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
9
0
100271
101
2431