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

archetype-js

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

archetype-js - npm Package Compare versions

Comparing version 0.2.9 to 0.2.10

2

package.json
{
"name": "archetype-js",
"version": "0.2.9",
"version": "0.2.10",
"author": "Valeri Karpov <val@boosterfuels.com>",

@@ -5,0 +5,0 @@ "dependencies": {

@@ -263,7 +263,18 @@ 'use strict';

if (Array.isArray(schema._paths[path].$enum)) {
if (schema._paths[path].$enum.indexOf(val) === -1) {
const msg = `Value "${val}" invalid, allowed values are ` +
`"${inspect(schema._paths[path].$enum)}"`;
error.markError(path, new Error(msg));
return;
if (Array.isArray(val)) {
_.each(val, (val, index) => {
if (schema._paths[path].$enum.indexOf(val) === -1) {
const msg = `Value "${val}" invalid, allowed values are ` +
`"${inspect(schema._paths[path].$enum)}"`;
error.markError([path, index].join('.'), new Error(msg));
return;
}
});
} else {
if (schema._paths[path].$enum.indexOf(val) === -1) {
const msg = `Value "${val}" invalid, allowed values are ` +
`"${inspect(schema._paths[path].$enum)}"`;
error.markError(path, new Error(msg));
return;
}
}

@@ -270,0 +281,0 @@ }

@@ -391,3 +391,6 @@ 'use strict';

$enum: ['steak and eggs', 'bacon and eggs']
}
},
addOns: [
{ name: { $type: 'string', $enum: ['cheese', 'sour cream'] } }
]
}).compile();

@@ -399,5 +402,10 @@

assert.throws(function() {
new Breakfast({ addOns: [{ name: 'maple syrup' }] });
}, /Value "maple syrup" invalid/);
// works
new Breakfast({ type: 'steak and eggs' });
new Breakfast({});
new Breakfast({ addOns: [{ name: 'cheese' }] });
});

@@ -404,0 +412,0 @@

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