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

ml-array-xy-max-y

Package Overview
Dependencies
Maintainers
4
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ml-array-xy-max-y - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

src/__tests__/maxY.test.js

8

CHANGELOG.md

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

22

lib/index.js
'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 @@ }

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