New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

hadron-document

Package Overview
Dependencies
Maintainers
26
Versions
546
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hadron-document - npm Package Compare versions

Comparing version 3.1.3 to 3.1.4

43

lib/element.js

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

if (this.currentType === 'Array') {
if (element.currentKey === '') {
this.elements.handleEmptyKeys(element);
}
key = element.currentKey + 1;

@@ -253,3 +256,9 @@ }

if (this.currentType === 'Array') {
key = this.elements.lastElement ? this.elements.lastElement.currentKey + 1 : 0;
key = 0;
if (this.elements.lastElement) {
if (this.elements.lastElement.currentKey === '') {
this.elements.handleEmptyKeys(this.elements.lastElement);
}
key = this.elements.lastElement.currentKey + 1;
}
}

@@ -267,7 +276,5 @@ var newElement = this.elements.insertEnd(key, value, true, this);

insertPlaceholder() {
let key = '';
if (this.currentType === 'Array') {
key = this.elements.lastElement ? this.elements.lastElement.currentKey + 1 : 0;
}
return this.insertEnd(key, '');
var newElement = this.elements.insertEnd('', '', true, this);
this._bubbleUp(Events.Added);
return newElement;
}

@@ -718,2 +725,26 @@

/**
* If an element is added after a placeholder, convert that placeholder
* into an empty element with the correct key.
*
* @param {Element} element - The placeholder element.
*/
handleEmptyKeys(element) {
if (element.currentKey === '') {
let e = element;
while (e.currentKey === '') {
if (!e.previousElement) {
e.currentKey = 0;
break;
} else {
e = e.previousElement;
}
}
while (e.nextElement) {
e.nextElement.currentKey = e.currentKey + 1;
e = e.nextElement;
}
}
}
/**
* Insert data before the provided element.

@@ -720,0 +751,0 @@ *

2

package.json

@@ -7,3 +7,3 @@ {

"homepage": "https://github.com/mongodb-js/hadron-document",
"version": "3.1.3",
"version": "3.1.4",
"repository": {

@@ -10,0 +10,0 @@ "type": "git",

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