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

mnemonist

Package Overview
Dependencies
Maintainers
1
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mnemonist - npm Package Compare versions

Comparing version 0.31.2 to 0.31.3

5

CHANGELOG.md
# Changelog
## 0.31.3
* Fixing `Heap.nsmallest` & `Heap.nlargest` docs & typings.
* Fixing `Heap.nsmallest` & `Heap.nlargest` not using custom comparator function when `n = 1`.
## 0.31.2

@@ -4,0 +9,0 @@

4

heap.d.ts

@@ -81,5 +81,5 @@ /**

export function nsmallest<T>(n: number, comparator: HeapComparator<T>, values: Iterable<T>): Array<T>;
export function nsmallest<T>(comparator: HeapComparator<T>, n: number, values: Iterable<T>): Array<T>;
export function nsmallest<T>(n: number, values: Iterable<T>): Array<T>;
export function nlargest<T>(n: number, comparator: HeapComparator<T>, values: Iterable<T>): Array<T>;
export function nlargest<T>(comparator: HeapComparator<T>, n: number, values: Iterable<T>): Array<T>;
export function nlargest<T>(n: number, values: Iterable<T>): Array<T>;

@@ -212,3 +212,3 @@ /**

// If n is equal to 1, it's just a matter of find the minimum
// If n is equal to 1, it's just a matter of finding the minimum
if (n === 1) {

@@ -219,3 +219,3 @@ if (iterables.isArrayLike(iterable)) {

if (v < min)
if (min === Infinity || compare(v, min) < 0)
min = v;

@@ -231,3 +231,3 @@ }

forEach(iterable, function(value) {
if (value < min)
if (min === Infinity || compare(value, min) < 0)
min = value;

@@ -310,3 +310,3 @@ });

// If n is equal to 1, it's just a matter of find the maximum
// If n is equal to 1, it's just a matter of finding the maximum
if (n === 1) {

@@ -317,3 +317,3 @@ if (iterables.isArrayLike(iterable)) {

if (v > max)
if (max === -Infinity || compare(v, max) > 0)
max = v;

@@ -329,3 +329,3 @@ }

forEach(iterable, function(value) {
if (value > max)
if (max === -Infinity || compare(value, max) > 0)
max = value;

@@ -332,0 +332,0 @@ });

{
"name": "mnemonist",
"version": "0.31.2",
"version": "0.31.3",
"description": "Curated collection of data structures for the JavaScript language.",

@@ -5,0 +5,0 @@ "scripts": {

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