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

ml-array-rescale

Package Overview
Dependencies
Maintainers
5
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ml-array-rescale - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

6

lib/index.js

@@ -22,4 +22,6 @@ 'use strict';

const minValue = options.min === undefined ? 0 : options.min;
const maxValue = options.max === undefined ? 1 : options.max;
const {
min: minValue = 0,
max: maxValue = 1
} = options;

@@ -26,0 +28,0 @@ if (minValue >= maxValue) {

{
"name": "ml-array-rescale",
"version": "1.0.1",
"version": "1.0.2",
"description": "Rescale an array into a range",

@@ -23,5 +23,5 @@ "main": "lib/index.js",

"dependencies": {
"ml-array-max": "^1.0.0",
"ml-array-min": "^1.0.0"
"ml-array-max": "^1.0.1",
"ml-array-min": "^1.0.1"
}
}

@@ -33,2 +33,3 @@ import rescale from '../index';

expect(rescale([0, 1, 2], {min: 50, max: 100})).toEqual([50, 75, 100]);
expect(rescale([-25, 0, 25, 50, 75], {min: -50, max: 0})).toEqual([-50, -37.5, -25, -12.5, 0]);
});

@@ -35,0 +36,0 @@

@@ -18,4 +18,6 @@ import max from 'ml-array-max';

const minValue = options.min === undefined ? 0 : options.min;
const maxValue = options.max === undefined ? 1 : options.max;
const {
min: minValue = 0,
max: maxValue = 1
} = options;

@@ -22,0 +24,0 @@ if (minValue >= maxValue) {

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