jest-validate
Advanced tools
Comparing version 27.5.1 to 28.0.0-alpha.0
@@ -7,6 +7,85 @@ /** | ||
*/ | ||
export { ValidationError, createDidYouMeanMessage, format, logValidationWarning, } from './utils'; | ||
export type { DeprecatedOptions } from './types'; | ||
export { default as validate } from './validate'; | ||
export { default as validateCLIOptions } from './validateCLIOptions'; | ||
export { multipleValidOptions } from './condition'; | ||
import type {Config} from '@jest/types'; | ||
import type {Options} from 'yargs'; | ||
export declare const createDidYouMeanMessage: ( | ||
unrecognized: string, | ||
allowedOptions: Array<string>, | ||
) => string; | ||
declare type DeprecatedOptionFunc = (arg: Record<string, unknown>) => string; | ||
export declare type DeprecatedOptions = Record<string, DeprecatedOptionFunc>; | ||
export declare const format: (value: unknown) => string; | ||
export declare const logValidationWarning: ( | ||
name: string, | ||
message: string, | ||
comment?: string | null | undefined, | ||
) => void; | ||
export declare function multipleValidOptions<T extends Array<unknown>>( | ||
...args: T | ||
): T[number]; | ||
declare type Title = { | ||
deprecation?: string; | ||
error?: string; | ||
warning?: string; | ||
}; | ||
export declare const validate: ( | ||
config: Record<string, unknown>, | ||
options: ValidationOptions, | ||
) => { | ||
hasDeprecationWarnings: boolean; | ||
isValid: boolean; | ||
}; | ||
export declare function validateCLIOptions( | ||
argv: Config.Argv, | ||
options: { | ||
deprecationEntries: DeprecatedOptions; | ||
[s: string]: Options; | ||
}, | ||
rawArgv?: Array<string>, | ||
): boolean; | ||
export declare class ValidationError extends Error { | ||
name: string; | ||
message: string; | ||
constructor(name: string, message: string, comment?: string | null); | ||
} | ||
declare type ValidationOptions = { | ||
comment?: string; | ||
condition?: (option: unknown, validOption: unknown) => boolean; | ||
deprecate?: ( | ||
config: Record<string, unknown>, | ||
option: string, | ||
deprecatedOptions: DeprecatedOptions, | ||
options: ValidationOptions, | ||
) => boolean; | ||
deprecatedConfig?: DeprecatedOptions; | ||
error?: ( | ||
option: string, | ||
received: unknown, | ||
defaultValue: unknown, | ||
options: ValidationOptions, | ||
path?: Array<string>, | ||
) => void; | ||
exampleConfig: Record<string, unknown>; | ||
recursive?: boolean; | ||
recursiveDenylist?: Array<string>; | ||
title?: Title; | ||
unknown?: ( | ||
config: Record<string, unknown>, | ||
exampleConfig: Record<string, unknown>, | ||
option: string, | ||
options: ValidationOptions, | ||
path?: Array<string>, | ||
) => void; | ||
}; | ||
export {}; |
@@ -50,16 +50,8 @@ 'use strict'; | ||
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; | ||
} | ||
/** | ||
* 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'); | ||
@@ -91,9 +83,7 @@ | ||
class ValidationError extends Error { | ||
name; | ||
message; | ||
constructor(name, message, comment) { | ||
super(); | ||
_defineProperty(this, 'name', void 0); | ||
_defineProperty(this, 'message', void 0); | ||
comment = comment ? '\n\n' + comment : '\n'; | ||
@@ -100,0 +90,0 @@ this.name = ''; |
{ | ||
"name": "jest-validate", | ||
"version": "27.5.1", | ||
"version": "28.0.0-alpha.0", | ||
"repository": { | ||
@@ -20,14 +20,14 @@ "type": "git", | ||
"dependencies": { | ||
"@jest/types": "^27.5.1", | ||
"@jest/types": "^28.0.0-alpha.0", | ||
"camelcase": "^6.2.0", | ||
"chalk": "^4.0.0", | ||
"jest-get-type": "^27.5.1", | ||
"jest-get-type": "^28.0.0-alpha.0", | ||
"leven": "^3.1.0", | ||
"pretty-format": "^27.5.1" | ||
"pretty-format": "^28.0.0-alpha.0" | ||
}, | ||
"devDependencies": { | ||
"@types/yargs": "^16.0.0" | ||
"@types/yargs": "^17.0.8" | ||
}, | ||
"engines": { | ||
"node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" | ||
"node": "^12.13.0 || ^14.15.0 || ^16.13.0 || >=17.0.0" | ||
}, | ||
@@ -37,3 +37,3 @@ "publishConfig": { | ||
}, | ||
"gitHead": "67c1aa20c5fec31366d733e901fee2b981cb1850" | ||
"gitHead": "89275b08977065d98e42ad71fcf223f4ad169f09" | ||
} |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
28006
15
693
2
+ Added@jest/schemas@28.1.3(transitive)
+ Added@jest/types@28.1.3(transitive)
+ Added@sinclair/typebox@0.24.51(transitive)
+ Added@types/node@20.12.11(transitive)
+ Added@types/yargs@17.0.32(transitive)
+ Addedjest-get-type@28.0.2(transitive)
+ Addedpretty-format@28.1.3(transitive)
+ Addedreact-is@18.3.1(transitive)
- Removed@jest/types@27.5.1(transitive)
- Removed@types/node@20.12.8(transitive)
- Removed@types/yargs@16.0.9(transitive)
- Removedjest-get-type@27.5.1(transitive)
- Removedpretty-format@27.5.1(transitive)
- Removedreact-is@17.0.2(transitive)
Updated@jest/types@^28.0.0-alpha.0