wip: simplify formatMessage internal logic

pull/34/head
legobt 2 years ago
parent 5bc9293f93
commit c874a124b9
No known key found for this signature in database
GPG Key ID: AB99C6D5F471E4E6

@ -60,8 +60,10 @@
: ArrayBuffer.isView; : ArrayBuffer.isView;
var formatMessage = function (message) { var formatMessage = function (message) {
var notString, type = typeof message; var type = typeof message;
if (type !== 'string') { if (type === 'string') {
return [message, false];
}
if (type === 'object') { if (type === 'object') {
if (message === null) { if (message === null) {
throw new Error(INPUT_ERROR); throw new Error(INPUT_ERROR);
@ -73,9 +75,7 @@
} else { } else {
throw new Error(INPUT_ERROR); throw new Error(INPUT_ERROR);
} }
notString = true; return [message, true];
}
return [message, notString];
} }
var empty = function (message) { var empty = function (message) {

Loading…
Cancel
Save