Socket
Socket
Sign inDemoInstall

big.js.safe

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    big.js.safe

big.js but blows up for unsafe integers


Version published
Weekly downloads
5
increased by25%
Maintainers
1
Install size
48.1 kB
Created
Weekly downloads
 

Readme

Source

big.js.safe

big.js but blows up for unsafe integers

npm i --save big.js.safe

const Big = require('big.js.safe')
// your big.js code goes here

Why this module?

When passing a number to big.js this happens:

Big('1234567890123456789').toFixed()  // 1234567890123456789 - All OK
Big(1234567890123456789).toFixed()    // 1234567890123456800 - Precision lost

Here precision is lost without warning.

big.js.safe solves this by simply throwing an error when an unsafe integer is given.

No other modifications are made.

Keywords

FAQs

Last updated on 01 Jan 2019

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