Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (notification.domain) {
if (!Object.values(DOMAINS).includes(notification.domain))
// eslint-disable-next-line no-console
console.warn(
`Unknown notification domain "${notification.domain}"`,
notification
);
}
// eslint-disable-next-line no-console
else console.warn('Notification is missing domain', notification);
let dismissAfter = meta.dismissAfter;
if (!isNumber(dismissAfter))
dismissAfter = notification.kind === 'success' ? 5000 : 0;
return addNotification(notification, { ...meta, dismissAfter });
}
if (!Object.values(NOTIFICATION_DOMAINS).includes(notification.domain))
// eslint-disable-next-line no-console
console.warn(
`Unknown notification domain "${notification.domain}"`,
notification
);
}
// eslint-disable-next-line no-console
else console.warn('Notification is missing domain', notification);
let dismissAfter = meta.dismissAfter;
if (!isNumber(dismissAfter))
dismissAfter =
notification.kind === NOTIFICATION_KINDS_SIDE.success ? 5000 : 0;
return addNotification>(notification, {
...meta,
dismissAfter,
});
}