All files / ua guards.js

100% Statements 11/11
100% Branches 9/9
100% Functions 5/5
100% Lines 8/8

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17  56x 56x   826x 56x   824x 56x     1133x 1133x        
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isEncoder = (instance) => 
// eslint-disable-next-line @typescript-eslint/no-explicit-any
instance !== null && typeof instance['encode'] === 'function';
exports.isDecoder = (instance) => 
// eslint-disable-next-line @typescript-eslint/no-explicit-any
instance !== null && typeof instance['decode'] === 'function';
exports.isTypedArray = (instance) => instance instanceof Uint8Array ||
    instance instanceof Uint16Array ||
    instance instanceof Uint32Array;
exports.isNotNullObject = (instance) => typeof instance === 'object' && instance !== null;
exports.keyInObject = (v, key) => key in v;
// export const isIndexable = (instance: unknown, value: string): value is keyof typeof instance => {
//   return typeof instance === 'object' && instance !== null && value in instance
// }