Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function split (thing) {
- if (typeof thing === 'string') {
- return thing.split('/')
- } else if (thing.fast_slash) {
- return ''
- } else {
- var match = thing.toString()
- .replace('\\/?', '')
- .replace('(?=\\/|$)', '$')
- .match(/^\/\^((?:\\[.*+?^${}()|[\]\\\/]|[^.*+?^${}()|[\]\\\/])*)\$\//)
- return match
- ? match[1].replace(/\\(.)/g, '$1').split('/')
- : '<complex:' + thing.toString() + '>'
- }
- }
Add Comment
Please, Sign In to add comment