Comparing version 0.25.1 to 0.26.0
@@ -24,7 +24,7 @@ /** | ||
clear(): void; | ||
set(index: number, value?: boolean | number); | ||
set(index: number, value?: boolean | number): this; | ||
reset(index: number, value: boolean | number); | ||
flip(index: number, value: boolean | number); | ||
reallocate(capacity: number): this; | ||
grow(capacity: number): this; | ||
grow(capacity?: number): this; | ||
resize(length: number): this; | ||
@@ -31,0 +31,0 @@ push(value: boolean | number): number; |
# Changelog | ||
## 0.26.0 | ||
* Adding the `DefaultMap.autoIncrement` factory. | ||
* Removing the `IncrementalMap`. | ||
* Fixing `Vector` typings. | ||
* Fixing `BitVector` typings. | ||
## 0.25.1 | ||
@@ -4,0 +11,0 @@ |
@@ -25,2 +25,5 @@ /** | ||
inspect(): any; | ||
// Statics | ||
static autoIncrement(): number; | ||
} |
@@ -138,4 +138,15 @@ /** | ||
/** | ||
* Typical factories. | ||
*/ | ||
DefaultMap.autoIncrement = function() { | ||
var i = 0; | ||
return function() { | ||
return i++; | ||
}; | ||
}; | ||
/** | ||
* Exporting. | ||
*/ | ||
module.exports = DefaultMap; |
@@ -23,3 +23,2 @@ /** | ||
export {default as Heap, MinHeap, MaxHeap} from './heap'; | ||
export {default as IncrementalMap} from './incremental-map'; | ||
export {default as InvertedIndex} from './inverted-index'; | ||
@@ -26,0 +25,0 @@ export {default as LinkedList} from './linked-list'; |
@@ -31,3 +31,2 @@ /** | ||
MaxHeap: Heap.MaxHeap, | ||
IncrementalMap: require('./incremental-map.js'), | ||
StaticIntervalTree: require('./static-interval-tree.js'), | ||
@@ -34,0 +33,0 @@ InvertedIndex: require('./inverted-index.js'), |
@@ -110,7 +110,7 @@ /** | ||
// The key already exists, we just need to update the value and splay on top | ||
var existingPointer = this.items[key]; | ||
var pointer = this.items[key]; | ||
if (typeof existingPointer !== 'undefined') { | ||
this.splayOnTop(existingPointer); | ||
this.V[existingPointer] = value; | ||
if (typeof pointer !== 'undefined') { | ||
this.splayOnTop(pointer); | ||
this.V[pointer] = value; | ||
@@ -120,4 +120,2 @@ return; | ||
var pointer; | ||
// The cache is not yet full | ||
@@ -124,0 +122,0 @@ if (this.size < this.capacity) { |
@@ -70,7 +70,7 @@ /** | ||
// The key already exists, we just need to update the value and splay on top | ||
var existingPointer = this.items.get(key); | ||
var pointer = this.items.get(key); | ||
if (typeof existingPointer !== 'undefined') { | ||
this.splayOnTop(existingPointer); | ||
this.V[existingPointer] = value; | ||
if (typeof pointer !== 'undefined') { | ||
this.splayOnTop(pointer); | ||
this.V[pointer] = value; | ||
@@ -80,4 +80,2 @@ return; | ||
var pointer; | ||
// The cache is not yet full | ||
@@ -84,0 +82,0 @@ if (this.size < this.capacity) { |
{ | ||
"name": "mnemonist", | ||
"version": "0.25.1", | ||
"version": "0.26.0", | ||
"description": "Curated collection of data structures for the JavaScript language.", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -78,3 +78,2 @@ [![Build Status](https://travis-ci.org/Yomguithereal/mnemonist.svg)](https://travis-ci.org/Yomguithereal/mnemonist) | ||
* [DefaultMap](https://yomguithereal.github.io/mnemonist/default-map) | ||
* [IncrementalMap](https://yomguithereal.github.io/mnemonist/incremental-map) | ||
@@ -81,0 +80,0 @@ --- |
@@ -21,10 +21,9 @@ /** | ||
// Constructor | ||
constructor(ArrayClass: IArrayLikeConstructor, length: number); | ||
constructor(ArrayClass: IArrayLikeConstructor, options: VectorOptions); | ||
constructor(ArrayClass: IArrayLikeConstructor, length: number | VectorOptions); | ||
// Methods | ||
clear(): void; | ||
set(index: number, value: number); | ||
set(index: number, value: number): this; | ||
reallocate(capacity: number): this; | ||
grow(capacity: number): this; | ||
grow(capacity?: number): this; | ||
resize(length: number): this; | ||
@@ -53,10 +52,9 @@ push(value: number): number; | ||
// Constructor | ||
constructor(length: number); | ||
constructor(options: VectorOptions); | ||
constructor(length: number | VectorOptions); | ||
// Methods | ||
clear(): void; | ||
set(index: number, value: number); | ||
set(index: number, value: number): this; | ||
reallocate(capacity: number): this; | ||
grow(capacity: number): this; | ||
grow(capacity?: number): this; | ||
resize(length: number): this; | ||
@@ -63,0 +61,0 @@ push(value: number): number; |
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
285866
81
10286
107