Socket
Book a DemoInstallSign in
Socket

jsvrx-ajv

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsvrx-ajv

RxJS operators to validate/discriminate data objects using JSON Schema(s) and Ajv.

2.0.0
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

jsvrx-ajv

RxJS operators to validate/discriminate data objects using JSON Schema(s) and Ajv: Another JSON Schema Validator.

npm ajv npm bundle size Top Language MIT License

Install

npm i jsvrx-ajv

Usage

AjvDataValidtor is DataValidator interface implementation using Ajv.

For more information about DataValidation interface and usage examples see jsvrx.

Create a new AjvDataValidator instance using ajv.Options or pass an ajv instace as the constructor's parameter.

import { AjvDataValidator } from 'jsvrx-ajv';
const dv = new AjvDataValidator({ coerceTypes: true })

import ajv from 'ajv';
const dv = new AjvDataValidator(new ajv())

AjvDataValidator.discriminate(ids: JSONSchemaID[], unk?: JSONSchemaID) implementation doesn't provide optimized validation for multiple JSON Schemas. It executes single JSON Schema validation attempts in ids array order. Fill the ids array accordingly.

ValidationError.e holds ajv.ValidateFunction.errors for the validate error and array of ajv.ValidateFunction.errors for the discriminate error.

Keywords

JSON

FAQs

Package last updated on 03 Oct 2021

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.