@blackglory/structures
Advanced tools
Comparing version 0.7.0 to 0.8.0
@@ -1,2 +0,7 @@ | ||
export declare class SparseMap { | ||
import { TypedArrayConstructor } from 'justypes'; | ||
interface ISparseMapOptions { | ||
capacity?: number; | ||
growthFactor?: number; | ||
} | ||
export declare class SparseMap<T extends TypedArrayConstructor> { | ||
private keyToIndex; | ||
@@ -6,2 +11,3 @@ private indexToKey; | ||
get [Symbol.toStringTag](): string; | ||
constructor(typedArrayConstructor: T, { capacity, growthFactor }?: ISparseMapOptions); | ||
entries(): Iterable<[key: number, value: number]>; | ||
@@ -15,1 +21,2 @@ keys(): Iterable<number>; | ||
} | ||
export {}; |
@@ -6,6 +6,6 @@ "use strict"; | ||
class SparseMap { | ||
constructor() { | ||
this.keyToIndex = new dynamic_typed_array_1.DynamicTypedArray(Uint32Array); | ||
this.indexToKey = new dynamic_typed_array_1.DynamicTypedArray(Uint32Array); | ||
this.indexToValue = new dynamic_typed_array_1.DynamicTypedArray(Uint32Array); | ||
constructor(typedArrayConstructor, { capacity = 0, growthFactor = 1.5 } = {}) { | ||
this.indexToValue = new dynamic_typed_array_1.DynamicTypedArray(typedArrayConstructor, { capacity, growthFactor }); | ||
this.keyToIndex = new dynamic_typed_array_1.DynamicTypedArray(Uint32Array, { capacity, growthFactor }); | ||
this.indexToKey = new dynamic_typed_array_1.DynamicTypedArray(Uint32Array, { capacity, growthFactor }); | ||
} | ||
@@ -12,0 +12,0 @@ get [Symbol.toStringTag]() { |
@@ -1,4 +0,10 @@ | ||
export declare class SparseSet implements Iterable<number> { | ||
import { UnsignedTypedArrayConstructor } from 'justypes'; | ||
export interface ISparseSetOptions { | ||
capacity?: number; | ||
growthFactor?: number; | ||
} | ||
export declare class SparseSet<T extends UnsignedTypedArrayConstructor> implements Iterable<number> { | ||
private valueToIndex; | ||
private indexToValue; | ||
private valueToIndex; | ||
constructor(typedArrayConstructor: T, { capacity, growthFactor }?: ISparseSetOptions); | ||
get [Symbol.toStringTag](): string; | ||
@@ -5,0 +11,0 @@ [Symbol.iterator](): IterableIterator<number>; |
@@ -6,5 +6,5 @@ "use strict"; | ||
class SparseSet { | ||
constructor() { | ||
this.indexToValue = new dynamic_typed_array_1.DynamicTypedArray(Uint32Array); | ||
this.valueToIndex = new dynamic_typed_array_1.DynamicTypedArray(Uint32Array); | ||
constructor(typedArrayConstructor, { capacity = 0, growthFactor = 1.5 } = {}) { | ||
this.indexToValue = new dynamic_typed_array_1.DynamicTypedArray(typedArrayConstructor, { capacity, growthFactor }); | ||
this.valueToIndex = new dynamic_typed_array_1.DynamicTypedArray(Uint32Array, { capacity, growthFactor }); | ||
} | ||
@@ -11,0 +11,0 @@ get [Symbol.toStringTag]() { |
@@ -1,2 +0,7 @@ | ||
export declare class SparseMap { | ||
import { TypedArrayConstructor } from 'justypes'; | ||
interface ISparseMapOptions { | ||
capacity?: number; | ||
growthFactor?: number; | ||
} | ||
export declare class SparseMap<T extends TypedArrayConstructor> { | ||
private keyToIndex; | ||
@@ -6,2 +11,3 @@ private indexToKey; | ||
get [Symbol.toStringTag](): string; | ||
constructor(typedArrayConstructor: T, { capacity, growthFactor }?: ISparseMapOptions); | ||
entries(): Iterable<[key: number, value: number]>; | ||
@@ -15,1 +21,2 @@ keys(): Iterable<number>; | ||
} | ||
export {}; |
@@ -6,6 +6,6 @@ "use strict"; | ||
class SparseMap { | ||
constructor() { | ||
this.keyToIndex = new dynamic_typed_array_1.DynamicTypedArray(Uint32Array); | ||
this.indexToKey = new dynamic_typed_array_1.DynamicTypedArray(Uint32Array); | ||
this.indexToValue = new dynamic_typed_array_1.DynamicTypedArray(Uint32Array); | ||
constructor(typedArrayConstructor, { capacity = 0, growthFactor = 1.5 } = {}) { | ||
this.indexToValue = new dynamic_typed_array_1.DynamicTypedArray(typedArrayConstructor, { capacity, growthFactor }); | ||
this.keyToIndex = new dynamic_typed_array_1.DynamicTypedArray(Uint32Array, { capacity, growthFactor }); | ||
this.indexToKey = new dynamic_typed_array_1.DynamicTypedArray(Uint32Array, { capacity, growthFactor }); | ||
} | ||
@@ -12,0 +12,0 @@ get [Symbol.toStringTag]() { |
@@ -1,4 +0,10 @@ | ||
export declare class SparseSet implements Iterable<number> { | ||
import { UnsignedTypedArrayConstructor } from 'justypes'; | ||
export interface ISparseSetOptions { | ||
capacity?: number; | ||
growthFactor?: number; | ||
} | ||
export declare class SparseSet<T extends UnsignedTypedArrayConstructor> implements Iterable<number> { | ||
private valueToIndex; | ||
private indexToValue; | ||
private valueToIndex; | ||
constructor(typedArrayConstructor: T, { capacity, growthFactor }?: ISparseSetOptions); | ||
get [Symbol.toStringTag](): string; | ||
@@ -5,0 +11,0 @@ [Symbol.iterator](): IterableIterator<number>; |
@@ -6,5 +6,5 @@ "use strict"; | ||
class SparseSet { | ||
constructor() { | ||
this.indexToValue = new dynamic_typed_array_1.DynamicTypedArray(Uint32Array); | ||
this.valueToIndex = new dynamic_typed_array_1.DynamicTypedArray(Uint32Array); | ||
constructor(typedArrayConstructor, { capacity = 0, growthFactor = 1.5 } = {}) { | ||
this.indexToValue = new dynamic_typed_array_1.DynamicTypedArray(typedArrayConstructor, { capacity, growthFactor }); | ||
this.valueToIndex = new dynamic_typed_array_1.DynamicTypedArray(Uint32Array, { capacity, growthFactor }); | ||
} | ||
@@ -11,0 +11,0 @@ get [Symbol.toStringTag]() { |
{ | ||
"name": "@blackglory/structures", | ||
"version": "0.7.0", | ||
"version": "0.8.0", | ||
"description": "", | ||
@@ -76,5 +76,5 @@ "files": [ | ||
"iterable-operator": "^1.1.0", | ||
"justypes": "^2.1.0", | ||
"justypes": "^2.2.0", | ||
"rxjs": "^7.5.5" | ||
} | ||
} |
@@ -212,6 +212,14 @@ # structures | ||
```ts | ||
class SparseSet { | ||
class SparseSet<T extends UnsignedTypedArrayConstructor> { | ||
get [Symbol.toStringTag](): string | ||
get [Symbol.iterator](): IterableIterator<number> | ||
constructor( | ||
typedArrayConstructor: T | ||
, options?: { | ||
capacity?: number = 0 | ||
growthFactor?: number = 1.5 | ||
} | ||
) | ||
add(value: number): void | ||
@@ -225,5 +233,13 @@ has(value: number): boolean | ||
```ts | ||
class SparseMap<T> { | ||
class SparseMap<T extends TypedArrayConstructor> { | ||
get [Symbol.toStringTag](): string | ||
constructor( | ||
typedArrayConstructor: T | ||
, options?: { | ||
capacity?: number = 0 | ||
growthFactor?: number = 1.5 | ||
} | ||
) | ||
entries(): Iterable<[key: number, value: number]> | ||
@@ -255,6 +271,6 @@ keys(): Iterable<number> | ||
typedArrayConstructor: T | ||
, options: { | ||
, options?: { | ||
capacity?: number = 0 | ||
growthFactor?: number = 1.5 | ||
} = {} | ||
} | ||
) | ||
@@ -261,0 +277,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
6987113
40248
281
Updatedjustypes@^2.2.0