Socket
Socket
Sign inDemoInstall

protodef-validator

Package Overview
Dependencies
6
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    protodef-validator

Validate ProtoDef protocol definition in node


Version published
Maintainers
1
Install size
1.48 MB
Created

Readme

Source

ProtoDef-validator

NPM version Discord Gitter Irc Build Status Try it on gitpod

Validate ProtoDef protocol definition in node

Installing

npm install protodef-validator

Usage

See example

Command Line Interface

You can install this package globally with npm install -g protodef-validator and then run protodef-validator someProtocol.json to validate it.

API

Validator

Class to make validator instances

Validator.addType(name [,schema])

add the type name with schema schema

If schema isn't specified, use a default schema.

Validator.addTypes(schemas)

Add schemas which is an object with keys the name of the schemas and values the schema definitions.

Validator.validateType(type)

validates a type definition type

throws an exception if the type isn't correct

Validator.validateProtocol(protocol)

validates a protocol definition protocol

throws an exception if the protocol isn't correct

History

1.3.0

  • update protodef

1.2.3

  • add .json suffix when requiring (for webpack)

1.2.2

  • fix release

1.2.1

  • update ajv and protodef

1.2.0

  • allow : in switch keys

1.1.7

  • properly define compareTo/compareToValue

1.1.6

  • fix compareToValue switch property allowance

1.1.5

  • properly normalize schema names

1.1.4

  • normalize refs

1.1.3

  • print errors again

1.1.2

  • fix release

1.1.1

  • recreate ajv instance to recompile if types were validated hence compiled

1.1.0

  • check the datatypes have been defined
  • make it possible to add types with a default schema
  • better errors

1.0.2

  • ignore already added types

1.0.1

  • fix index.js

1.0.0

  • can validate types and protocols

Keywords

FAQs

Last updated on 10 Jun 2021

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc