@tyriar/fibonacci-heap
Advanced tools
+1
-1
| { | ||
| "name": "@tyriar/fibonacci-heap", | ||
| "version": "2.0.6", | ||
| "version": "2.0.7", | ||
| "description": "An implementation of the Fibonacci heap data structure", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -8,6 +8,6 @@ /** | ||
| import { Node } from './node'; | ||
| import { IKeyComparable } from './interfaces'; | ||
| import { INode } from './interfaces'; | ||
| import { NodeListIterator } from './nodeListIterator'; | ||
| export type CompareFunction<K> = (a: IKeyComparable<K>, b: IKeyComparable<K>) => number; | ||
| export type CompareFunction<K, V> = (a: INode<K, V>, b: INode<K, V>) => number; | ||
@@ -19,3 +19,3 @@ export class FibonacciHeap<K, V> { | ||
| constructor( | ||
| private _compare?: CompareFunction<K> | ||
| private _compare?: CompareFunction<K, V> | ||
| ) { | ||
@@ -163,3 +163,3 @@ if (!_compare) { | ||
| */ | ||
| private _defaultCompare(a: IKeyComparable<K>, b: IKeyComparable<K>): number { | ||
| private _defaultCompare(a: INode<K, V>, b: INode<K, V>): number { | ||
| if (a.key > b.key) { | ||
@@ -166,0 +166,0 @@ return 1; |
@@ -7,9 +7,5 @@ /** | ||
| export interface IKeyComparable<K> { | ||
| key: K; | ||
| } | ||
| export interface INode<K, V> { | ||
| key: K; | ||
| value: V; | ||
| value?: V; | ||
| } |
+2
-2
@@ -7,5 +7,5 @@ /** | ||
| import { IKeyComparable, INode } from './interfaces'; | ||
| import { INode } from './interfaces'; | ||
| export class Node<K, V> implements INode<K, V>, IKeyComparable<K> { | ||
| export class Node<K, V> implements INode<K, V> { | ||
| public key: K; | ||
@@ -12,0 +12,0 @@ public value: V; |
@@ -7,3 +7,3 @@ /** | ||
| import { IKeyComparable, INode } from "../src/interfaces"; | ||
| import { INode } from "../src/interfaces"; | ||
| import { CompareFunction } from "../src/fibonacciHeap"; | ||
@@ -20,3 +20,3 @@ | ||
| */ | ||
| constructor(compare?: CompareFunction<K>); | ||
| constructor(compare?: CompareFunction<K, V>); | ||
@@ -23,0 +23,0 @@ /** |
Sorry, the diff of this file is not supported yet
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
37731
-0.33%784
-0.38%