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

ml-array-median

Package Overview
Dependencies
Maintainers
5
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ml-array-median - npm Package Compare versions

Comparing version 1.0.2 to 1.1.0

src/__tests__/median.test.js

8

CHANGELOG.md

@@ -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)

7

lib/index.js

@@ -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 @@

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