ml-array-median
Advanced tools
Comparing version 1.0.2 to 1.1.0
@@ -6,2 +6,10 @@ # Change Log | ||
# [1.1.0](https://github.com/mljs/array/compare/ml-array-median@1.0.2...ml-array-median@1.1.0) (2018-10-26) | ||
**Note:** Version bump only for package ml-array-median | ||
<a name="1.0.2"></a> | ||
@@ -8,0 +16,0 @@ ## [1.0.2](https://github.com/mljs/array/compare/ml-array-median@1.0.1...ml-array-median@1.0.2) (2018-08-03) |
@@ -6,2 +6,3 @@ 'use strict'; | ||
var quickSelectMedian = _interopDefault(require('median-quickselect')); | ||
var isArray = _interopDefault(require('is-any-array')); | ||
@@ -14,8 +15,8 @@ /** | ||
function median(input) { | ||
if (!Array.isArray(input)) { | ||
throw new Error('input must be an array'); | ||
if (!isArray(input)) { | ||
throw new TypeError('input must be an array'); | ||
} | ||
if (input.length === 0) { | ||
throw new Error('input must not be empty'); | ||
throw new TypeError('input must not be empty'); | ||
} | ||
@@ -22,0 +23,0 @@ |
{ | ||
"name": "ml-array-median", | ||
"version": "1.0.2", | ||
"version": "1.1.0", | ||
"description": "Get the median value in an array", | ||
@@ -23,4 +23,6 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"is-any-array": "^0.0.3", | ||
"median-quickselect": "^1.0.1" | ||
} | ||
}, | ||
"gitHead": "812f53d78df7770c287916b88e94de51815f574b" | ||
} |
import quickSelectMedian from 'median-quickselect'; | ||
import isArray from 'is-any-array'; | ||
@@ -9,8 +10,8 @@ /** | ||
export default function median(input) { | ||
if (!Array.isArray(input)) { | ||
throw new Error('input must be an array'); | ||
if (!isArray(input)) { | ||
throw new TypeError('input must be an array'); | ||
} | ||
if (input.length === 0) { | ||
throw new Error('input must not be empty'); | ||
throw new TypeError('input must not be empty'); | ||
} | ||
@@ -17,0 +18,0 @@ |
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
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
0
5071
2
63
+ Addedis-any-array@^0.0.3
+ Addedis-any-array@0.0.3(transitive)