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

another-json-schema

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

another-json-schema - npm Package Compare versions

Comparing version 3.5.0 to 3.5.1

4

changelog.md

@@ -0,1 +1,5 @@

## 3.5.1/2018-04-12
- add `.eq` `.equal` validator
## 3.5.0/2018-04-11

@@ -2,0 +6,0 @@

@@ -57,1 +57,9 @@ const toString = Object.prototype.toString

}
/*
* common
*/
exports.eq = exports.equal = function (actual, expected, key, parent) {
return actual === expected
}

2

package.json
{
"name": "another-json-schema",
"version": "3.5.0",
"version": "3.5.1",
"description": "Another JSON Schema, simple & flexible & intuitive.",

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

@@ -358,2 +358,3 @@ ### another-json-schema

- type
- eq|equal
- gt

@@ -360,0 +361,0 @@ - gte

@@ -135,2 +135,18 @@ const AJS = require('..')

it('.eq, .equal', function () {
const numberSchema = AJS('numberSchema', { type: 'number', eq: 0 })
assert.deepEqual(numberSchema.validate(0), { valid: true, error: null, result: 0 })
const stringSchema = AJS('stringSchema', { type: 'string', equal: 'haha' })
assert.deepEqual(stringSchema.validate('hehe'), { valid: false,
error:
{
validator: 'equal',
path: '$',
actual: 'hehe',
expected: { type: 'string', equal: 'haha' },
schema: 'stringSchema' },
result: 'hehe' })
})
it('.gt', function () {

@@ -137,0 +153,0 @@ const schema = AJS('numberSchema', { type: 'number', gt: 0 })

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