Guest User

Untitled

a guest
Jun 20th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. export default (url, targetPath, whichElementInUrlPartsArray) => {
  2. const parts = url.path.split('/').filter(part => part.trim() !== '')
  3. const isMatch = parts[whichElementInUrlPartsArray] === targetPath
  4. return {
  5. isMatch,
  6. parts,
  7. };
  8. };
Add Comment
Please, Sign In to add comment