(url: string|string[])
| 225 | } |
| 226 | |
| 227 | export const nodeFileSystemRouter = (url: string|string[]) => { |
| 228 | if (Array.isArray(url)) { |
| 229 | if (url.every( |
| 230 | urlElement => urlElement.startsWith(NodeFileSystem.URL_SCHEME))) { |
| 231 | return new NodeFileSystem(url.map( |
| 232 | urlElement => urlElement.slice(NodeFileSystem.URL_SCHEME.length))); |
| 233 | } else { |
| 234 | return null; |
| 235 | } |
| 236 | } else { |
| 237 | if (url.startsWith(NodeFileSystem.URL_SCHEME)) { |
| 238 | return new NodeFileSystem(url.slice(NodeFileSystem.URL_SCHEME.length)); |
| 239 | } else { |
| 240 | return null; |
| 241 | } |
| 242 | } |
| 243 | }; |
| 244 | // Registration of `nodeFileSystemRouter` is done in index.ts. |
| 245 | |
| 246 | /** |
no test coverage detected
searching dependent graphs…