New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

asyncapi-validator

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

asyncapi-validator - npm Package Compare versions

Comparing version

to
3.1.1

index.d.ts

5

CHANGELOG.md
Change Log
==========
Version 3.1.1 *(2021-09-30)*
----------------------------
* Add TS types
* Fix JSDocs for `fromSource()`
Version 3.1.0 *(2021-08-22)*

@@ -5,0 +10,0 @@ ----------------------------

3

package.json
{
"name": "asyncapi-validator",
"version": "3.1.0",
"version": "3.1.1",
"description": "message validator through asyncapi schema",
"main": "index.js",
"types": "index.d.ts",
"scripts": {

@@ -7,0 +8,0 @@ "test": "jest",

@@ -8,7 +8,10 @@ const ValidationError = require('./ValidationError')

* @param {string} source
* @param {{ msgIdentifier?: string ; ignoreArray?: boolean }} options
* @param {{ msgIdentifier: string ; ignoreArray?: boolean }} options
* @returns {Promise<MessageValidator>}
*/
this.fromSource = async (source, options = {}) => {
this.fromSource = async (source, options) => {
const {_json: schema} = await Parser.parse(source)
if (!options || !options.msgIdentifier) {
throw new ValidationError('"msgIdentifier" is required')
}
const channels = constructsChannels(schema, options.msgIdentifier)

@@ -25,5 +28,2 @@ return new MessageValidator(schema, options, channels)

const channels = {}
if (!msgIdentifier) {
throw new ValidationError('"msgIdentifier" is required')
}

@@ -30,0 +30,0 @@ Object.keys(schema.channels).forEach(c => {