Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// correct SourceMapSegment tuples. Cast it here to gain type safety.
let source = new Link(map as ExistingDecodedSourceMap, moduleSources);
source = bundleSourcemapChain.reduce(linkMap, source);
let { sources, sourcesContent, names, mappings } = source.traceMappings();
if (file) {
const directory = dirname(file);
sources = sources.map((source: string) => relative(directory, source));
file = basename(file);
}
sourcesContent = (excludeContent ? null : sourcesContent) as string[];
return new SourceMap({ file, sources, sourcesContent, names, mappings });
}