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

mumath

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mumath - npm Package Compare versions

Comparing version 0.1.1 to 0.2.0

13

index.js

@@ -7,6 +7,8 @@ /**

module.exports = {
between: decorate(between),
isBetween: decorate(isBetween),
toPrecision: decorate(toPrecision),
getPrecision: decorate(getPrecision)
between: wrap(between),
isBetween: wrap(isBetween),
toPrecision: wrap(toPrecision),
getPrecision: getPrecision,
min: wrap(Math.min),
max: wrap(Math.max)
};

@@ -20,3 +22,3 @@

*/
function decorate(fn){
function wrap(fn){
return function(a){

@@ -89,2 +91,3 @@ var args = arguments;

/**

@@ -91,0 +94,0 @@ * Precision round

{
"name": "mumath",
"version": "0.1.1",
"version": "0.2.0",
"description": "Micro math methods: isBetween, between, getPrecition, toPrecision",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -1,1 +0,8 @@

Some common math operations generalized to objects/arrays
Common math functions extended to objects/arrays.
* `min(a,b)`
* `max(a,b)`
* `between(a,min,max)`
* `isBetween(a,min,max)`
* `toPrecision()`
* `getPrecision()`
var m = require('../index');
var assert = require('assert');
assert.equal(m.min(0,2),0);
assert.equal(m.max(0,2),2);
assert.deepEqual(m.min([0,0],[2,-2]),[0,-2]);
assert.equal(m.between(-100, 0, 100), 0);

@@ -5,0 +9,0 @@ assert.equal(m.between(-100, 100, 0), 0);

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