hadron-document
Advanced tools
Comparing version 3.1.0 to 3.1.1
@@ -68,2 +68,25 @@ 'use strict'; | ||
/** | ||
* Get an element by a series of segment names. | ||
* | ||
* @param {Array} path - The series of fieldnames. Cannot be empty. | ||
* | ||
* @returns {Element} The element. | ||
*/ | ||
getChild(path) { | ||
if (!path) { | ||
return undefined; | ||
} | ||
let element = this.elements.get(path[0]); | ||
let i = 1; | ||
while (i < path.length) { | ||
if (element === undefined) { | ||
return undefined; | ||
} | ||
element = element.get(path[i]); | ||
i++; | ||
} | ||
return element; | ||
} | ||
/** | ||
* Get the _id value for the document. | ||
@@ -70,0 +93,0 @@ * |
@@ -91,7 +91,6 @@ 'use strict'; | ||
} | ||
} else { | ||
if (this.isModified()) { | ||
this.revert(); | ||
} | ||
} | ||
if (this.isModified()) { | ||
this.revert(); | ||
} | ||
} | ||
@@ -98,0 +97,0 @@ |
@@ -7,3 +7,3 @@ { | ||
"homepage": "https://github.com/mongodb-js/hadron-document", | ||
"version": "3.1.0", | ||
"version": "3.1.1", | ||
"repository": { | ||
@@ -10,0 +10,0 @@ "type": "git", |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
79528
20
1644
0