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

fastest-validator

Package Overview
Dependencies
Maintainers
1
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fastest-validator - npm Package Versions

13
6

1.10.1

Diff

Changelog

Source

1.10.1 (2021-03-22)

Changes

  • fix issue with regex pattern in string rule #221
  • fix returned value issue in email rule in case of empty: false #224

<a name="1.10.0"></a>

icebob
published 1.10.0 •

Changelog

Source

1.10.0 (2021-02-03)

Changes

  • fix issue in multiple custom validator #203
  • Add min, max property to email rule #213
  • Add base64 property to string rule #214

<a name="1.9.0"></a>

icebob
published 1.9.0 •

Changelog

Source

1.9.0 (2020-11-16)

Changes


<a name="1.8.0"></a>

icebob
published 1.8.0 •

Changelog

Source

1.8.0 (2020-10-18)

icebob
published 1.7.0 •

Changelog

Source

1.7.0 (2020-08-30)

Changes


<a name="1.6.1"></a>

icebob
published 1.6.1 •

Changelog

Source

1.6.1 (2020-08-11)

Changes

  • Fix issue with ObjectID rule

<a name="1.6.0"></a>

icebob
published 1.6.0 •

Changelog

Source

1.6.0 (2020-08-06)

New objectID rule

You can validate BSON/MongoDB ObjectID's

Example

const  { ObjectID } = require("mongodb") // or anywhere else 
const schema = {
    id: {
        type: "objectID",
        ObjectID // passing the ObjectID class
    }  
}
const check = v.compile(schema);
check({ id: "5f082780b00cc7401fb8e8fc" }) // ok
check({ id: new ObjectID() }) // ok
check({ id: "5f082780b00cc7401fb8e8" }) // Error

Dynamic default value

You can use dynamic default value by defining a function that returns a value.

Example In the following code, if createdAt field not defined in object`, the validator sets the current time into the property:

const schema = {
    createdAt: {
        type: "date",
        default: () => new Date()
    }
};
const obj = {}
v.validate(obj, schema); // Valid
console.log(obj);
/*
{
    createdAt: Date(2020-07-25T13:17:41.052Z)
}
*/

Changes

  • Add support for uuid v6. #181
  • Add addMessage method for using in plugins #166
  • Fix uppercase uuid issue. #176
  • Add singleLine property to string rule. #180

Credits

Many thanks to @intech and @erfanium for contributing.


<a name="1.5.1"></a>

icebob
published 1.5.1 •

Changelog

Source

1.5.1 (2020-06-19)

Changes

  • Fixing issue with pattern & empty handling in string rule #165

<a name="1.5.0"></a>

icebob
published 1.5.0 •

Changelog

Source

1.5.0 (2020-06-18)

New tuple validation rule

Thanks for @Gamote, in this version there is a new tuple. This rule checks if a value is an Array with the elements order as described by the schema.

Example

const schema = {
    grade: { type: "tuple", items: ["string", "number", "string"] }
};
const schema = {
    location: { type: "tuple", empty: false, items: [
        { type: "number", min: 35, max: 45 },
        { type: "number", min: -75, max: -65 }
    ] }
}
icebob
published 1.4.2 •

Changelog

Source

1.4.2 (2020-06-03)

Changes


<a name="1.4.1"></a>

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