diff --git a/package-lock.json b/package-lock.json index 197e3fd..3a6f80d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,6 @@ "version": "2.0.1", "license": "Apache-2.0", "dependencies": { - "@jridgewell/resolve-uri": "^3.0.3", "@jridgewell/trace-mapping": "^0.2.2", "sourcemap-codec": "1.4.8" }, diff --git a/package.json b/package.json index c831ff3..22fb87d 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,6 @@ "typescript": "4.4.4" }, "dependencies": { - "@jridgewell/resolve-uri": "^3.0.3", "@jridgewell/trace-mapping": "^0.2.2", "sourcemap-codec": "1.4.8" } diff --git a/rollup.config.js b/rollup.config.js index 54c7fd7..7159724 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -12,7 +12,6 @@ function configure(esm) { entryFileNames: '[name].umd.js', sourcemap: true, globals: { - '@jridgewell/resolve-uri': 'resolveURI', '@jridgewell/trace-mapping': 'traceMapping', 'sourcemap-codec': 'sourcemapCodec', }, diff --git a/src/resolve.ts b/src/resolve.ts deleted file mode 100644 index 8ef7db7..0000000 --- a/src/resolve.ts +++ /dev/null @@ -1,10 +0,0 @@ -import resolveUri from '@jridgewell/resolve-uri'; - -export default function resolve(input: string, base: string | undefined): string { - // The base is always treated as a directory, if it's not empty. - // https://github.com/mozilla/source-map/blob/8cb3ee57/lib/util.js#L327 - // https://github.com/chromium/chromium/blob/da4adbb3/third_party/blink/renderer/devtools/front_end/sdk/SourceMap.js#L400-L401 - if (base && !base.endsWith('/')) base += '/'; - - return resolveUri(input, base); -} diff --git a/test/unit/resolve.ts b/test/unit/resolve.ts deleted file mode 100644 index b04992c..0000000 --- a/test/unit/resolve.ts +++ /dev/null @@ -1,17 +0,0 @@ -import resolve from '../../src/resolve'; - -describe('resolve', () => { - test('resolves input relative to base', () => { - const base = 'bar/'; - const input = 'foo'; - - expect(resolve(input, base)).toBe('bar/foo'); - }); - - test('treats base as a directory regardless of slash', () => { - const base = 'bar'; - const input = 'foo'; - - expect(resolve(input, base)).toBe('bar/foo'); - }); -});