Add u8a-only strict variants (#1503)

This commit is contained in:
Jaco
2022-05-25 10:02:01 +03:00
committed by GitHub
parent 2698f6779f
commit fbf973dc2a
20 changed files with 105 additions and 37 deletions
+3 -3
View File
@@ -16,9 +16,9 @@
* ```
*/
// eslint-disable-next-line @typescript-eslint/ban-types
export function isInstanceOf (value: unknown, clazz: Function): boolean {
export function isInstanceOf (value: unknown, Clazz: Function): boolean {
return (
((value && (value as Record<string, unknown>).constructor) === clazz) ||
value instanceof Uint8Array
((value && (value as Record<string, unknown>).constructor) === Clazz) ||
value instanceof Clazz
);
}