read-config-file
Advanced tools
Comparing version 6.0.0 to 6.1.0
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.deepAssign = void 0; | ||
function isObject(x) { | ||
@@ -4,0 +5,0 @@ if (Array.isArray(x)) { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.loadEnv = exports.loadParentConfig = exports.getConfig = exports.loadConfig = exports.orIfFileNotExist = exports.orNullIfFileNotExist = exports.findAndReadConfig = void 0; | ||
const fs_1 = require("fs"); | ||
@@ -13,3 +14,3 @@ const js_yaml_1 = require("js-yaml"); | ||
} | ||
else if (configFile.endsWith(".js")) { | ||
else if (configFile.endsWith(".js") || configFile.endsWith(".cjs")) { | ||
result = require(configFile); | ||
@@ -28,3 +29,3 @@ if (result.default != null) { | ||
else { | ||
result = js_yaml_1.safeLoad(data); | ||
result = js_yaml_1.load(data); | ||
} | ||
@@ -35,3 +36,3 @@ return { result, configFile }; | ||
const prefix = request.configFilename; | ||
for (const configFile of [`${prefix}.yml`, `${prefix}.yaml`, `${prefix}.json`, `${prefix}.json5`, `${prefix}.toml`, `${prefix}.js`]) { | ||
for (const configFile of [`${prefix}.yml`, `${prefix}.yaml`, `${prefix}.json`, `${prefix}.json5`, `${prefix}.toml`, `${prefix}.js`, `${prefix}.cjs`]) { | ||
const data = await orNullIfFileNotExist(readConfig(path.join(request.projectDir, configFile), request)); | ||
@@ -38,0 +39,0 @@ if (data != null) { |
{ | ||
"name": "read-config-file", | ||
"version": "6.0.0", | ||
"version": "6.1.0", | ||
"main": "out/main.js", | ||
@@ -9,3 +9,3 @@ "author": "Vladimir Krivosheev", | ||
"engines": { | ||
"node": ">=10.0.0" | ||
"node": ">=12.0.0" | ||
}, | ||
@@ -19,3 +19,3 @@ "bugs": "https://github.com/develar/read-config-file/issues", | ||
"compile": "tsc", | ||
"release": "yarn compile && npm publish" | ||
"release": "pnpm compile && npm publish" | ||
}, | ||
@@ -25,13 +25,12 @@ "dependencies": { | ||
"dotenv-expand": "^5.1.0", | ||
"js-yaml": "^3.13.1", | ||
"json5": "^2.1.2", | ||
"js-yaml": "^4.0.0", | ||
"json5": "^2.2.0", | ||
"lazy-val": "^1.0.4" | ||
}, | ||
"devDependencies": { | ||
"@types/dotenv": "^8.2.0", | ||
"@types/js-yaml": "^3.12.3", | ||
"@types/node": "^13.9.8", | ||
"typescript": "^3.8.3" | ||
"@types/js-yaml": "^4.0.0", | ||
"@types/node": "^14.14.34", | ||
"typescript": "^4.2.3" | ||
}, | ||
"typings": "./out/main.d.ts" | ||
} |
@@ -8,2 +8,4 @@ ## read-config-file | ||
* json | ||
* toml (if installed, `yarn add toml`). | ||
* js | ||
* cjs | ||
* toml (if installed, `yarn add toml`). |
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
18834
3
9
177
11
+ Addedargparse@2.0.1(transitive)
+ Addedjs-yaml@4.1.0(transitive)
- Removedargparse@1.0.10(transitive)
- Removedesprima@4.0.1(transitive)
- Removedjs-yaml@3.14.1(transitive)
- Removedsprintf-js@1.0.3(transitive)
Updatedjs-yaml@^4.0.0
Updatedjson5@^2.2.0