Socket
Socket
Sign inDemoInstall

jjve

Package Overview
Dependencies
0
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

jjve


Version published
Maintainers
1
Install size
15.4 kB
Created

Readme

Source

JJV Errors (jjve) Build Status

This is a library to render JJV validation output.

Usage

var jjv = require('jjv');
var jjve = require('jjve');

var env = jjv();
var je = jjve(env);

var schema = {
  type: 'object',
  properties: { ok: { type: 'boolean' } },
};

var data = { ok: 1 };

var result = env.validate(schema, data);

if (result) {
  var errors = je(schema, data, result);
  console.log(JSON.stringify(errors, null, 4));
}

Output

[
    {
        "code": "INVALID_TYPE",
        "message": "Invalid type: integer should be boolean",
        "data": 1,
        "path": "$.ok"
    }
]

License

This work is licensed under the MIT License (see the LICENSE file).

Error messages derived from z-schema (see the NOTICE file).

Keywords

FAQs

Last updated on 21 Sep 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc