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

jsonpolice

Package Overview
Dependencies
Maintainers
1
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsonpolice - npm Package Compare versions

Comparing version 8.1.0 to 8.1.1

1

dist/errors.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ValidationError = exports.SchemaError = void 0;
class SchemaError extends Error {

@@ -4,0 +5,0 @@ constructor(scope, type, info) {

21

dist/index.js
"use strict";
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.create = void 0;
const schema_1 = require("./schema");
__export(require("jsonref"));
__export(require("./errors"));
__export(require("./schema"));
__exportStar(require("jsonref"), exports);
__exportStar(require("./errors"), exports);
__exportStar(require("./schema"), exports);
__exportStar(require("./types"), exports);
function create(dataOrUri, opts) {

@@ -11,0 +20,0 @@ return schema_1.StaticSchema.create(dataOrUri, opts);

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.StaticSchema = exports.Schema = void 0;
const refs = require("jsonref");

@@ -41,3 +42,3 @@ const _ = require("lodash");

'oneOf',
'not'
'not',
]);

@@ -101,3 +102,3 @@ }

case 'object':
found = data !== null && typeof data === 'object';
found = data !== null && typeof data === 'object' && !Array.isArray(data);
break;

@@ -129,3 +130,3 @@ case 'array':

}
else if (!spec.enum.find(v => _.isEqual(v, data))) {
else if (!spec.enum.find((v) => _.isEqual(v, data))) {
throw new errors_1.ValidationError(path, Schema.scope(spec), 'enum');

@@ -446,3 +447,3 @@ }

for (let i in data) {
if ((!spec.properties || !spec.properties[i]) && (!spec.patternProperties || !Object.keys(spec.patternProperties).find(p => utils_1.testRegExp(p, i)))) {
if ((!spec.properties || !spec.properties[i]) && (!spec.patternProperties || !Object.keys(spec.patternProperties).find((p) => utils_1.testRegExp(p, i)))) {
try {

@@ -449,0 +450,0 @@ if ((opts.context === 'write' && spec.additionalProperties.readOnly === true) ||

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.testRegExp = exports.enumerableAndDefined = exports.defined = void 0;
function defined(v) {

@@ -4,0 +5,0 @@ return typeof v !== 'undefined';

{
"name": "jsonpolice",
"version": "8.1.0",
"version": "8.1.1",
"description": "JSON Schema parser and validator",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

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