Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jest-validate

Package Overview
Dependencies
Maintainers
5
Versions
219
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jest-validate - npm Package Compare versions

Comparing version 21.3.0-beta.8 to 21.3.0-beta.9

6

package.json
{
"name": "jest-validate",
"version": "21.3.0-beta.8",
"version": "21.3.0-beta.9",
"repository": {

@@ -12,6 +12,6 @@ "type": "git",

"chalk": "^2.0.1",
"jest-get-type": "21.3.0-beta.8",
"jest-get-type": "21.3.0-beta.9",
"leven": "^2.1.0",
"pretty-format": "21.3.0-beta.8"
"pretty-format": "21.3.0-beta.9"
}
}
# jest-validate
Generic configuration validation tool that helps you with warnings, errors and deprecation messages as well as showing users examples of correct configuration.
Generic configuration validation tool that helps you with warnings, errors and
deprecation messages as well as showing users examples of correct configuration.

@@ -14,9 +15,7 @@ ```

validate(
config: Object,
options: ValidationOptions,
); // => {hasDeprecationWarnings: boolean, isValid: boolean}
validate((config: Object), (options: ValidationOptions)); // => {hasDeprecationWarnings: boolean, isValid: boolean}
```
Where `ValidationOptions` are:
```js

@@ -30,3 +29,3 @@ type ValidationOptions = {

deprecatedOptions: Object,
options: ValidationOptions
options: ValidationOptions,
) => true,

@@ -46,5 +45,5 @@ deprecatedConfig?: {[key: string]: Function},

option: string,
options: ValidationOptions
options: ValidationOptions,
) => void,
}
};

@@ -55,3 +54,3 @@ type Title = {|

warning?: string,
|}
|};
```

@@ -63,3 +62,5 @@

By default `jest-validate` will print generic warning and error messages. You can however customize this behavior by providing `options: ValidationOptions` object as a second argument:
By default `jest-validate` will print generic warning and error messages. You
can however customize this behavior by providing `options: ValidationOptions`
object as a second argument:

@@ -72,8 +73,11 @@ Almost anything can be overwritten to suite your needs.

* `condition` – an optional function with validation condition.
* `deprecate`, `error`, `unknown` – optional functions responsible for displaying warning and error messages.
* `deprecate`, `error`, `unknown` – optional functions responsible for
displaying warning and error messages.
* `deprecatedConfig` – optional object with deprecated config keys.
* `exampleConfig` – the only **required** option with configuration against which you'd like to test.
* `exampleConfig` – the only **required** option with configuration against
which you'd like to test.
* `title` – optional object of titles for errors and messages.
You will find examples of `condition`, `deprecate`, `error`, `unknown`, and `deprecatedConfig` inside source of this repository, named respectively.
You will find examples of `condition`, `deprecate`, `error`, `unknown`, and
`deprecatedConfig` inside source of this repository, named respectively.

@@ -134,4 +138,6 @@ ## Examples

#### Deprecation
Based on `deprecatedConfig` object with proper deprecation messages. Note custom title:
Based on `deprecatedConfig` object with proper deprecation messages. Note custom
title:
```

@@ -138,0 +144,0 @@ Custom Deprecation:

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc