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

find-ancestors

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

find-ancestors - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

2

index.js

@@ -119,3 +119,3 @@ 'use strict';

if (!nodes) {
if (!nodes.length) {
return result;

@@ -122,0 +122,0 @@ }

{
"name": "find-ancestors",
"version": "1.0.2",
"description": "Get all ancestors elements of a nested node",
"version": "1.0.3",
"description": "Recursively find and return a nested node and all its ancestors (parents) from a nested data structure (i.e. tree)",
"main": "index.js",

@@ -6,0 +6,0 @@ "scripts": {

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

var current;
var predicate = function(item) {
return item.id === 4;
};

@@ -14,5 +17,2 @@ describe('find-ancestors', function() {

it('should return a matched object from plain arrays & generate uniques meta IDs', function() {
var predicate = function(item) {
return item.id === 4;
};

@@ -23,2 +23,4 @@ var custom = [{ id: 1}, { id: 4}];

expect(current).to.be.deep.equal([{ id: 4, __id: 2 }]);
// Ensure that findAncestors doesn't modify passed object
expect(initial).to.be.deep.equal(initial);
});

@@ -49,6 +51,7 @@

.to.throw(/should be a function/);
expect(findAncestors.bind(null, { data: [], predicate: predicate }))
.not.to.throw(TypeError);
});
});
});
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