Socket
Socket
Sign inDemoInstall

is-bigint

Package Overview
Dependencies
0
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
Weekly downloads
28M
decreased by-2.23%
Maintainers
1
Install size
13.7 kB
Created
Weekly downloads
 

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.2 - 2021-05-04

Commits

  • [meta] do not publish github action workflow files 276d677
  • [actions] use node/install instead of node/run; use codecov action cea7fb6
  • [readme] fix repo URLs; remove travis badge c8e7c36
  • [Dev Deps] update eslint, @ljharb/eslint-config, aud, has-symbols, object-inspect, tape 32f3d90
  • [Dev Deps] update eslint, @ljharb/eslint-config, object-inspect, tape c2f20f5
  • [meta] remove unneeded token; update checkout action 94e46e9
  • [meta] use prepublishOnly script for npm 7+ 3e663ec

Readme

Source

is-bigint Version Badge

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 04 May 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