ml-array-xy-max-y
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -6,2 +6,10 @@ # Change Log | ||
## [1.0.2](https://github.com/mljs/array-xy/compare/ml-array-xy-max-y@1.0.1...ml-array-xy-max-y@1.0.2) (2021-03-04) | ||
**Note:** Version bump only for package ml-array-xy-max-y | ||
## [1.0.1](https://github.com/mljs/array-xy/compare/ml-array-xy-max-y@1.0.0...ml-array-xy-max-y@1.0.1) (2019-10-02) | ||
@@ -8,0 +16,0 @@ |
'use strict'; | ||
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } | ||
var binarySearch = _interopDefault(require('binary-search')); | ||
var binarySearch = require('binary-search'); | ||
var numSort = require('num-sort'); | ||
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } | ||
var binarySearch__default = /*#__PURE__*/_interopDefaultLegacy(binarySearch); | ||
/** | ||
@@ -23,3 +25,3 @@ * @param {object} points | ||
to = { index: x.length }, | ||
reverse = false | ||
reverse = false, | ||
} = options; | ||
@@ -35,5 +37,5 @@ | ||
var currentMax = Number.MIN_VALUE; | ||
var currentIndex; | ||
for (var i = from.index; i < to.index; i++) { | ||
let currentMax = Number.MIN_VALUE; | ||
let currentIndex; | ||
for (let i = from.index; i < to.index; i++) { | ||
if (currentMax < y[i]) { | ||
@@ -47,3 +49,3 @@ currentMax = y[i]; | ||
index: currentIndex, | ||
value: currentMax | ||
value: currentMax, | ||
}; | ||
@@ -61,5 +63,5 @@ } | ||
if (reverse) { | ||
index = binarySearch(x, value, numSort.desc); | ||
index = binarySearch__default['default'](x, value, numSort.descending); | ||
} else { | ||
index = binarySearch(x, value, numSort.asc); | ||
index = binarySearch__default['default'](x, value, numSort.ascending); | ||
} | ||
@@ -66,0 +68,0 @@ |
{ | ||
"name": "ml-array-xy-max-y", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Find the maximum ordinate value in a range of abscissas of a {x:[], y:[]}", | ||
@@ -23,6 +23,6 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"binary-search": "^1.3.5", | ||
"binary-search": "^1.3.6", | ||
"num-sort": "^2.0.0" | ||
}, | ||
"gitHead": "5492ab43b72cd1ca20367c5df4187951dbe19038" | ||
"gitHead": "f8cbc3d5b283b62e648247c20880c2ce166cf184" | ||
} |
@@ -19,3 +19,3 @@ import binarySearch from 'binary-search'; | ||
to = { index: x.length }, | ||
reverse = false | ||
reverse = false, | ||
} = options; | ||
@@ -31,5 +31,5 @@ | ||
var currentMax = Number.MIN_VALUE; | ||
var currentIndex; | ||
for (var i = from.index; i < to.index; i++) { | ||
let currentMax = Number.MIN_VALUE; | ||
let currentIndex; | ||
for (let i = from.index; i < to.index; i++) { | ||
if (currentMax < y[i]) { | ||
@@ -43,3 +43,3 @@ currentMax = y[i]; | ||
index: currentIndex, | ||
value: currentMax | ||
value: currentMax, | ||
}; | ||
@@ -46,0 +46,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
10214
186
Updatedbinary-search@^1.3.6