mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2025-01-31 19:54:35 +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 { parse } from './parser';
|
||||||
import { map } from './mapper';
|
import { map } from './mapper';
|
||||||
import { unmap } from './unmapper';
|
import { unmap } from './unmapper';
|
||||||
|
import { toExclude } from '../../presets';
|
||||||
|
|
||||||
function getStackFrames(
|
function getStackFrames(
|
||||||
error: Error,
|
error: Error,
|
||||||
|
@ -39,9 +40,10 @@ function getStackFrames(
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
return enhancedFrames.filter(
|
return enhancedFrames.filter(
|
||||||
({ functionName }) =>
|
({ functionName, fileName }) =>
|
||||||
functionName == null ||
|
(functionName == null ||
|
||||||
functionName.indexOf('__stack_frame_overlay_proxy_console__') === -1
|
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' } },
|
1: { type: 'PERFORM_ACTION', action: { type: 'INCREMENT_COUNTER' } },
|
||||||
2: {
|
2: {
|
||||||
type: 'PERFORM_ACTION', action: { type: 'INCREMENT_COUNTER' },
|
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
|
"stack": "Error
|
||||||
at fn1 (app.js:72:24)
|
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",
|
"type": "PERFORM_ACTION",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -118,7 +119,8 @@ exports[`StackTraceTab component should render with trace stack 1`] = `
|
||||||
},
|
},
|
||||||
"stack": "Error
|
"stack": "Error
|
||||||
at fn1 (app.js:72:24)
|
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",
|
"type": "PERFORM_ACTION",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user