diff --git a/src/io/index.ts b/src/io/index.ts index a0852b2c..b60ec916 100644 --- a/src/io/index.ts +++ b/src/io/index.ts @@ -1,15 +1,7 @@ -import url from 'url' import { ensureNotNullish } from '../typescript' import { Filehandle } from '../cramFile/filehandle' import { LocalFile, RemoteFile } from 'generic-filehandle' -function fromUrl(source: string) { - const { protocol, pathname } = url.parse(source) - if (protocol === 'file:') { - return new LocalFile(unescape(ensureNotNullish(pathname))) - } - return new RemoteFile(source) -} function open( maybeUrl?: string, @@ -20,7 +12,7 @@ function open( return maybeFilehandle } if (maybeUrl) { - return fromUrl(maybeUrl) + return new RemoteFile(maybeUrl) } if (maybePath) { return new LocalFile(maybePath) @@ -28,6 +20,6 @@ function open( throw new Error('no url, path, or filehandle provided, cannot open') } -export { fromUrl, open } +export { open } export { LocalFile, RemoteFile } from 'generic-filehandle'