Socket
Socket
Sign inDemoInstall

is-bigint

Package Overview
Dependencies
1
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    is-bigint

Is this value an ES BigInt?


Version published
Maintainers
1
Install size
26.2 kB
Created

Package description

What is is-bigint?

The is-bigint npm package provides a simple and straightforward way to check if a given value is a BigInt. It is particularly useful in applications where distinguishing between BigInt and other numeric types is necessary for correct operation or data handling.

What are is-bigint's main functionalities?

Check if a value is a BigInt

This feature allows you to verify whether a given value is of the BigInt type. It's useful for type checking in applications that need to handle large integers safely.

const isBigInt = require('is-bigint');

console.log(isBigInt(10n)); // true
console.log(isBigInt(10)); // false

Other packages similar to is-bigint

Changelog

Source

v1.0.4 - 2021-08-11

Commits

  • [eslint] remove unnecessary eslintrc file 7220aa5
  • [readme] add github actions/codecov badges 053a071
  • [Deps] add has-bigints as a runtime dependency 0fc3c9d
  • [Dev Deps] update tape 145f11d

Readme

Source

is-bigint Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

Is this an ES BigInt value?

Example

var isBigInt = require('is-bigint');
assert(!isBigInt(function () {}));
assert(!isBigInt(null));
assert(!isBigInt(function* () { yield 42; return Infinity; });
assert(!isBigInt(Symbol('foo')));

assert(isBigInt(1n));
assert(isBigInt(Object(1n)));

Tests

Simply clone the repo, npm install, and run npm test

Keywords

FAQs

Last updated on 12 Aug 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc