browser-bookmarks
Advanced tools
Comparing version 0.1.2 to 0.2.0
@@ -108,3 +108,3 @@ import os from 'os'; | ||
// first item | ||
expect(chrome.getChildren(items)[0]).toEqual({ | ||
expect(chrome.getChildren(items)).toContainEqual({ | ||
date_added: 200, | ||
@@ -119,3 +119,3 @@ id: 2, | ||
// second item | ||
expect(chrome.getChildren(items)[1]).toEqual({ | ||
expect(chrome.getChildren(items)).toContainEqual({ | ||
date_added: 400, | ||
@@ -122,0 +122,0 @@ id: 4, |
@@ -71,14 +71,17 @@ const fs = require('fs'); | ||
let bookmarks = []; | ||
children.forEach((child) => { | ||
// if it's a folder, recursively retrieve it's childs | ||
for (let i = 0; i < children.length; i++) { | ||
const child = children[i]; | ||
if (child.type === 'folder') { | ||
const grandChildren = getChildren(child.children); | ||
const folded = grandChildren.map(x => Object.assign({}, x, { | ||
folder: child.name, | ||
})); | ||
bookmarks = bookmarks.concat(folded); | ||
const gc = getChildren(child.children); | ||
for (let j = 0; j < gc.length; j++) { | ||
const fgc = Object.assign({}, gc[j], { | ||
folder: child.name, | ||
}); | ||
bookmarks.push(fgc); | ||
} | ||
} else { | ||
bookmarks.push(child); | ||
} | ||
}); | ||
} | ||
return bookmarks; | ||
@@ -85,0 +88,0 @@ }; |
{ | ||
"name": "browser-bookmarks", | ||
"version": "0.1.2", | ||
"version": "0.2.0", | ||
"description": "Retrieve bookmarks from different browsers.", | ||
@@ -20,3 +20,3 @@ "keywords": [ | ||
"babel-eslint": "^7.0.0", | ||
"babel-jest": "^16.0.0", | ||
"babel-jest": "^18.0.0", | ||
"babel-plugin-transform-async-to-generator": "^6.16.0", | ||
@@ -29,4 +29,4 @@ "babel-polyfill": "^6.16.0", | ||
"eslint-plugin-import": "^2.0.0", | ||
"jest": "^16.0.1" | ||
"jest": "^18.1.0" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
119637
18
348