wip: simplify formatMessage

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

@ -67,10 +67,8 @@
throw new Error(INPUT_ERROR); throw new Error(INPUT_ERROR);
} else if (ARRAY_BUFFER && message.constructor === ArrayBuffer) { } else if (ARRAY_BUFFER && message.constructor === ArrayBuffer) {
message = new Uint8Array(message); message = new Uint8Array(message);
} else if (!isArray(message)) { } else if (!isArray(message) && !isView(message)) {
if (!ARRAY_BUFFER || !isView(message)) { throw new Error(INPUT_ERROR);
throw new Error(INPUT_ERROR);
}
} }
} else { } else {
throw new Error(INPUT_ERROR); throw new Error(INPUT_ERROR);

Loading…
Cancel
Save