mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-03 04:30:06 +08:00
fix: use Object.prototype.toString to check object (#20546)
close #20528
This commit is contained in:
parent
8ea9356399
commit
4297f33e85
@ -189,4 +189,8 @@ describe('message', () => {
|
||||
jest.advanceTimersByTime(1500);
|
||||
expect(document.querySelectorAll('.ant-message-notice').length).toBe(0);
|
||||
});
|
||||
|
||||
it('should not throw error when pass null', () => {
|
||||
message.error(null);
|
||||
});
|
||||
});
|
||||
|
@ -114,7 +114,10 @@ type JointContent = ConfigContent | ArgsProps;
|
||||
export type ConfigOnClose = () => void;
|
||||
|
||||
function isArgsProps(content: JointContent): content is ArgsProps {
|
||||
return typeof content === 'object' && !!(content as ArgsProps).content;
|
||||
return (
|
||||
Object.prototype.toString.call(content) === '[object Object]' &&
|
||||
!!(content as ArgsProps).content
|
||||
);
|
||||
}
|
||||
|
||||
export interface ConfigOptions {
|
||||
|
Loading…
Reference in New Issue
Block a user