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

@stoplight/yaml

Package Overview
Dependencies
Maintainers
11
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stoplight/yaml - npm Package Compare versions

Comparing version 2.2.1 to 2.3.0

14

getLocationForJsonPath.js

@@ -5,5 +5,5 @@ "use strict";

const lineForPosition_1 = require("./lineForPosition");
exports.getLocationForJsonPath = ({ ast, lineMap }, path) => {
const node = findNodeAtPath(ast, path);
if (node === undefined)
exports.getLocationForJsonPath = ({ ast, lineMap }, path, closest = false) => {
const node = findNodeAtPath(ast, path, closest);
if (node === void 0)
return;

@@ -49,3 +49,3 @@ return getLoc(lineMap, { start: getStartPosition(node), end: getEndPosition(node) });

}
function findNodeAtPath(node, path) {
function findNodeAtPath(node, path, closest) {
pathLoop: for (const segment of path) {

@@ -65,3 +65,3 @@ switch (node && node.kind) {

}
break;
return closest ? node : void 0;
case yaml_ast_parser_1.Kind.SEQ:

@@ -74,3 +74,5 @@ for (let i = 0; i < node.items.length; i++) {

}
break;
return closest ? node : void 0;
default:
return closest ? node : void 0;
}

@@ -77,0 +79,0 @@ }

{
"name": "@stoplight/yaml",
"version": "2.2.1",
"version": "2.3.0",
"description": "Useful functions when working with YAML.",

@@ -27,3 +27,3 @@ "keywords": [

"dependencies": {
"@stoplight/types": "4.x.x",
"@stoplight/types": "5.x.x",
"lodash": "4.x.x",

@@ -30,0 +30,0 @@ "yaml-ast-parser": "0.0.43"

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

case yaml_ast_parser_1.Kind.ANCHOR_REF:
if (node.value !== undefined && isCircularAnchorRef(node)) {
if (node.value !== void 0 && isCircularAnchorRef(node)) {
node.value = dereferenceAnchor(node.value, node.referencesAnchor);

@@ -40,0 +40,0 @@ }

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