Updating NPM dependencies
This commit is contained in:
53
node_modules/jest-validate/README.md
generated
vendored
53
node_modules/jest-validate/README.md
generated
vendored
@@ -11,45 +11,48 @@ npm install --save jest-validate
|
||||
```js
|
||||
import {validate} from 'jest-validate';
|
||||
|
||||
validate((config: Object), (options: ValidationOptions)); // => {hasDeprecationWarnings: boolean, isValid: boolean}
|
||||
validate(config, validationOptions); // => {hasDeprecationWarnings: boolean, isValid: boolean}
|
||||
```
|
||||
|
||||
Where `ValidationOptions` are:
|
||||
|
||||
```js
|
||||
```ts
|
||||
type ValidationOptions = {
|
||||
blacklist?: Array<string>,
|
||||
comment?: string,
|
||||
condition?: (option: any, validOption: any) => boolean,
|
||||
comment?: string;
|
||||
condition?: (option: unknown, validOption: unknown) => boolean;
|
||||
deprecate?: (
|
||||
config: Object,
|
||||
config: Record<string, unknown>,
|
||||
option: string,
|
||||
deprecatedOptions: Object,
|
||||
deprecatedOptions: DeprecatedOptions,
|
||||
options: ValidationOptions,
|
||||
) => true,
|
||||
deprecatedConfig?: {[key: string]: Function},
|
||||
) => boolean;
|
||||
deprecatedConfig?: DeprecatedOptions;
|
||||
error?: (
|
||||
option: string,
|
||||
received: any,
|
||||
defaultValue: any,
|
||||
received: unknown,
|
||||
defaultValue: unknown,
|
||||
options: ValidationOptions,
|
||||
) => void,
|
||||
exampleConfig: Object,
|
||||
recursive?: boolean,
|
||||
title?: Title,
|
||||
path?: Array<string>,
|
||||
) => void;
|
||||
exampleConfig: Record<string, unknown>;
|
||||
recursive?: boolean;
|
||||
recursiveBlacklist?: Array<string>;
|
||||
recursiveDenylist?: Array<string>;
|
||||
title?: Title;
|
||||
unknown?: (
|
||||
config: Object,
|
||||
exampleConfig: Object,
|
||||
config: Record<string, unknown>,
|
||||
exampleConfig: Record<string, unknown>,
|
||||
option: string,
|
||||
options: ValidationOptions,
|
||||
) => void,
|
||||
path?: Array<string>,
|
||||
) => void;
|
||||
};
|
||||
|
||||
type Title = {|
|
||||
deprecation?: string,
|
||||
error?: string,
|
||||
warning?: string,
|
||||
|};
|
||||
type Title = {
|
||||
deprecation?: string;
|
||||
error?: string;
|
||||
warning?: string;
|
||||
};
|
||||
```
|
||||
|
||||
`exampleConfig` is the only option required.
|
||||
@@ -62,7 +65,7 @@ Almost anything can be overwritten to suite your needs.
|
||||
|
||||
### Options
|
||||
|
||||
- `recursiveBlacklist` – optional array of string keyPaths that should be excluded from deep (recursive) validation.
|
||||
- `recursiveDenylist` – optional array of string keyPaths that should be excluded from deep (recursive) validation.
|
||||
- `comment` – optional string to be rendered below error/warning message.
|
||||
- `condition` – an optional function with validation condition.
|
||||
- `deprecate`, `error`, `unknown` – optional functions responsible for displaying warning and error messages.
|
||||
@@ -131,7 +134,7 @@ This will output:
|
||||
Example:
|
||||
{
|
||||
"transform": {
|
||||
"^.+\\.js$": "<rootDir>/preprocessor.js"
|
||||
"\\.js$": "<rootDir>/preprocessor.js"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user