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

@c8/joi-validator-promised

Package Overview
Dependencies
Maintainers
5
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@c8/joi-validator-promised - npm Package Compare versions

Comparing version 1.0.7 to 1.0.8

2

package.json
{
"name": "@c8/joi-validator-promised",
"version": "1.0.7",
"version": "1.0.8",
"dependencies": {

@@ -5,0 +5,0 @@ "bluebird": "^3.3.5",

@@ -14,3 +14,3 @@ # Validator

}
const validator = new Validator(opts)
const myValidator = new Validator(opts)

@@ -28,8 +28,13 @@ const joiSchema = {

// Using the promise
validator.validate(data, joiSchema).then((result) => {
//do something
})
myValidator.validate(data, joiSchema).then(
(result) => {
//do something
},
(err) => {
throw new Validator.ValidationError('A validation error occurred')
}
)
// Validate Synchronously i.e. with the standard Joi validate method
let result = validator.validateSync(data, joiSchema)
let result = myValidator.validateSync(data, joiSchema)

@@ -39,2 +44,4 @@ //If there is no error

// Do something
} else {
throw new Validator.ValidationError('A validation error occurred')
}

@@ -41,0 +48,0 @@ ```

Sorry, the diff of this file is not supported yet

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