1
0
Fork 0
mirror of https://github.com/codex-team/codex.docs.git synced 2025-08-08 06:55:26 +02:00
refactor
This commit is contained in:
cabad 2018-12-28 22:46:35 +04:00
parent 5a96e5ce8e
commit c053e2ac0a

View file

@ -64,13 +64,11 @@ class Pages {
*/
static removeChildren(pagesAvailable, parent) {
pagesAvailable.forEach(async (item, index) => {
if (item !== null && item._parent === parent) {
if (item === null || item._parent !== parent) {
return;
}
pagesAvailable[index] = null;
pagesAvailable = Pages.removeChildren(pagesAvailable, item._id);
return false;
}
return true;
});
return pagesAvailable;
}