useAPIErrorHandler: Improve type-safety of getPrefixedId()

This commit is contained in:
Gustav Hansen 2023-03-15 15:27:37 +01:00
parent 7f11c8bbdf
commit 17f773ebd3

View File

@ -6,7 +6,7 @@ export function getPrefixedId(message, callback) {
// if a prefix function has been passed in it is used to
// prefix the id, e.g. to allow an error message to be
// set only for a localization namespace
if (callback) {
if (typeof callback === 'function') {
return callback(prefixedMessage);
}