Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

is2

Package Overview
Dependencies
Maintainers
2
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is2 - npm Package Compare versions

Comparing version 1.0.6 to 1.0.7

16

index.js

@@ -692,2 +692,18 @@ /**

/**
* Test if 'value' is within 'precision' decimal places from 'comparitor'.
* Alias: closish, near.
* @param {Number} value value to test
* @param {Number} comparitor value to test 'value' against
* @param {Number} precision number of decimals to compare floating points, defaults to 2
* @return {Boolean} true if 'value' is within 'precision' decimal places from 'comparitor', false otherwise.
*/
is.prettyClose = function(value, comparitor, precision) {
if (!is.number(value) || !is.number(comparitor)) return false;
if (is.defined(precision) && !is.posInt(precision)) return false;
if (is.undefined(precision)) precision = 2;
return value.toFixed(precision) === comparitor.toFixed(precision);
};
is.closish = is.near = is.prettyClose;
////////////////////////////////////////////////////////////////////////////////

@@ -694,0 +710,0 @@ // Networking

2

package.json
{
"name": "is2",
"version": "1.0.6",
"version": "1.0.7",
"description": "A type checking library where each exported function returns either true or false and does not throw. Also added tests.",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -101,2 +101,3 @@ is2

* is.withIn(val, start, finish) - is.within
* is.prettyClose(val, comp, precision) - is.closish, is.near

@@ -103,0 +104,0 @@ Networking:

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc