export function regexpToPath(thing: any) { 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') : '' } }