Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- export default (url, targetPath, whichElementInUrlPartsArray) => {
- const parts = url.path.split('/').filter(part => part.trim() !== '')
- const isMatch = parts[whichElementInUrlPartsArray] === targetPath
- return {
- isMatch,
- parts,
- };
- };
Add Comment
Please, Sign In to add comment