MCPcopy Create free account
hub / github.com/cure53/DOMPurify / resolveId

Function resolveId

config/rollup.coverage.config.js:23–34  ·  view source on GitHub ↗
(source, importer)

Source from the content-addressed store, hash-verified

21const resolveTsAsJs = () => ({
22 name: 'resolve-ts-as-js',
23 resolveId(source, importer) {
24 if (importer && source.startsWith('.') && source.endsWith('.js')) {
25 const candidate = path.resolve(
26 path.dirname(importer),
27 source.slice(0, -3) + '.ts'
28 );
29 if (fs.existsSync(candidate)) {
30 return candidate;
31 }
32 }
33 return null;
34 },
35});
36
37module.exports = {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected