mirror of
https://github.com/actions/labeler.git
synced 2025-12-19 00:26:47 +00:00
build
This commit is contained in:
22
node_modules/jest-validate/build/validate.js
generated
vendored
22
node_modules/jest-validate/build/validate.js
generated
vendored
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user