Some checks failed
Test Suite / unit-tests (3.11) (push) Has been cancelled
Test Suite / unit-tests (3.12) (push) Has been cancelled
Test Suite / code-quality (push) Has been cancelled
Test Suite / security-scan (push) Has been cancelled
Test Suite / integration-tests (push) Has been cancelled
Test Suite / e2e-tests (push) Has been cancelled
Test Suite / performance-tests (push) Has been cancelled
Test Suite / test-summary (push) Has been cancelled
- Add comprehensive image test document with various image types - Update project structure with development artifacts - Prepare foundation for image support enhancement phase - Include test files for validating image editing workflows 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
17 lines
699 B
TypeScript
17 lines
699 B
TypeScript
import resolveUri from '@jridgewell/resolve-uri';
|
|
import stripFilename from './strip-filename';
|
|
|
|
type Resolve = (source: string | null) => string;
|
|
export default function resolver(
|
|
mapUrl: string | null | undefined,
|
|
sourceRoot: string | undefined,
|
|
): Resolve {
|
|
const from = stripFilename(mapUrl);
|
|
// The sourceRoot 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
|
|
const prefix = sourceRoot ? sourceRoot + '/' : '';
|
|
|
|
return (source) => resolveUri(prefix + (source || ''), from);
|
|
}
|