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

yup

Package Overview
Dependencies
Maintainers
1
Versions
127
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

yup - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

2

package.json
{
"name": "yup",
"version": "1.1.0",
"version": "1.1.1",
"description": "Dead simple Object schema validation",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -196,2 +196,3 @@ # Yup

})
.json()
.camelCase()

@@ -210,3 +211,3 @@ .cast('{"first_name": "jAnE "}'); // { firstName: 'jane' }

Transforms form a "pipeline", where the value of a previous transform is piped into the next one.
If the end value is `undefined` yup will apply the schema default if it's configured.
When an input value is `undefined` yup will apply the schema default if it's configured.

@@ -218,3 +219,3 @@ > Watch out! values are not guaranteed to be valid types in transform functions. Previous transforms

Yup has robust support for assertions, or "tests", over input values. Tests assert that inputs conform to some
Yup schema run "tests" over input values. Tests assert that inputs conform to some
criteria. Tests are distinct from transforms, in that they do not change or alter the input (or its type)

@@ -247,3 +248,3 @@ and are usually reserved for checks that are hard, if not impossible, to represent in static types.

> in those cases, you may want to return `true` for absent values unless your transform makes presence
> related assertions
> related assertions. The test option `skipAbsent` will do this for you if set.

@@ -897,3 +898,3 @@ #### Customizing errors

declaration, and only happen once over the lifetime of the schema, so performance isn't an issue.
However certain mutations _do_ occur at cast/validation time, (such as conditional schema using [`when()`](#Schemawhenkeys-string--arraystring-builder-object--value-schema-schema-schema)), or
However certain mutations _do_ occur at cast/validation time, (such as conditional schema using [`when()`](#schemawhenkeys-string--string-builder-object--values-any-schema--schema-schema)), or
when instantiating a schema object.

@@ -1190,3 +1191,3 @@

Adds a transformation to the transform chain. Transformations are central to the casting process,
default transforms for each type coerce values to the specific type (as verified by [`isType()`](#Schemaistypevalue-any-boolean)). transforms are run before validations and only applied when the schema is not marked as `strict` (the default). Some types have built in transformations.
default transforms for each type coerce values to the specific type (as verified by [`isType()`](#schemaistypevalue-any-value-is-infertypeschema)). transforms are run before validations and only applied when the schema is not marked as `strict` (the default). Some types have built in transformations.

@@ -1255,3 +1256,3 @@ Transformations are useful for arbitrarily altering how the object is cast, **however, you should take care

.transform((value: any, input, ctx) => {
if (ctx.typeCheck(value)) return value;
if (ctx.isType(value)) return value;
return new ObjectId(value);

@@ -1258,0 +1259,0 @@ });

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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