mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2024-11-10 19:56:54 +03:00
Implement the ability to exclude certain file names (extensions for now)
This commit is contained in:
parent
983aeb71ab
commit
2960ac6eae
1
packages/redux-devtools-trace-monitor/src/presets.js
Normal file
1
packages/redux-devtools-trace-monitor/src/presets.js
Normal file
|
@ -0,0 +1 @@
|
|||
export const toExclude = /chrome-extension:\/\/|moz-extension:\/\//;
|
|
@ -10,6 +10,7 @@ import type { StackFrame } from './stack-frame';
|
|||
import { parse } from './parser';
|
||||
import { map } from './mapper';
|
||||
import { unmap } from './unmapper';
|
||||
import { toExclude } from '../../presets';
|
||||
|
||||
function getStackFrames(
|
||||
error: Error,
|
||||
|
@ -39,9 +40,10 @@ function getStackFrames(
|
|||
}
|
||||
*/
|
||||
return enhancedFrames.filter(
|
||||
({ functionName }) =>
|
||||
functionName == null ||
|
||||
functionName.indexOf('__stack_frame_overlay_proxy_console__') === -1
|
||||
({ functionName, fileName }) =>
|
||||
(functionName == null ||
|
||||
functionName.indexOf('__stack_frame_overlay_proxy_console__') === -1) &&
|
||||
!toExclude.test(fileName)
|
||||
);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ const actions = {
|
|||
1: { type: 'PERFORM_ACTION', action: { type: 'INCREMENT_COUNTER' } },
|
||||
2: {
|
||||
type: 'PERFORM_ACTION', action: { type: 'INCREMENT_COUNTER' },
|
||||
stack: 'Error\n at fn1 (app.js:72:24)\n at fn2 (app.js:84:31)'
|
||||
stack: 'Error\n at fn1 (app.js:72:24)\n at fn2 (app.js:84:31)\n at fn3 (chrome-extension://lmhkpmbekcpmknklioeibfkpmmfibljd/js/page.bundle.js:1269:80)'
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -57,7 +57,8 @@ exports[`StackTraceTab component should render with props, but without stack 1`]
|
|||
},
|
||||
"stack": "Error
|
||||
at fn1 (app.js:72:24)
|
||||
at fn2 (app.js:84:31)",
|
||||
at fn2 (app.js:84:31)
|
||||
at fn3 (chrome-extension://lmhkpmbekcpmknklioeibfkpmmfibljd/js/page.bundle.js:1269:80)",
|
||||
"type": "PERFORM_ACTION",
|
||||
},
|
||||
}
|
||||
|
@ -118,7 +119,8 @@ exports[`StackTraceTab component should render with trace stack 1`] = `
|
|||
},
|
||||
"stack": "Error
|
||||
at fn1 (app.js:72:24)
|
||||
at fn2 (app.js:84:31)",
|
||||
at fn2 (app.js:84:31)
|
||||
at fn3 (chrome-extension://lmhkpmbekcpmknklioeibfkpmmfibljd/js/page.bundle.js:1269:80)",
|
||||
"type": "PERFORM_ACTION",
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user