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

better-ajv-errors

Package Overview
Dependencies
Maintainers
3
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

better-ajv-errors - npm Package Compare versions

Comparing version 0.4.1 to 0.4.2

4

lib/legacy/json/find-error-position.js

@@ -16,5 +16,5 @@ 'use strict';

var _dataPath$split$slice = dataPath.split('/').slice(1).reduce(function (obj, pointer) {
return obj.value[pointer] || obj.value.value[pointer];
return obj[_parse.VALUE_SYMBOL][pointer] || obj[_parse.VALUE_SYMBOL][_parse.VALUE_SYMBOL][pointer];
}, (0, _parse2.default)(jsonString)),
_dataPath$split$slice2 = _dataPath$split$slice.meta,
_dataPath$split$slice2 = _dataPath$split$slice[_parse.META_SYMBOL],
line = _dataPath$split$slice2.line,

@@ -21,0 +21,0 @@ column = _dataPath$split$slice2.column;

'use strict';
exports.__esModule = true;
exports.VALUE_SYMBOL = exports.META_SYMBOL = undefined;
var _symbol = require('babel-runtime/core-js/symbol');
var _symbol2 = _interopRequireDefault(_symbol);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// Custom JSON parser based on https://github.com/douglascrockford/JSON-js/blob/master/json_parse.js

@@ -10,2 +18,5 @@ var line = void 0;

var META_SYMBOL = exports.META_SYMBOL = (0, _symbol2.default)('meta');
var VALUE_SYMBOL = exports.VALUE_SYMBOL = (0, _symbol2.default)('value');
var escapee = {

@@ -203,4 +214,4 @@ '"': '"',

var obj = {};
obj.meta = { line, column };
obj.value = {};
obj[META_SYMBOL] = { line, column };
obj[VALUE_SYMBOL] = {};

@@ -222,5 +233,5 @@ if (ch === '{') {

}
obj.value[key] = {};
obj.value[key].meta = { line, column: c };
obj.value[key].value = value();
obj[VALUE_SYMBOL][key] = {};
obj[VALUE_SYMBOL][key][META_SYMBOL] = { line, column: c };
obj[VALUE_SYMBOL][key][VALUE_SYMBOL] = value();
white();

@@ -274,4 +285,2 @@ if (ch === '}') {

return result;
};
module.exports = exports['default'];
};

@@ -15,3 +15,3 @@ 'use strict';

// TODO: Handle json pointer escape notation and better error handling
const { meta: { line, column } } = dataPath.split('/').slice(1).reduce((obj, pointer) => obj.value[pointer] || obj.value.value[pointer], (0, _parse2.default)(jsonString));
const { [_parse.META_SYMBOL]: { line, column } } = dataPath.split('/').slice(1).reduce((obj, pointer) => obj[_parse.VALUE_SYMBOL][pointer] || obj[_parse.VALUE_SYMBOL][_parse.VALUE_SYMBOL][pointer], (0, _parse2.default)(jsonString));

@@ -18,0 +18,0 @@ return { line, column };

@@ -10,2 +10,5 @@ 'use strict';

const META_SYMBOL = exports.META_SYMBOL = Symbol('meta');
const VALUE_SYMBOL = exports.VALUE_SYMBOL = Symbol('value');
const escapee = {

@@ -203,4 +206,4 @@ '"': '"',

const obj = {};
obj.meta = { line, column };
obj.value = {};
obj[META_SYMBOL] = { line, column };
obj[VALUE_SYMBOL] = {};

@@ -222,5 +225,5 @@ if (ch === '{') {

}
obj.value[key] = {};
obj.value[key].meta = { line, column: c };
obj.value[key].value = value();
obj[VALUE_SYMBOL][key] = {};
obj[VALUE_SYMBOL][key][META_SYMBOL] = { line, column: c };
obj[VALUE_SYMBOL][key][VALUE_SYMBOL] = value();
white();

@@ -274,4 +277,2 @@ if (ch === '}') {

return result;
};
module.exports = exports['default'];
};
{
"name": "better-ajv-errors",
"version": "0.4.1",
"version": "0.4.2",
"description": "JSON Schema validation for Human",

@@ -5,0 +5,0 @@ "repository": "torifat/better-ajv-errors",

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