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 1.1.0 to 1.1.1

7

index.js

@@ -209,3 +209,8 @@ 'use strict';

if (helper) {
error = new Error('(' + ctx._path + ': ' + JSON.stringify(value) + ') ✖ (' + helper + ': ' + ctx._children[helper] + ')');
var helperEntry = ctx._children[helper];
if ('function' === typeof helperEntry) {
error = new Error('(' + ctx._path + ': ' + JSON.stringify(value) + ') ✖ (' + helper + ': ' + helperEntry.name + ')');
} else {
error = new Error('(' + ctx._path + ': ' + JSON.stringify(value) + ') ✖ (' + helper + ': ' + helperEntry + ')');
}
error.validator = helper;

@@ -212,0 +217,0 @@ } else {

2

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

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

@@ -146,3 +146,3 @@ ### another-json-schema

var newSchema = new AJS();
var userSchema = newSchema.compile({
var userSchema = newSchema.compile('userSchema', {
_id: { type: 'string', pattern: /^[0-9a-z]{24}$/ },

@@ -159,4 +159,10 @@ name: { type: 'string', required: true },

- valid: {Boolean}
- valid: {Boolean} wether a valid json
- error: {Error|null}
- message: error message, eg: `($.comments[].user._id: "wrong_id") ✖ (pattern: /^[0-9a-z]{24}$/)`
- validator: validator name, eg: `pattern`,
- actual: actual value, eg: `wrong_id`,
- expected: expected schema, eg: `{ type: 'string', pattern: /^[0-9a-z]{24}$/ }`,
- path: path in object, eg: `$.comments[].user._id`,
- schema: schema name, eg: `userSchema`
- result: {Any}

@@ -169,11 +175,2 @@

error:
- message: error message, eg: `($.comments[].user._id: "wrong_id") ✖ (pattern: /^[0-9a-z]{24}$/)`
- validator: validator name, eg: `pattern`,
- actual: actual value, eg: `wrong_id`,
- expected: expected schema, eg: `{ type: 'string', pattern: /^[0-9a-z]{24}$/ }`,
- path: path in object, eg: `$.comments[].user._id`,
- schema: schema name, eg: `userSchema`
### More examples

@@ -180,0 +177,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