ml-array-rescale
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -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) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7068
107
1
Updatedml-array-max@^1.0.1
Updatedml-array-min@^1.0.1