Guest User

Untitled

a guest
Feb 17th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. function split (thing) {
  2. if (typeof thing === 'string') {
  3. return thing.split('/')
  4. } else if (thing.fast_slash) {
  5. return ''
  6. } else {
  7. var match = thing.toString()
  8. .replace('\\/?', '')
  9. .replace('(?=\\/|$)', '$')
  10. .match(/^\/\^((?:\\[.*+?^${}()|[\]\\\/]|[^.*+?^${}()|[\]\\\/])*)\$\//)
  11. return match
  12. ? match[1].replace(/\\(.)/g, '$1').split('/')
  13. : '<complex:' + thing.toString() + '>'
  14. }
  15. }
Add Comment
Please, Sign In to add comment