@pagedip/lib-rc
Advanced tools
Comparing version 1.1.2 to 2.0.0
162
lib/index.js
@@ -6,134 +6,82 @@ /* eslint-disable */"use strict"; | ||
}); | ||
exports.merge = exports.etc = exports.home = exports.win = exports.InheritedConfig = exports.EnvConfig = exports.FileConfig = exports.StackConfig = exports.Config = exports.plugins = exports.globalPath = undefined; | ||
exports.config = config; | ||
exports.default = rc; | ||
exports.globalPath = exports.etc = exports.home = exports.win = undefined; | ||
var _config = require("./config"); | ||
var _parse = require("./parse.js"); | ||
var _config2 = _interopRequireDefault(_config); | ||
Object.keys(_parse).forEach(function (key) { | ||
if (key === "default" || key === "__esModule") return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function get() { | ||
return _parse[key]; | ||
} | ||
}); | ||
}); | ||
var _stack = require("./stack"); | ||
var _findFiles = require("./find-files.js"); | ||
var _stack2 = _interopRequireDefault(_stack); | ||
Object.keys(_findFiles).forEach(function (key) { | ||
if (key === "default" || key === "__esModule") return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function get() { | ||
return _findFiles[key]; | ||
} | ||
}); | ||
}); | ||
exports.find = find; | ||
exports.parseAndMerge = parseAndMerge; | ||
var _file = require("./file"); | ||
exports.default = function (name) { | ||
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { | ||
args[_key - 1] = arguments[_key]; | ||
} | ||
var filePlugin = _interopRequireWildcard(_file); | ||
return parseAndMerge.apply(undefined, [find(name || "pagedip")].concat(args)); | ||
}; | ||
var _env = require("./env"); | ||
var _env2 = _interopRequireDefault(_env); | ||
var _inherit = require("./inherit"); | ||
var _inherit2 = _interopRequireDefault(_inherit); | ||
var _lodash = require("lodash"); | ||
var _utilLogger = require("@pagedip/util-logger"); | ||
var _utilMergePlainObjects = require("@pagedip/util-merge-plain-objects"); | ||
var _utilLogger2 = _interopRequireDefault(_utilLogger); | ||
var _utilMergePlainObjects2 = _interopRequireDefault(_utilMergePlainObjects); | ||
var _merge = require("./merge"); | ||
var _merge2 = _interopRequireDefault(_merge); | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var FileConfig = filePlugin.FileConfig, | ||
file = filePlugin.default; | ||
var win = exports.win = process.platform === "win32"; | ||
var home = exports.home = (win ? process.env.USERPROFILE : process.env.HOME) || ""; | ||
var win = process.platform === "win32"; | ||
var home = win ? process.env.USERPROFILE : process.env.HOME; | ||
if (!home) exports.home = home = ""; | ||
var etc = ["/etc", "/usr/local/etc"]; | ||
var etc = exports.etc = ["/etc", "/usr/local/etc"]; | ||
var globalPath = exports.globalPath = home || (win ? "/etc" : "/usr/local/etc"); | ||
var plugins = exports.plugins = { | ||
env: _env2.default, file: file, inherit: _inherit2.default | ||
}; | ||
function find(filename) { | ||
var files = []; | ||
exports.Config = _config2.default; | ||
exports.StackConfig = _stack2.default; | ||
exports.FileConfig = FileConfig; | ||
exports.EnvConfig = _env.EnvConfig; | ||
exports.InheritedConfig = _inherit.InheritedConfig; | ||
exports.win = win; | ||
exports.home = home; | ||
exports.etc = etc; | ||
exports.merge = _merge2.default; | ||
function config() { | ||
for (var _len = arguments.length, opts = Array(_len), _key = 0; _key < _len; _key++) { | ||
opts[_key] = arguments[_key]; | ||
} | ||
if (!win) { | ||
var etcfiles = etc.reduce(function (m, e) { | ||
return m.concat([e + "/" + filename + "rc", e + "/" + filename]); | ||
}, []); | ||
var name = typeof opts[0] === "string" ? opts.shift() : ""; | ||
var logger = _utilLogger2.default.isLogger(opts[opts.length - 1]) ? opts.pop() : (opts.find(function (o) { | ||
return o && o.logger; | ||
}) || {}).logger; | ||
if (opts.length === 1 && _config2.default.isConfig(opts[0])) { | ||
return opts[0]; | ||
files = files.concat((0, _findFiles.findFiles)(etcfiles)); | ||
} | ||
var conf = new _stack2.default(name, logger); | ||
files = files.concat((0, _findFiles.findFiles)([home + "/.config/" + filename, home + "/." + filename + "rc"])); | ||
opts.forEach(function (opt) { | ||
if (_config2.default.isConfig(opt)) { | ||
conf.insert(opt); | ||
} else if (opt) { | ||
conf.config("config", opt); | ||
} | ||
}); | ||
files = files.concat((0, _findFiles.findFilesUp)("." + filename + "rc")); | ||
return conf; | ||
return (0, _lodash.uniq)(files); | ||
} | ||
function rc(name, defaults, argv, opts) { | ||
var logger = void 0; | ||
if (_utilLogger2.default.isLogger(opts)) { | ||
; | ||
var _ref = [opts, null]; | ||
logger = _ref[0]; | ||
opts = _ref[1]; | ||
} else if (opts) logger = opts.logger; | ||
opts = opts || {}; | ||
function parseAndMerge(files, defaults) { | ||
var reducer = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _utilMergePlainObjects2.default; | ||
var stack = new _stack2.default(name, logger); | ||
stack.use([_env2.default, file, _inherit2.default]); | ||
var filename = name === "pagedip" ? name : "pd" + name; | ||
stack.config("defaults", defaults); | ||
stack.env("env", (0, _lodash.snakeCase)(filename) + "_"); | ||
stack.config("argv", argv); | ||
var configFile = stack.get("config"); | ||
if (typeof file === "function") { | ||
if (!win) { | ||
var etcfiles = etc.reduce(function (m, e) { | ||
return m.concat([e + "/" + filename + "rc", e + "/" + filename]); | ||
}, []); | ||
stack.file("global", etcfiles, "env"); | ||
} | ||
stack.file("user", [home + "/.config/" + filename, home + "/." + filename + "rc"], "env"); | ||
stack.fileUp("direct", "." + filename + "rc", "env"); | ||
if (configFile) stack.file("local", configFile); | ||
} | ||
if (name !== "pagedip" && !opts.disableInherit) { | ||
var sharedConfig = opts.inherit || rc("pagedip", null, null, { logger: logger }); | ||
stack.inherit("shared full", sharedConfig, null, "global"); | ||
stack.inherit("shared", sharedConfig, name, "global"); | ||
} | ||
return stack; | ||
var stack = files.map(function (f) { | ||
return (0, _parse.parseFile)(f); | ||
}); | ||
var conf = stack.reduce(function (m, c, i) { | ||
return reducer(m, c, files[i]); | ||
}, defaults); | ||
if (conf) conf.__files = files; | ||
return conf; | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC5qcyJdLCJuYW1lcyI6WyJjb25maWciLCJyYyIsImZpbGVQbHVnaW4iLCJGaWxlQ29uZmlnIiwiZmlsZSIsImRlZmF1bHQiLCJ3aW4iLCJwcm9jZXNzIiwicGxhdGZvcm0iLCJob21lIiwiZW52IiwiVVNFUlBST0ZJTEUiLCJIT01FIiwiZXRjIiwiZ2xvYmFsUGF0aCIsInBsdWdpbnMiLCJpbmhlcml0IiwiQ29uZmlnIiwiU3RhY2tDb25maWciLCJFbnZDb25maWciLCJJbmhlcml0ZWRDb25maWciLCJtZXJnZSIsIm9wdHMiLCJuYW1lIiwic2hpZnQiLCJsb2dnZXIiLCJMb2dnZXIiLCJpc0xvZ2dlciIsImxlbmd0aCIsInBvcCIsImZpbmQiLCJvIiwiaXNDb25maWciLCJjb25mIiwiZm9yRWFjaCIsIm9wdCIsImluc2VydCIsImRlZmF1bHRzIiwiYXJndiIsInN0YWNrIiwidXNlIiwiZmlsZW5hbWUiLCJjb25maWdGaWxlIiwiZ2V0IiwiZXRjZmlsZXMiLCJyZWR1Y2UiLCJtIiwiZSIsImNvbmNhdCIsImZpbGVVcCIsImRpc2FibGVJbmhlcml0Iiwic2hhcmVkQ29uZmlnIl0sIm1hcHBpbmdzIjoiOzs7Ozs7UUFrQ2dCQSxNLEdBQUFBLE07a0JBc0JRQyxFOztBQXhEeEI7Ozs7QUFDQTs7OztBQUNBOztJQUFZQyxVOztBQUNaOzs7O0FBQ0E7Ozs7QUFDQTs7QUFDQTs7OztBQUNBOzs7Ozs7OztJQUVPQyxVLEdBQTJCRCxVLENBQTNCQyxVO0lBQW1CQyxJLEdBQVFGLFUsQ0FBaEJHLE87OztBQUVsQixJQUFNQyxNQU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BdKTtcbiAgICAgIH0sIFtdKTtcblxuICAgICAgc3RhY2suZmlsZShcImdsb2JhbFwiLCBldGNmaWxlcywgXCJlbnZcIik7XG4gICAgfVxuXG4gICAgc3RhY2suZmlsZShcInVzZXJcIiwgW1xuICAgICAgYCR7aG9tZX0vLmNvbmZpZy8ke2ZpbGVuYW1lfWAsXG4gICAgICBgJHtob21lfS8uJHtmaWxlbmFtZX1yY2BcbiAgICBdLCBcImVudlwiKTtcblxuICAgIHN0YWNrLmZpbGVVcChcImRpcmVjdFwiLCBgLiR7ZmlsZW5hbWV9cmNgLCBcImVudlwiKTtcbiAgICBpZiAoY29uZmlnRmlsZSkgc3RhY2suZmlsZShcImxvY2FsXCIsIGNvbmZpZ0ZpbGUpO1xuICB9XG5cbiAgaWYgKG5hbWUgIT09IFwicGFnZWRpcFwiICYmICFvcHRzLmRpc2FibGVJbmhlcml0KSB7XG4gICAgY29uc3Qgc2hhcmVkQ29uZmlnID0gb3B0cy5pbmhlcml0IHx8IHJjKFwicGFnZWRpcFwiLCBudWxsLCBudWxsLCB7IGxvZ2dlciB9KTtcbiAgICBzdGFjay5pbmhlcml0KFwic2hhcmVkIGZ1bGxcIiwgc2hhcmVkQ29uZmlnLCBudWxsLCBcImdsb2JhbFwiKTtcbiAgICBzdGFjay5pbmhlcml0KFwic2hhcmVkXCIsIHNoYXJlZENvbmZpZywgbmFtZSwgXCJnbG9iYWxcIik7XG4gIH1cblxuICByZXR1cm4gc3RhY2s7XG59XG4iXX0= | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC5qcyJdLCJuYW1lcyI6WyJmaW5kIiwicGFyc2VBbmRNZXJnZSIsIm5hbWUiLCJhcmdzIiwid2luIiwicHJvY2VzcyIsInBsYXRmb3JtIiwiaG9tZSIsImVudiIsIlVTRVJQUk9GSUxFIiwiSE9NRSIsImV0YyIsImdsb2JhbFBhdGgiLCJmaWx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ke2hvbWV9Ly5jb25maWcvJHtmaWxlbmFtZX1gLFxuICAgIGAke2hvbWV9Ly4ke2ZpbGVuYW1lfXJjYFxuICBdKSk7XG5cbiAgZmlsZXMgPSBmaWxlcy5jb25jYXQoZmluZEZpbGVzVXAoYC4ke2ZpbGVuYW1lfXJjYCkpO1xuXG4gIHJldHVybiB1bmlxKGZpbGVzKTtcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIHBhcnNlQW5kTWVyZ2UoZmlsZXMsIGRlZmF1bHRzLCByZWR1Y2VyPW1lcmdlKSB7XG4gIGNvbnN0IHN0YWNrID0gZmlsZXMubWFwKGYgPT4gcGFyc2VGaWxlKGYpKTtcbiAgY29uc3QgY29uZiA9IHN0YWNrLnJlZHVjZSgobSwgYywgaSkgPT4gcmVkdWNlcihtLCBjLCBmaWxlc1tpXSksIGRlZmF1bHRzKTtcbiAgaWYgKGNvbmYpIGNvbmYuX19maWxlcyA9IGZpbGVzO1xuICByZXR1cm4gY29uZjtcbn1cblxuZXhwb3J0IGRlZmF1bHQgZnVuY3Rpb24obmFtZSwgLi4uYXJncykge1xuICByZXR1cm4gcGFyc2VBbmRNZXJnZShmaW5kKG5hbWUgfHwgXCJwYWdlZGlwXCIpLCAuLi5hcmdzKTtcbn1cbiJdfQ== |
{ | ||
"name": "@pagedip/lib-rc", | ||
"version": "1.1.2", | ||
"public": true, | ||
"version": "2.0.0", | ||
"repository": { | ||
@@ -21,4 +20,4 @@ "type": "git", | ||
"@pagedip/util-find-files": "^1.0.1", | ||
"@pagedip/util-prop-helpers": "^1.0.1", | ||
"@pagedip/util-logger": "^1.0.4", | ||
"@pagedip/util-logger": "^2.0.0", | ||
"@pagedip/util-merge-plain-objects": "^1.0.0", | ||
"ini": "^1.3.5", | ||
@@ -37,3 +36,3 @@ "js-yaml": "^3.12.0", | ||
], | ||
"gitHead": "73bd32c9d1c132082408255e0429011a7d4a7cf2" | ||
"gitHead": "bc73ad71ed2bd94305c179b981ebd39d2b53c3ab" | ||
} |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
5
22411
5
214
1
+ Added@pagedip/util-logger@2.2.8(transitive)
+ Added@pagedip/util-merge-plain-objects@1.0.0(transitive)
+ Addedansi-regex@5.0.1(transitive)
+ Addedansi-styles@4.3.0(transitive)
+ Addedaproba@2.0.0(transitive)
+ Addedchalk@4.1.2(transitive)
+ Addedcolor-convert@2.0.1(transitive)
+ Addedcolor-name@1.1.4(transitive)
+ Addedcolor-support@1.1.3(transitive)
+ Addedemoji-regex@8.0.0(transitive)
+ Addedgauge@3.0.2(transitive)
+ Addedhas-flag@4.0.0(transitive)
+ Addedis-fullwidth-code-point@3.0.0(transitive)
+ Addedstring-width@4.2.3(transitive)
+ Addedstrip-ansi@6.0.1(transitive)
+ Addedsupports-color@7.2.0(transitive)
- Removed@pagedip/util-prop-helpers@^1.0.1
- Removed@pagedip/util-logger@1.0.4(transitive)
- Removedansi-regex@2.1.1(transitive)
- Removedansi-styles@3.2.1(transitive)
- Removedaproba@1.2.0(transitive)
- Removedchalk@2.4.2(transitive)
- Removedcode-point-at@1.1.0(transitive)
- Removedcolor-convert@1.9.3(transitive)
- Removedcolor-name@1.1.3(transitive)
- Removedescape-string-regexp@1.0.5(transitive)
- Removedgauge@2.7.4(transitive)
- Removedhas-flag@3.0.0(transitive)
- Removedis-fullwidth-code-point@1.0.0(transitive)
- Removednumber-is-nan@1.0.1(transitive)
- Removedstring-width@1.0.2(transitive)
- Removedstrip-ansi@3.0.1(transitive)
- Removedsupports-color@5.5.0(transitive)
Updated@pagedip/util-logger@^2.0.0