Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@silen/is-int8-array

sileny5MIT1.0.3TypeScript support: included

Check if the parameter is int8array

type, typescript, isInt8Array, is-int8-array

readme

is-int8-array

Determine if a value is Int8Array

install

npm i @silen/is-int8-array

api

  • declare function isInt8Array(val: any): boolean;

usage

const { isInt8Array } = require('@silen/is-int8-array');
// or
import { isInt8Array } from '@silen/is-int8-array';

console.log(isInt8Array(new Buffer(4)));
console.log(isInt8Array(Buffer.alloc(4)));
console.log(isInt8Array(undefined));
console.log(isInt8Array(null));
console.log(isInt8Array(''));
console.log(isInt8Array(true));
console.log(isInt8Array(0));
console.log(isInt8Array(1));
console.log(isInt8Array(1.0));
console.log(isInt8Array('string'));
console.log(isInt8Array({}));
console.log(isInt8Array(function foo() {}));
console.log(isInt8Array(Symbol()));
console.log(isInt8Array(new Set));
console.log(isInt8Array(new Map));
console.log(isInt8Array(new WeakMap));
console.log(isInt8Array(new WeakSet));

// or
console.log(window.Type.isInt8Array(new WeakSet));

This is a demo for testing the usage of isInt8Array from @silen/is-int8-array module. You can try the others and do likewise.

others