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

@antv/util

Package Overview
Dependencies
Maintainers
7
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@antv/util - npm Package Compare versions

Comparing version 1.2.1 to 1.2.2

dist/util-1.2.2.min.js

5

lib/math/index.js

@@ -0,1 +1,3 @@

var isNumberEqual = require('./is-number-equal');
module.exports = {

@@ -8,3 +10,3 @@ clamp: require('./clamp'),

isNegative: require('./is-negative'),
isNumberEqual: require('./is-number-equal'),
isNumberEqual: isNumberEqual,
isOdd: require('./is-odd'),

@@ -15,2 +17,3 @@ isPositive: require('./is-positive'),

mod: require('./mod'),
snapEqual: isNumberEqual,
toDegree: require('./to-degree'),

@@ -17,0 +20,0 @@ toInt: require('./to-integer'),

8

lib/math/is-number-equal.js
var PRECISION = 0.00001; // numbers less than this is considered as 0
var isNumberEqual = function isNumberEqual(a, b) {
return Math.abs(a - b) < PRECISION;
};
module.exports = function isNumberEqual(a, b) {
var precision = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : PRECISION;
module.exports = isNumberEqual;
return Math.abs(a - b) < precision;
};
{
"name": "@antv/util",
"version": "1.2.1",
"version": "1.2.2",
"description": "A common util collection for antv projects",

@@ -5,0 +5,0 @@ "main": "build/util.js",

@@ -0,1 +1,3 @@

const isNumberEqual = require('./is-number-equal');
module.exports = {

@@ -8,3 +10,3 @@ clamp: require('./clamp'),

isNegative: require('./is-negative'),
isNumberEqual: require('./is-number-equal'),
isNumberEqual,
isOdd: require('./is-odd'),

@@ -15,2 +17,3 @@ isPositive: require('./is-positive'),

mod: require('./mod'),
snapEqual: isNumberEqual,
toDegree: require('./to-degree'),

@@ -17,0 +20,0 @@ toInt: require('./to-integer'),

const PRECISION = 0.00001; // numbers less than this is considered as 0
const isNumberEqual = function(a, b) {
return Math.abs((a - b)) < PRECISION;
module.exports = function isNumberEqual(a, b, precision = PRECISION) {
return Math.abs((a - b)) < precision;
};
module.exports = isNumberEqual;

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