graph-typed 1.46.3 → 1.46.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/data-structures/binary-tree/binary-tree.d.ts +2 -1
- package/dist/data-structures/binary-tree/binary-tree.js +29 -46
- package/dist/data-structures/binary-tree/rb-tree.js +10 -5
- package/dist/data-structures/hash/hash-map.d.ts +22 -26
- package/dist/data-structures/hash/hash-map.js +104 -76
- package/dist/data-structures/hash/index.d.ts +0 -4
- package/dist/data-structures/hash/index.js +0 -4
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/types/data-structures/hash/hash-map.d.ts +5 -0
- package/dist/types/data-structures/hash/index.d.ts +0 -4
- package/dist/types/data-structures/hash/index.js +0 -4
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.js +1 -1
- package/dist/utils/utils.d.ts +1 -1
- package/dist/utils/utils.js +3 -3
- package/package.json +2 -2
- package/src/data-structures/binary-tree/binary-tree.ts +33 -46
- package/src/data-structures/binary-tree/rb-tree.ts +9 -4
- package/src/data-structures/hash/hash-map.ts +130 -81
- package/src/data-structures/hash/index.ts +0 -4
- package/src/index.ts +1 -1
- package/src/types/data-structures/hash/hash-map.ts +6 -0
- package/src/types/data-structures/hash/index.ts +0 -4
- package/src/types/index.ts +1 -1
- package/src/utils/utils.ts +1 -1
- package/dist/data-structures/hash/coordinate-map.d.ts +0 -44
- package/dist/data-structures/hash/coordinate-map.js +0 -62
- package/dist/data-structures/hash/coordinate-set.d.ts +0 -36
- package/dist/data-structures/hash/coordinate-set.js +0 -52
- package/dist/data-structures/hash/tree-map.d.ts +0 -2
- package/dist/data-structures/hash/tree-map.js +0 -6
- package/dist/data-structures/hash/tree-set.d.ts +0 -2
- package/dist/data-structures/hash/tree-set.js +0 -6
- package/dist/types/data-structures/hash/coordinate-map.d.ts +0 -1
- package/dist/types/data-structures/hash/coordinate-map.js +0 -2
- package/dist/types/data-structures/hash/coordinate-set.d.ts +0 -1
- package/dist/types/data-structures/hash/coordinate-set.js +0 -2
- package/dist/types/data-structures/hash/tree-map.d.ts +0 -1
- package/dist/types/data-structures/hash/tree-map.js +0 -2
- package/dist/types/data-structures/hash/tree-set.d.ts +0 -1
- package/dist/types/data-structures/hash/tree-set.js +0 -2
- package/src/data-structures/hash/coordinate-map.ts +0 -63
- package/src/data-structures/hash/coordinate-set.ts +0 -52
- package/src/data-structures/hash/tree-map.ts +0 -2
- package/src/data-structures/hash/tree-set.ts +0 -2
- package/src/types/data-structures/hash/coordinate-map.ts +0 -1
- package/src/types/data-structures/hash/coordinate-set.ts +0 -1
- package/src/types/data-structures/hash/tree-map.ts +0 -1
- package/src/types/data-structures/hash/tree-set.ts +0 -1
- /package/dist/types/{helpers.d.ts → common.d.ts} +0 -0
- /package/dist/types/{helpers.js → common.js} +0 -0
- /package/src/types/{helpers.ts → common.ts} +0 -0
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CoordinateSet = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* data-structure-typed
|
|
6
|
-
*
|
|
7
|
-
* @author Tyler Zeng
|
|
8
|
-
* @copyright Copyright (c) 2022 Tyler Zeng <zrwusa@gmail.com>
|
|
9
|
-
* @license MIT License
|
|
10
|
-
*/
|
|
11
|
-
class CoordinateSet extends Set {
|
|
12
|
-
constructor(joint) {
|
|
13
|
-
super();
|
|
14
|
-
this._joint = '_';
|
|
15
|
-
if (joint !== undefined)
|
|
16
|
-
this._joint = joint;
|
|
17
|
-
}
|
|
18
|
-
get joint() {
|
|
19
|
-
return this._joint;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* The "has" function overrides the "has" method of the superclass and checks if a value exists in an array after
|
|
23
|
-
* joining its elements with a specified separator.
|
|
24
|
-
* @param {number[]} value - The parameter "value" is an array of numbers.
|
|
25
|
-
* @returns The overridden `has` method is returning the result of calling the `has` method of the superclass, passing
|
|
26
|
-
* in the joined value as an argument.
|
|
27
|
-
*/
|
|
28
|
-
has(value) {
|
|
29
|
-
return super.has(value.join(this._joint));
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* The "add" function overrides the parent class's "add" function by joining the elements of the input array with a
|
|
33
|
-
* specified delimiter before calling the parent class's "add" function.
|
|
34
|
-
* @param {number[]} value - An array of numbers
|
|
35
|
-
* @returns The overridden `add` method is returning the result of calling the `add` method of the superclass
|
|
36
|
-
* (`super.add`) with the joined string representation of the `value` array (`value.join(this._joint)`).
|
|
37
|
-
*/
|
|
38
|
-
add(value) {
|
|
39
|
-
return super.add(value.join(this._joint));
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* The function overrides the delete method and deletes an element from a Set by joining the elements of the input
|
|
43
|
-
* array with a specified joint and then calling the delete method of the parent class.
|
|
44
|
-
* @param {number[]} value - An array of numbers
|
|
45
|
-
* @returns The `delete` method is returning the result of calling the `delete` method of the superclass, with the
|
|
46
|
-
* `value` array joined together using the `_joint` property.
|
|
47
|
-
*/
|
|
48
|
-
delete(value) {
|
|
49
|
-
return super.delete(value.join(this._joint));
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
exports.CoordinateSet = CoordinateSet;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* data-structure-typed
|
|
3
|
-
*
|
|
4
|
-
* @author Tyler Zeng
|
|
5
|
-
* @copyright Copyright (c) 2022 Tyler Zeng <zrwusa@gmail.com>
|
|
6
|
-
* @license MIT License
|
|
7
|
-
*/
|
|
8
|
-
export class CoordinateMap<V> extends Map<any, V> {
|
|
9
|
-
constructor(joint?: string) {
|
|
10
|
-
super();
|
|
11
|
-
if (joint !== undefined) this._joint = joint;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
protected _joint = '_';
|
|
15
|
-
|
|
16
|
-
get joint(): string {
|
|
17
|
-
return this._joint;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* The "has" function overrides the base class's "has" function and checks if a key exists in the map by joining the
|
|
22
|
-
* key array with a specified delimiter.
|
|
23
|
-
* @param {number[]} key - The parameter "key" is an array of numbers.
|
|
24
|
-
* @returns The `has` method is being overridden to return the result of calling the `has` method of the superclass
|
|
25
|
-
* (`super.has`) with the `key` array joined together using the `_joint` property.
|
|
26
|
-
*/
|
|
27
|
-
override has(key: number[]) {
|
|
28
|
-
return super.has(key.join(this._joint));
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* The function overrides the set method of a Map object to convert the key from an array to a string using a specified
|
|
33
|
-
* delimiter before calling the original set method.
|
|
34
|
-
* @param {number[]} key - The key parameter is an array of numbers.
|
|
35
|
-
* @param {V} value - The value parameter is the value that you want to associate with the specified key.
|
|
36
|
-
* @returns The `set` method is returning the result of calling the `set` method of the superclass
|
|
37
|
-
* (`super.set(key.join(this._joint), value)`).
|
|
38
|
-
*/
|
|
39
|
-
override set(key: number[], value: V) {
|
|
40
|
-
return super.set(key.join(this._joint), value);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* The function overrides the get method to join the key array with a specified joint and then calls the super get
|
|
45
|
-
* method.
|
|
46
|
-
* @param {number[]} key - An array of numbers
|
|
47
|
-
* @returns The code is returning the value associated with the specified key in the map.
|
|
48
|
-
*/
|
|
49
|
-
override get(key: number[]) {
|
|
50
|
-
return super.get(key.join(this._joint));
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* The function overrides the delete method and joins the key array using a specified joint character before calling
|
|
55
|
-
* the super delete method.
|
|
56
|
-
* @param {number[]} key - An array of numbers that represents the key to be deleted.
|
|
57
|
-
* @returns The `delete` method is returning the result of calling the `delete` method on the superclass, with the
|
|
58
|
-
* `key` array joined together using the `_joint` property.
|
|
59
|
-
*/
|
|
60
|
-
override delete(key: number[]) {
|
|
61
|
-
return super.delete(key.join(this._joint));
|
|
62
|
-
}
|
|
63
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* data-structure-typed
|
|
3
|
-
*
|
|
4
|
-
* @author Tyler Zeng
|
|
5
|
-
* @copyright Copyright (c) 2022 Tyler Zeng <zrwusa@gmail.com>
|
|
6
|
-
* @license MIT License
|
|
7
|
-
*/
|
|
8
|
-
export class CoordinateSet extends Set<any> {
|
|
9
|
-
constructor(joint?: string) {
|
|
10
|
-
super();
|
|
11
|
-
if (joint !== undefined) this._joint = joint;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
protected _joint = '_';
|
|
15
|
-
|
|
16
|
-
get joint(): string {
|
|
17
|
-
return this._joint;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* The "has" function overrides the "has" method of the superclass and checks if a value exists in an array after
|
|
22
|
-
* joining its elements with a specified separator.
|
|
23
|
-
* @param {number[]} value - The parameter "value" is an array of numbers.
|
|
24
|
-
* @returns The overridden `has` method is returning the result of calling the `has` method of the superclass, passing
|
|
25
|
-
* in the joined value as an argument.
|
|
26
|
-
*/
|
|
27
|
-
override has(value: number[]) {
|
|
28
|
-
return super.has(value.join(this._joint));
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* The "add" function overrides the parent class's "add" function by joining the elements of the input array with a
|
|
33
|
-
* specified delimiter before calling the parent class's "add" function.
|
|
34
|
-
* @param {number[]} value - An array of numbers
|
|
35
|
-
* @returns The overridden `add` method is returning the result of calling the `add` method of the superclass
|
|
36
|
-
* (`super.add`) with the joined string representation of the `value` array (`value.join(this._joint)`).
|
|
37
|
-
*/
|
|
38
|
-
override add(value: number[]) {
|
|
39
|
-
return super.add(value.join(this._joint));
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* The function overrides the delete method and deletes an element from a Set by joining the elements of the input
|
|
44
|
-
* array with a specified joint and then calling the delete method of the parent class.
|
|
45
|
-
* @param {number[]} value - An array of numbers
|
|
46
|
-
* @returns The `delete` method is returning the result of calling the `delete` method of the superclass, with the
|
|
47
|
-
* `value` array joined together using the `_joint` property.
|
|
48
|
-
*/
|
|
49
|
-
override delete(value: number[]) {
|
|
50
|
-
return super.delete(value.join(this._joint));
|
|
51
|
-
}
|
|
52
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|