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

@blackglory/structures

Package Overview
Dependencies
Maintainers
1
Versions
101
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@blackglory/structures - npm Package Compare versions

Comparing version 0.7.0 to 0.8.0

9

lib/es2015/sparse-map.d.ts

@@ -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 {};

8

lib/es2015/sparse-map.js

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

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