Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function mapFrame(frame, contexts) {
const sourceUrl = frame.file;
const context = contexts.get(sourceUrl);
if (context == null) {
return frame;
}
const original = Symbolication.getOriginalPositionFor(
frame.lineNumber,
frame.column,
null, // No module IDs in DEV
context,
);
if (!original || !original.source) {
return frame;
}
return Object.assign({}, frame, {
file: original.source,
lineNumber: original.line,
column: original.column,
methodName: original.name || frame.methodName,
});
}