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

@stoplight/yaml

Package Overview
Dependencies
Maintainers
18
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 3.1.0 to 3.1.1

2

package.json
{
"name": "@stoplight/yaml",
"version": "3.1.0",
"version": "3.1.1",
"description": "Useful functions when working with YAML.",

@@ -5,0 +5,0 @@ "keywords": [

@@ -40,12 +40,21 @@ "use strict";

const container = {};
const seenKeys = [];
const handleMergeKeys = options !== void 0 && options.mergeKeys === true;
const handleDuplicates = (options !== void 0 && options.json === false) || duplicatedMappingKeys !== void 0;
for (const mapping of node.mappings) {
if (mapping.key.value in container) {
if (options !== void 0 && options.json === false) {
throw new Error('Duplicate YAML mapping key encountered');
const key = mapping.key.value;
if (handleDuplicates && (!handleMergeKeys || key !== "<<")) {
if (seenKeys.includes(mapping.key.value)) {
if (options !== void 0 && options.json === false) {
throw new Error('Duplicate YAML mapping key encountered');
}
if (duplicatedMappingKeys !== void 0) {
duplicatedMappingKeys.push(mapping.key);
}
}
if (duplicatedMappingKeys !== void 0) {
duplicatedMappingKeys.push(mapping.key);
else {
seenKeys.push(key);
}
}
if (options !== void 0 && options.mergeKeys === true && mapping.key.value === "<<") {
if (handleMergeKeys && key === "<<") {
Object.assign(container, reduceMergeKeys(exports.walkAST(mapping.value, options, duplicatedMappingKeys)));

@@ -52,0 +61,0 @@ }

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