wip: simplify formatMessage internal logic

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

@ -64,7 +64,9 @@
if (type === 'string') {
return [message, false];
}
if (type === 'object') {
if (type !== 'object') {
throw new Error(INPUT_ERROR);
}
if (message === null) {
throw new Error(INPUT_ERROR);
} else if (ARRAY_BUFFER && message.constructor === ArrayBuffer) {
@ -72,9 +74,6 @@
} else if (!isArray(message) && !isView(message)) {
throw new Error(INPUT_ERROR);
}
} else {
throw new Error(INPUT_ERROR);
}
return [message, true];
}

Loading…
Cancel
Save