(paths: string[])
| 121 | } |
| 122 | |
| 123 | const paths = (paths: string[]) => { |
| 124 | let possibilities: string[] = [] |
| 125 | |
| 126 | paths.forEach((path) => { |
| 127 | possibilities = [ |
| 128 | ...possibilities, // merge previous |
| 129 | ...path.split('/'). // split the path |
| 130 | // @ts-ignore |
| 131 | map((path, index, array) => { // get combination |
| 132 | return array.slice(0, index + 1) |
| 133 | }). // got combinations |
| 134 | map((splitPath, index, splitPaths) => { // put it back as path |
| 135 | if (index < splitPaths.length - 1) // add regex `$` for all |
| 136 | return `${splitPath.join('/')}/$` // merge string back |
| 137 | return splitPath.join('/') // but not the last one |
| 138 | }), |
| 139 | ] |
| 140 | }) |
| 141 | |
| 142 | return possibilities |
| 143 | } |
| 144 | |
| 145 | const replace = ( |
| 146 | path: string, |
no outgoing calls
no test coverage detected
searching dependent graphs…