Created
May 20, 2013 20:58
-
-
Save jakeboxer/5615495 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function(dest, src){ | |
| // Split the src into an array of path components | |
| srcComponents = src.split("/") | |
| // Cut out the second to last one | |
| srcComponents.splice(srcComponents.length - 2, 1) | |
| // Join the path components back together into a path | |
| newSrc = srcComponents.join("/") | |
| return dest + newSrc | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment