Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var paths = ['a', 'a/b', 'test/a', 'c', 'test', 'a/b/c']
- var filtered = paths.filter(p1 => {
- const isChildPath = paths.some(p2 => p1.includes(`${p2}/`))
- return !isChildPath;
- })
- console.log(filtered)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement