Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@wmfs/j2119

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wmfs/j2119 - npm Package Compare versions

Comparing version 1.6.1 to 1.6.2

test/fixtures/AlternaTymlyExtension.j2119

13

lib/j2119/assigner.js

@@ -108,9 +108,10 @@ const oxford = require('./oxford')

}
} else {
const anyOrObjectOrArray = !type || type === TYPES.object || type === TYPES.array
// object field without a defined child role
if (fieldName && !childType && anyOrObjectOrArray && (modal !== 'MUST NOT')) {
this.roles.addGrandchildRole(role, fieldName, fieldName)
this.allowedFields.setAny(fieldName)
}
}
// object field without a defined child role
if (fieldName && !childType && !type && (modal !== 'MUST NOT')) {
this.roles.addGrandchildRole(role, fieldName, fieldName)
this.allowedFields.setAny(fieldName)
}
} // assignConstraints

@@ -117,0 +118,0 @@

{
"name": "@wmfs/j2119",
"version": "1.6.1",
"version": "1.6.2",
"description": "A general-purpose validator generator that uses RFC2119-style assertions as input.",

@@ -5,0 +5,0 @@ "author": "West Midlands Fire Service",

@@ -124,2 +124,3 @@ /* eslint-env mocha */

const EXTENSION = require.resolve('./fixtures/TymlyExtension.j2119')
const ALTERNAEXTENSION = require.resolve('./fixtures/AlternaTymlyExtension.j2119')
const BAD = require.resolve('./fixtures/Bad.j2119')

@@ -169,15 +170,39 @@

it('load an extension', () => {
describe('load an Tymly extension', () => {
const v = validator(SCHEMA, EXTENSION)
const p = v.validate(STATE_MACHINE)
expect(p.length).to.eql(2) // missing extensions!
it('missing extension elements', () => {
const p = v.validate(STATE_MACHINE)
expect(p.length).to.eql(2) // missing extensions!
})
const np = v.validate(STATE_MACHINE_WITH_RESOURCE_CONFIG_OBJECT)
expect(np.length).to.eql(0)
it('resource config object is valid', () => {
const np = v.validate(STATE_MACHINE_WITH_RESOURCE_CONFIG_OBJECT)
expect(np.length).to.eql(0)
})
const nnp = v.validate(STATE_MACHINE_WITH_RESOURCE_CONFIG_ARRAY)
expect(nnp.length).to.eql(0)
it('resource config array is not valid', () => {
const nnp = v.validate(STATE_MACHINE_WITH_RESOURCE_CONFIG_ARRAY)
expect(nnp.length).to.eql(1)
})
})
describe('load an AlternaTymly extension', () => {
const v = validator(SCHEMA, ALTERNAEXTENSION)
it('missing extension elements', () => {
const p = v.validate(STATE_MACHINE)
expect(p.length).to.eql(2) // missing extensions!
})
it('resource config object is valid', () => {
const np = v.validate(STATE_MACHINE_WITH_RESOURCE_CONFIG_OBJECT)
expect(np.length).to.eql(1)
})
it('resource config array is not valid', () => {
const nnp = v.validate(STATE_MACHINE_WITH_RESOURCE_CONFIG_ARRAY)
expect(nnp.length).to.eql(0)
})
})
it('report when unable to load', () => {

@@ -184,0 +209,0 @@ expect(() => validator(SCHEMA, 'chuckle-brothers')).to.throw('no such file')

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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