Add node modules and new code for release (#39)

Co-authored-by: tbarnes94 <tbarnes94@users.noreply.github.com>
This commit is contained in:
github-actions[bot] 2022-01-05 11:26:06 -05:00 committed by GitHub
parent a10d84bc2e
commit 7ad2aa66bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7655 changed files with 1763577 additions and 14 deletions

9
node_modules/jest-validate/build/condition.d.ts generated vendored Normal file
View file

@ -0,0 +1,9 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
export declare function getValues<T = unknown>(validOption: T): Array<T>;
export declare function validationCondition(option: unknown, validOption: unknown): boolean;
export declare function multipleValidOptions<T extends Array<any>>(...args: T): T[number];

48
node_modules/jest-validate/build/condition.js generated vendored Normal file
View file

@ -0,0 +1,48 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.getValues = getValues;
exports.validationCondition = validationCondition;
exports.multipleValidOptions = multipleValidOptions;
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
const toString = Object.prototype.toString;
const MULTIPLE_VALID_OPTIONS_SYMBOL = Symbol('JEST_MULTIPLE_VALID_OPTIONS');
function validationConditionSingle(option, validOption) {
return (
option === null ||
option === undefined ||
(typeof option === 'function' && typeof validOption === 'function') ||
toString.call(option) === toString.call(validOption)
);
}
function getValues(validOption) {
if (
Array.isArray(validOption) && // @ts-expect-error
validOption[MULTIPLE_VALID_OPTIONS_SYMBOL]
) {
return validOption;
}
return [validOption];
}
function validationCondition(option, validOption) {
return getValues(validOption).some(e => validationConditionSingle(option, e));
}
function multipleValidOptions(...args) {
const options = [...args]; // @ts-expect-error
options[MULTIPLE_VALID_OPTIONS_SYMBOL] = true;
return options;
}

9
node_modules/jest-validate/build/defaultConfig.d.ts generated vendored Normal file
View file

@ -0,0 +1,9 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import type { ValidationOptions } from './types';
declare const validationOptions: ValidationOptions;
export default validationOptions;

42
node_modules/jest-validate/build/defaultConfig.js generated vendored Normal file
View file

@ -0,0 +1,42 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.default = void 0;
var _deprecated = require('./deprecated');
var _warnings = require('./warnings');
var _errors = require('./errors');
var _condition = require('./condition');
var _utils = require('./utils');
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
const validationOptions = {
comment: '',
condition: _condition.validationCondition,
deprecate: _deprecated.deprecationWarning,
deprecatedConfig: {},
error: _errors.errorMessage,
exampleConfig: {},
recursive: true,
// Allow NPM-sanctioned comments in package.json. Use a "//" key.
recursiveBlacklist: ['//'],
title: {
deprecation: _utils.DEPRECATION,
error: _utils.ERROR,
warning: _utils.WARNING
},
unknown: _warnings.unknownOptionWarning
};
var _default = validationOptions;
exports.default = _default;

8
node_modules/jest-validate/build/deprecated.d.ts generated vendored Normal file
View file

@ -0,0 +1,8 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import type { DeprecatedOptions, ValidationOptions } from './types';
export declare const deprecationWarning: (config: Record<string, any>, option: string, deprecatedOptions: DeprecatedOptions, options: ValidationOptions) => boolean;

32
node_modules/jest-validate/build/deprecated.js generated vendored Normal file
View file

@ -0,0 +1,32 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.deprecationWarning = void 0;
var _utils = require('./utils');
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
const deprecationMessage = (message, options) => {
const comment = options.comment;
const name =
(options.title && options.title.deprecation) || _utils.DEPRECATION;
(0, _utils.logValidationWarning)(name, message, comment);
};
const deprecationWarning = (config, option, deprecatedOptions, options) => {
if (option in deprecatedOptions) {
deprecationMessage(deprecatedOptions[option](config), options);
return true;
}
return false;
};
exports.deprecationWarning = deprecationWarning;

8
node_modules/jest-validate/build/errors.d.ts generated vendored Normal file
View file

@ -0,0 +1,8 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import type { ValidationOptions } from './types';
export declare const errorMessage: (option: string, received: unknown, defaultValue: unknown, options: ValidationOptions, path?: string[] | undefined) => void;

75
node_modules/jest-validate/build/errors.js generated vendored Normal file
View file

@ -0,0 +1,75 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.errorMessage = void 0;
function _chalk() {
const data = _interopRequireDefault(require('chalk'));
_chalk = function () {
return data;
};
return data;
}
function _jestGetType() {
const data = _interopRequireDefault(require('jest-get-type'));
_jestGetType = function () {
return data;
};
return data;
}
var _utils = require('./utils');
var _condition = require('./condition');
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {default: obj};
}
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
const errorMessage = (option, received, defaultValue, options, path) => {
const conditions = (0, _condition.getValues)(defaultValue);
const validTypes = Array.from(
new Set(conditions.map(_jestGetType().default))
);
const message = ` Option ${_chalk().default.bold(
`"${path && path.length > 0 ? path.join('.') + '.' : ''}${option}"`
)} must be of type:
${validTypes.map(e => _chalk().default.bold.green(e)).join(' or ')}
but instead received:
${_chalk().default.bold.red((0, _jestGetType().default)(received))}
Example:
${formatExamples(option, conditions)}`;
const comment = options.comment;
const name = (options.title && options.title.error) || _utils.ERROR;
throw new _utils.ValidationError(name, message, comment);
};
exports.errorMessage = errorMessage;
function formatExamples(option, examples) {
return examples.map(
e => ` {
${_chalk().default.bold(`"${option}"`)}: ${_chalk().default.bold(
(0, _utils.formatPrettyObject)(e)
)}
}`
).join(`
or
`);
}

9
node_modules/jest-validate/build/exampleConfig.d.ts generated vendored Normal file
View file

@ -0,0 +1,9 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import type { ValidationOptions } from './types';
declare const config: ValidationOptions;
export default config;

36
node_modules/jest-validate/build/exampleConfig.js generated vendored Normal file
View file

@ -0,0 +1,36 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.default = void 0;
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
const config = {
comment: ' A comment',
condition: () => true,
deprecate: () => false,
deprecatedConfig: {
key: () => {}
},
error: () => {},
exampleConfig: {
key: 'value',
test: 'case'
},
recursive: true,
recursiveBlacklist: [],
title: {
deprecation: 'Deprecation Warning',
error: 'Validation Error',
warning: 'Validation Warning'
},
unknown: () => {}
};
var _default = config;
exports.default = _default;

10
node_modules/jest-validate/build/index.d.ts generated vendored Normal file
View file

@ -0,0 +1,10 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
export { ValidationError, createDidYouMeanMessage, format, logValidationWarning, } from './utils';
export { default as validate } from './validate';
export { default as validateCLIOptions } from './validateCLIOptions';
export { multipleValidOptions } from './condition';

61
node_modules/jest-validate/build/index.js generated vendored Normal file
View file

@ -0,0 +1,61 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
Object.defineProperty(exports, 'ValidationError', {
enumerable: true,
get: function () {
return _utils.ValidationError;
}
});
Object.defineProperty(exports, 'createDidYouMeanMessage', {
enumerable: true,
get: function () {
return _utils.createDidYouMeanMessage;
}
});
Object.defineProperty(exports, 'format', {
enumerable: true,
get: function () {
return _utils.format;
}
});
Object.defineProperty(exports, 'logValidationWarning', {
enumerable: true,
get: function () {
return _utils.logValidationWarning;
}
});
Object.defineProperty(exports, 'validate', {
enumerable: true,
get: function () {
return _validate.default;
}
});
Object.defineProperty(exports, 'validateCLIOptions', {
enumerable: true,
get: function () {
return _validateCLIOptions.default;
}
});
Object.defineProperty(exports, 'multipleValidOptions', {
enumerable: true,
get: function () {
return _condition.multipleValidOptions;
}
});
var _utils = require('./utils');
var _validate = _interopRequireDefault(require('./validate'));
var _validateCLIOptions = _interopRequireDefault(
require('./validateCLIOptions')
);
var _condition = require('./condition');
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {default: obj};
}

25
node_modules/jest-validate/build/types.d.ts generated vendored Normal file
View file

@ -0,0 +1,25 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
declare type Title = {
deprecation?: string;
error?: string;
warning?: string;
};
export declare type DeprecatedOptions = Record<string, Function>;
export declare type ValidationOptions = {
comment?: string;
condition?: (option: any, validOption: any) => boolean;
deprecate?: (config: Record<string, any>, option: string, deprecatedOptions: DeprecatedOptions, options: ValidationOptions) => boolean;
deprecatedConfig?: DeprecatedOptions;
error?: (option: string, received: any, defaultValue: any, options: ValidationOptions, path?: Array<string>) => void;
exampleConfig: Record<string, any>;
recursive?: boolean;
recursiveBlacklist?: Array<string>;
title?: Title;
unknown?: (config: Record<string, any>, exampleConfig: Record<string, any>, option: string, options: ValidationOptions, path?: Array<string>) => void;
};
export {};

1
node_modules/jest-validate/build/types.js generated vendored Normal file
View file

@ -0,0 +1 @@
'use strict';

18
node_modules/jest-validate/build/utils.d.ts generated vendored Normal file
View file

@ -0,0 +1,18 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
export declare const DEPRECATION: string;
export declare const ERROR: string;
export declare const WARNING: string;
export declare const format: (value: unknown) => string;
export declare const formatPrettyObject: (value: unknown) => string;
export declare class ValidationError extends Error {
name: string;
message: string;
constructor(name: string, message: string, comment?: string | null);
}
export declare const logValidationWarning: (name: string, message: string, comment?: string | null | undefined) => void;
export declare const createDidYouMeanMessage: (unrecognized: string, allowedOptions: Array<string>) => string;

121
node_modules/jest-validate/build/utils.js generated vendored Normal file
View file

@ -0,0 +1,121 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.createDidYouMeanMessage = exports.logValidationWarning = exports.ValidationError = exports.formatPrettyObject = exports.format = exports.WARNING = exports.ERROR = exports.DEPRECATION = void 0;
function _chalk() {
const data = _interopRequireDefault(require('chalk'));
_chalk = function () {
return data;
};
return data;
}
function _prettyFormat() {
const data = _interopRequireDefault(require('pretty-format'));
_prettyFormat = function () {
return data;
};
return data;
}
function _leven() {
const data = _interopRequireDefault(require('leven'));
_leven = function () {
return data;
};
return data;
}
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {default: obj};
}
function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
const BULLET = _chalk().default.bold('\u25cf');
const DEPRECATION = `${BULLET} Deprecation Warning`;
exports.DEPRECATION = DEPRECATION;
const ERROR = `${BULLET} Validation Error`;
exports.ERROR = ERROR;
const WARNING = `${BULLET} Validation Warning`;
exports.WARNING = WARNING;
const format = value =>
typeof value === 'function'
? value.toString()
: (0, _prettyFormat().default)(value, {
min: true
});
exports.format = format;
const formatPrettyObject = value =>
typeof value === 'function'
? value.toString()
: JSON.stringify(value, null, 2).split('\n').join('\n ');
exports.formatPrettyObject = formatPrettyObject;
class ValidationError extends Error {
constructor(name, message, comment) {
super();
_defineProperty(this, 'name', void 0);
_defineProperty(this, 'message', void 0);
comment = comment ? '\n\n' + comment : '\n';
this.name = '';
this.message = _chalk().default.red(
_chalk().default.bold(name) + ':\n\n' + message + comment
);
Error.captureStackTrace(this, () => {});
}
}
exports.ValidationError = ValidationError;
const logValidationWarning = (name, message, comment) => {
comment = comment ? '\n\n' + comment : '\n';
console.warn(
_chalk().default.yellow(
_chalk().default.bold(name) + ':\n\n' + message + comment
)
);
};
exports.logValidationWarning = logValidationWarning;
const createDidYouMeanMessage = (unrecognized, allowedOptions) => {
const suggestion = allowedOptions.find(option => {
const steps = (0, _leven().default)(option, unrecognized);
return steps < 3;
});
return suggestion
? `Did you mean ${_chalk().default.bold(format(suggestion))}?`
: '';
};
exports.createDidYouMeanMessage = createDidYouMeanMessage;

13
node_modules/jest-validate/build/validate.d.ts generated vendored Normal file
View file

@ -0,0 +1,13 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import type { ValidationOptions } from './types';
declare let hasDeprecationWarnings: boolean;
declare const validate: (config: Record<string, any>, options: ValidationOptions) => {
hasDeprecationWarnings: boolean;
isValid: boolean;
};
export default validate;

131
node_modules/jest-validate/build/validate.js generated vendored Normal file
View file

@ -0,0 +1,131 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.default = void 0;
var _defaultConfig = _interopRequireDefault(require('./defaultConfig'));
var _utils = require('./utils');
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {default: obj};
}
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
let hasDeprecationWarnings = false;
const shouldSkipValidationForPath = (path, key, blacklist) =>
blacklist ? blacklist.includes([...path, key].join('.')) : false;
const _validate = (config, exampleConfig, options, path = []) => {
if (
typeof config !== 'object' ||
config == null ||
typeof exampleConfig !== 'object' ||
exampleConfig == null
) {
return {
hasDeprecationWarnings
};
}
for (const key in config) {
if (
options.deprecatedConfig &&
key in options.deprecatedConfig &&
typeof options.deprecate === 'function'
) {
const isDeprecatedKey = options.deprecate(
config,
key,
options.deprecatedConfig,
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' &&
typeof options.error === 'function' &&
!options.condition(config[key], exampleConfig[key])
) {
options.error(key, config[key], exampleConfig[key], options, path);
}
} else if (
shouldSkipValidationForPath(path, key, options.recursiveBlacklist)
) {
// skip validating unknown options inside blacklisted paths
} else {
options.unknown &&
options.unknown(config, exampleConfig, key, options, path);
}
if (
options.recursive &&
!Array.isArray(exampleConfig[key]) &&
options.recursiveBlacklist &&
!shouldSkipValidationForPath(path, key, options.recursiveBlacklist)
) {
_validate(config[key], exampleConfig[key], options, [...path, key]);
}
}
return {
hasDeprecationWarnings
};
};
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
const combinedBlacklist = [
...(_defaultConfig.default.recursiveBlacklist || []),
...(options.recursiveBlacklist || [])
];
const defaultedOptions = Object.assign({
..._defaultConfig.default,
...options,
recursiveBlacklist: combinedBlacklist,
title: options.title || _defaultConfig.default.title
});
const {hasDeprecationWarnings: hdw} = _validate(
config,
options.exampleConfig,
defaultedOptions
);
return {
hasDeprecationWarnings: hdw,
isValid: true
};
};
var _default = validate;
exports.default = _default;

View file

@ -0,0 +1,14 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import type { Config } from '@jest/types';
import type { Options } from 'yargs';
import type { DeprecatedOptions } from './types';
export declare const DOCUMENTATION_NOTE: string;
export default function validateCLIOptions(argv: Config.Argv, options: {
deprecationEntries: DeprecatedOptions;
[s: string]: Options;
}, rawArgv?: Array<string>): boolean;

133
node_modules/jest-validate/build/validateCLIOptions.js generated vendored Normal file
View file

@ -0,0 +1,133 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.default = validateCLIOptions;
exports.DOCUMENTATION_NOTE = void 0;
function _chalk() {
const data = _interopRequireDefault(require('chalk'));
_chalk = function () {
return data;
};
return data;
}
function _camelcase() {
const data = _interopRequireDefault(require('camelcase'));
_camelcase = function () {
return data;
};
return data;
}
var _utils = require('./utils');
var _deprecated = require('./deprecated');
var _defaultConfig = _interopRequireDefault(require('./defaultConfig'));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {default: obj};
}
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
const BULLET = _chalk().default.bold('\u25cf');
const DOCUMENTATION_NOTE = ` ${_chalk().default.bold(
'CLI Options Documentation:'
)}
https://jestjs.io/docs/en/cli.html
`;
exports.DOCUMENTATION_NOTE = DOCUMENTATION_NOTE;
const createCLIValidationError = (unrecognizedOptions, allowedOptions) => {
let title = `${BULLET} Unrecognized CLI Parameter`;
let message;
const comment =
` ${_chalk().default.bold('CLI Options Documentation')}:\n` +
` https://jestjs.io/docs/en/cli.html\n`;
if (unrecognizedOptions.length === 1) {
const unrecognized = unrecognizedOptions[0];
const didYouMeanMessage = (0, _utils.createDidYouMeanMessage)(
unrecognized,
Array.from(allowedOptions)
);
message =
` Unrecognized option ${_chalk().default.bold(
(0, _utils.format)(unrecognized)
)}.` + (didYouMeanMessage ? ` ${didYouMeanMessage}` : '');
} else {
title += 's';
message =
` Following options were not recognized:\n` +
` ${_chalk().default.bold((0, _utils.format)(unrecognizedOptions))}`;
}
return new _utils.ValidationError(title, message, comment);
};
const logDeprecatedOptions = (deprecatedOptions, deprecationEntries, argv) => {
deprecatedOptions.forEach(opt => {
(0, _deprecated.deprecationWarning)(argv, opt, deprecationEntries, {
..._defaultConfig.default,
comment: DOCUMENTATION_NOTE
});
});
};
function validateCLIOptions(argv, options, rawArgv = []) {
const yargsSpecialOptions = ['$0', '_', 'help', 'h'];
const deprecationEntries = options.deprecationEntries || {};
const allowedOptions = Object.keys(options).reduce(
(acc, option) => acc.add(option).add(options[option].alias || option),
new Set(yargsSpecialOptions)
);
const unrecognizedOptions = Object.keys(argv).filter(
arg =>
!allowedOptions.has((0, _camelcase().default)(arg)) &&
(!rawArgv.length || rawArgv.includes(arg)),
[]
);
if (unrecognizedOptions.length) {
throw createCLIValidationError(unrecognizedOptions, allowedOptions);
}
const CLIDeprecations = Object.keys(deprecationEntries).reduce(
(acc, entry) => {
if (options[entry]) {
acc[entry] = deprecationEntries[entry];
const alias = options[entry].alias;
if (alias) {
acc[alias] = deprecationEntries[entry];
}
}
return acc;
},
{}
);
const deprecations = new Set(Object.keys(CLIDeprecations));
const deprecatedOptions = Object.keys(argv).filter(
arg => deprecations.has(arg) && argv[arg] != null
);
if (deprecatedOptions.length) {
logDeprecatedOptions(deprecatedOptions, CLIDeprecations, argv);
}
return true;
}

8
node_modules/jest-validate/build/warnings.d.ts generated vendored Normal file
View file

@ -0,0 +1,8 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import type { ValidationOptions } from './types';
export declare const unknownOptionWarning: (config: Record<string, any>, exampleConfig: Record<string, any>, option: string, options: ValidationOptions, path?: string[] | undefined) => void;

48
node_modules/jest-validate/build/warnings.js generated vendored Normal file
View file

@ -0,0 +1,48 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.unknownOptionWarning = void 0;
function _chalk() {
const data = _interopRequireDefault(require('chalk'));
_chalk = function () {
return data;
};
return data;
}
var _utils = require('./utils');
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {default: obj};
}
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
const unknownOptionWarning = (config, exampleConfig, option, options, path) => {
const didYouMean = (0, _utils.createDidYouMeanMessage)(
option,
Object.keys(exampleConfig)
);
const message =
` Unknown option ${_chalk().default.bold(
`"${path && path.length > 0 ? path.join('.') + '.' : ''}${option}"`
)} with value ${_chalk().default.bold(
(0, _utils.format)(config[option])
)} was found.` +
(didYouMean && ` ${didYouMean}`) +
`\n This is probably a typing mistake. Fixing it will remove this message.`;
const comment = options.comment;
const name = (options.title && options.title.warning) || _utils.WARNING;
(0, _utils.logValidationWarning)(name, message, comment);
};
exports.unknownOptionWarning = unknownOptionWarning;