ml-array-max
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-max@1.0.2...ml-array-max@1.1.0) (2018-10-26) | ||
**Note:** Version bump only for package ml-array-max | ||
<a name="1.0.2"></a> | ||
@@ -8,0 +16,0 @@ ## [1.0.2](https://github.com/mljs/array/compare/ml-array-max@1.0.1...ml-array-max@1.0.2) (2018-08-03) |
'use strict'; | ||
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } | ||
var isArray = _interopDefault(require('is-any-array')); | ||
/** | ||
@@ -9,8 +13,8 @@ * Computes the maximum of the given values | ||
function max(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 +21,0 @@ |
{ | ||
"name": "ml-array-max", | ||
"version": "1.0.2", | ||
"version": "1.1.0", | ||
"description": "Get the maximum value in an array", | ||
@@ -21,3 +21,7 @@ "main": "lib/index.js", | ||
}, | ||
"homepage": "https://github.com/mljs/array/tree/master/packages/array-max#readme" | ||
"homepage": "https://github.com/mljs/array/tree/master/packages/array-max#readme", | ||
"dependencies": { | ||
"is-any-array": "^0.0.3" | ||
}, | ||
"gitHead": "812f53d78df7770c287916b88e94de51815f574b" | ||
} |
@@ -0,1 +1,3 @@ | ||
import isArray from 'is-any-array'; | ||
/** | ||
@@ -7,8 +9,8 @@ * Computes the maximum of the given values | ||
export default function max(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'); | ||
} | ||
@@ -15,0 +17,0 @@ |
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
4455
60
0
1
+ Addedis-any-array@^0.0.3
+ Addedis-any-array@0.0.3(transitive)