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
1
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 0.6.0 to 0.7.0

12

lib/document.js

@@ -6,2 +6,3 @@ 'use strict';

const map = require('lodash.map');
const some = require('lodash.some');
const Element = require('./element');

@@ -60,2 +61,13 @@ const ObjectGenerator = require('./object-generator');

/**
* Determine if the element is modified at all.
*
* @returns {Boolean} If the element is modified.
*/
isModified() {
return some(this.elements, (element) => {
return element.isModified();
});
}
/**
* The document object is always the root object.

@@ -62,0 +74,0 @@ *

@@ -8,2 +8,3 @@ 'use strict';

const isArray = require('lodash.isarray');
const some = require('lodash.some');
const removeValues = require('lodash.remove');

@@ -115,2 +116,10 @@ const ObjectGenerator = require('./object-generator');

}
if (this.currentType === 'Array') {
return map(this.elements, (element) => {
if (element.elements) {
return element.generateObject();
}
return element.currentValue;
});
}
return ObjectGenerator.generate(this.elements);

@@ -139,2 +148,16 @@ }

/**
* Determine if the element is modified at all.
*
* @returns {Boolean} If the element is modified.
*/
isModified() {
if (this.elements) {
return some(this.elements, (element) => {
return element.isModified();
});
}
return this.isAdded() || this.isEdited() || this.isRemoved();
}
/**
* Is the element flagged for removal?

@@ -174,2 +197,4 @@ *

});
this.parentElement.emit(Events.Removed);
this.parentElement = null;
} else {

@@ -176,0 +201,0 @@ this.currentKey = this.key;

3

package.json

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

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

@@ -35,2 +35,3 @@ "type": "git",

"lodash.remove": "^4.5.0",
"lodash.some": "^4.4.0",
"node-uuid": "^1.4.7"

@@ -37,0 +38,0 @@ },

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