Updated dependencies and fixed audit

This commit is contained in:
Drew Heavner committed 2020-11-12 18:00:41 -05:00
1 parent ac7314fa18
commit ff34f681c1
2041 files changed
+15676 -190739

No files matched your search

+22
View File
@@ -7,6 +7,8 @@ exports.default = void 0;
var _defaultConfig = _interopRequireDefault(require('./defaultConfig'));
var _utils = require('./utils');
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {default: obj};
}
@@ -73,6 +75,21 @@ const _validate = (config, exampleConfig, options, path = []) => {
options
);
hasDeprecationWarnings = hasDeprecationWarnings || isDeprecatedKey;
} else if (allowsMultipleTypes(key)) {
const value = config[key];
if (
typeof options.condition === 'function' &&
typeof options.error === 'function'
) {
if (key === 'maxWorkers' && !isOfTypeStringOrNumber(value)) {
throw new _utils.ValidationError(
'Validation Error',
`${key} has to be of type string or number`,
`maxWorkers=50% or\nmaxWorkers=3`
);
}
}
} else if (Object.hasOwnProperty.call(exampleConfig, key)) {
if (
typeof options.condition === 'function' &&
@@ -105,6 +122,11 @@ const _validate = (config, exampleConfig, options, path = []) => {
};
};
const allowsMultipleTypes = key => key === 'maxWorkers';
const isOfTypeStringOrNumber = value =>
typeof value === 'number' || typeof value === 'string';
const validate = (config, options) => {
hasDeprecationWarnings = false; // Preserve default blacklist entries even with user-supplied blacklist