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;
var formatMessage = function (message) {
var notString, type = typeof message;
if (type !== 'string') {
var type = typeof message;
if (type === 'string') {
return [message, false];
}
if (type === 'object') {
if (message === null) {
throw new Error(INPUT_ERROR);
@ -73,9 +75,7 @@
} else {
throw new Error(INPUT_ERROR);
}
notString = true;
}
return [message, notString];
return [message, true];
}
var empty = function (message) {

Loading…
Cancel
Save