This repository has been archived on 2026-05-03. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
novarix-networks-homepage/node_modules/next/dist/esm/next-devtools/server/shared.js
T
Kismet Hasanaj 34dc9aec52 .
2026-05-02 20:07:02 +02:00

32 lines
1.4 KiB
JavaScript

import { codeFrameColumns } from '../../shared/lib/errors/code-frame';
import { ignoreListAnonymousStackFramesIfSandwiched as ignoreListAnonymousStackFramesIfSandwichedGeneric } from '../../server/lib/source-maps';
export function ignoreListAnonymousStackFramesIfSandwiched(responses) {
ignoreListAnonymousStackFramesIfSandwichedGeneric(responses, (response)=>{
return response.status === 'fulfilled' && response.value.originalStackFrame !== null && response.value.originalStackFrame.file === '<anonymous>';
}, (response)=>{
return response.status === 'fulfilled' && response.value.originalStackFrame !== null && response.value.originalStackFrame.ignored === true;
}, (response)=>{
return response.status === 'fulfilled' && response.value.originalStackFrame !== null ? response.value.originalStackFrame.methodName : '';
}, (response)=>{
;
response.value.originalStackFrame.ignored = true;
});
}
/**
* It looks up the code frame of the traced source.
* @note It ignores Next.js/React internals, as these can often be huge bundled files.
*/ export function getOriginalCodeFrame(frame, source, colors = process.stdout.isTTY) {
if (!source || frame.line1 == null) {
return null;
}
return codeFrameColumns(source, {
start: {
line: frame.line1,
column: frame.column1 ?? undefined
}
}, {
color: colors
}) ?? null;
}
//# sourceMappingURL=shared.js.map