Socket
Socket
Sign inDemoInstall

@xliic/preserving-json-yaml-parser

Package Overview
Dependencies
2
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.7.2 to 1.7.3

5

lib/parse.js

@@ -75,3 +75,3 @@ "use strict";

const stack = [container];
visit(root, "fakeroot", root, {
visit(null, "fakeroot", root, {
onObjectStart: (parent, key, value, location) => {

@@ -107,2 +107,5 @@ if (location) {

});
if (typeof stack[0].fakeroot !== "object") {
return undefined;
}
const range = (_a = (0, preserve_1.getPreservedLocation)(stack[0], "fakeroot")) === null || _a === void 0 ? void 0 : _a.value;

@@ -109,0 +112,0 @@ (0, preserve_1.setPreservedRootRange)(stack[0].fakeroot, range);

2

lib/visit/json.js

@@ -14,3 +14,3 @@ "use strict";

const location = { value: { start: node.offset, end: node.offset + node.length } };
if (parent.type === "property") {
if (parent && parent.type === "property") {
const key = parent.children[0];

@@ -17,0 +17,0 @@ location.key = { start: key.offset, end: key.offset + key.length };

@@ -19,3 +19,3 @@ "use strict";

const location = { value: { start: node.startPosition, end: node.endPosition } };
if (parent.kind === yaml_language_server_parser_1.Kind.MAPPING) {
if (parent && parent.kind === yaml_language_server_parser_1.Kind.MAPPING) {
location.key = { start: parent.key.startPosition, end: parent.key.endPosition };

@@ -22,0 +22,0 @@ }

{
"name": "@xliic/preserving-json-yaml-parser",
"version": "1.7.2",
"version": "1.7.3",
"description": "YAML/JSON parser and serializer that preserves formatting of the original numerical values (i.e. 1.0 vs 1) and handles integers bigger than MAX_SAFE_INTEGER",

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc