@bemoje/map 1.2.1 → 1.2.3
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/README.md +23 -21
- package/lib/index.cjs +33 -122
- package/lib/index.d.cts +364 -17
- package/lib/index.d.ts +364 -17
- package/lib/index.js +15 -104
- package/package.json +21 -221
- package/lib/ExtMap.cjs +0 -354
- package/lib/ExtMap.d.cts +0 -110
- package/lib/ExtMap.d.ts +0 -110
- package/lib/ExtMap.js +0 -352
- package/lib/TimeoutWeakMap.cjs +0 -122
- package/lib/TimeoutWeakMap.d.cts +0 -75
- package/lib/TimeoutWeakMap.d.ts +0 -75
- package/lib/TimeoutWeakMap.js +0 -120
- package/lib/countUniques.cjs +0 -363
- package/lib/countUniques.d.cts +0 -9
- package/lib/countUniques.d.ts +0 -9
- package/lib/countUniques.js +0 -361
- package/lib/entriesArray.cjs +0 -12
- package/lib/entriesArray.d.cts +0 -19
- package/lib/entriesArray.d.ts +0 -19
- package/lib/entriesArray.js +0 -10
- package/lib/isGenericMap.cjs +0 -18
- package/lib/isGenericMap.d.cts +0 -6
- package/lib/isGenericMap.d.ts +0 -6
- package/lib/isGenericMap.js +0 -16
- package/lib/keysArray.cjs +0 -12
- package/lib/keysArray.d.cts +0 -19
- package/lib/keysArray.d.ts +0 -19
- package/lib/keysArray.js +0 -10
- package/lib/mapGetOrDefault.cjs +0 -18
- package/lib/mapGetOrDefault.d.cts +0 -8
- package/lib/mapGetOrDefault.d.ts +0 -8
- package/lib/mapGetOrDefault.js +0 -16
- package/lib/mapLoad.cjs +0 -15
- package/lib/mapLoad.d.cts +0 -11
- package/lib/mapLoad.d.ts +0 -11
- package/lib/mapLoad.js +0 -13
- package/lib/mapReverse.cjs +0 -24
- package/lib/mapReverse.d.cts +0 -15
- package/lib/mapReverse.d.ts +0 -15
- package/lib/mapReverse.js +0 -22
- package/lib/mapUpdate.cjs +0 -14
- package/lib/mapUpdate.d.cts +0 -13
- package/lib/mapUpdate.d.ts +0 -13
- package/lib/mapUpdate.js +0 -12
- package/lib/sort.cjs +0 -17
- package/lib/sort.d.cts +0 -25
- package/lib/sort.d.ts +0 -25
- package/lib/sort.js +0 -15
- package/lib/sortByKeys.cjs +0 -19
- package/lib/sortByKeys.d.cts +0 -24
- package/lib/sortByKeys.d.ts +0 -24
- package/lib/sortByKeys.js +0 -17
- package/lib/sortByValues.cjs +0 -19
- package/lib/sortByValues.d.cts +0 -25
- package/lib/sortByValues.d.ts +0 -25
- package/lib/sortByValues.js +0 -17
- package/lib/toMap.cjs +0 -12
- package/lib/toMap.d.cts +0 -20
- package/lib/toMap.d.ts +0 -20
- package/lib/toMap.js +0 -10
- package/lib/valuesArray.cjs +0 -12
- package/lib/valuesArray.d.cts +0 -19
- package/lib/valuesArray.d.ts +0 -19
- package/lib/valuesArray.js +0 -10
package/lib/mapReverse.d.cts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { G as GenericMap } from './GenericMap-B4OM3vGu.cjs';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Reverses the order of entries in a Map.
|
|
5
|
-
* @remarks This function creates a new Map with the entries of the original Map in reverse order.
|
|
6
|
-
* The original Map is not modified.
|
|
7
|
-
* @example ```ts
|
|
8
|
-
* mapReverse(new Map([['a', 1], ['b', 2], ['c', 3]]));
|
|
9
|
-
* //=> [['c', 3], ['b', 2], ['a', 1]]
|
|
10
|
-
* ```
|
|
11
|
-
*/
|
|
12
|
-
declare function mapReverse<T extends GenericMap<K, V, 'set' | 'clear' | typeof Symbol.iterator>, K, V>(ins: T): T;
|
|
13
|
-
declare function mapReverse<K, V>(ins: Map<K, V>): Map<K, V>;
|
|
14
|
-
|
|
15
|
-
export { mapReverse };
|
package/lib/mapReverse.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { G as GenericMap } from './GenericMap-B4OM3vGu.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Reverses the order of entries in a Map.
|
|
5
|
-
* @remarks This function creates a new Map with the entries of the original Map in reverse order.
|
|
6
|
-
* The original Map is not modified.
|
|
7
|
-
* @example ```ts
|
|
8
|
-
* mapReverse(new Map([['a', 1], ['b', 2], ['c', 3]]));
|
|
9
|
-
* //=> [['c', 3], ['b', 2], ['a', 1]]
|
|
10
|
-
* ```
|
|
11
|
-
*/
|
|
12
|
-
declare function mapReverse<T extends GenericMap<K, V, 'set' | 'clear' | typeof Symbol.iterator>, K, V>(ins: T): T;
|
|
13
|
-
declare function mapReverse<K, V>(ins: Map<K, V>): Map<K, V>;
|
|
14
|
-
|
|
15
|
-
export { mapReverse };
|
package/lib/mapReverse.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
|
|
4
|
-
// src/mapLoad.ts
|
|
5
|
-
function mapLoad(ins, entries) {
|
|
6
|
-
for (const [key, value] of entries) {
|
|
7
|
-
ins.set(key, value);
|
|
8
|
-
}
|
|
9
|
-
return ins;
|
|
10
|
-
}
|
|
11
|
-
__name(mapLoad, "mapLoad");
|
|
12
|
-
|
|
13
|
-
// src/mapReverse.ts
|
|
14
|
-
function mapReverse(ins) {
|
|
15
|
-
const entries = Array.from(ins).reverse();
|
|
16
|
-
ins.clear();
|
|
17
|
-
mapLoad(ins, entries);
|
|
18
|
-
return ins;
|
|
19
|
-
}
|
|
20
|
-
__name(mapReverse, "mapReverse");
|
|
21
|
-
|
|
22
|
-
export { mapReverse };
|
package/lib/mapUpdate.cjs
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
5
|
-
|
|
6
|
-
// src/mapUpdate.ts
|
|
7
|
-
function mapUpdate(ins, key, update) {
|
|
8
|
-
const newValue = update(ins.get(key), key, ins);
|
|
9
|
-
ins.set(key, newValue);
|
|
10
|
-
return ins;
|
|
11
|
-
}
|
|
12
|
-
__name(mapUpdate, "mapUpdate");
|
|
13
|
-
|
|
14
|
-
exports.mapUpdate = mapUpdate;
|
package/lib/mapUpdate.d.cts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { G as GenericMap } from './GenericMap-B4OM3vGu.cjs';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Updates a value in the map using an update function.
|
|
5
|
-
*
|
|
6
|
-
* @param key - The key to update
|
|
7
|
-
* @param update - Function that receives the current value and returns the new value
|
|
8
|
-
* @returns The map instance for method chaining
|
|
9
|
-
*/
|
|
10
|
-
declare function mapUpdate<T extends GenericMap<K, V, 'set' | 'get'>, K, V>(ins: T, key: K, update: (value: V | undefined, key: K, map: T) => V): T;
|
|
11
|
-
declare function mapUpdate<K, V>(ins: Map<K, V>, key: K, update: (value: V | undefined, key: K, map: Map<K, V>) => V): typeof ins;
|
|
12
|
-
|
|
13
|
-
export { mapUpdate };
|
package/lib/mapUpdate.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { G as GenericMap } from './GenericMap-B4OM3vGu.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Updates a value in the map using an update function.
|
|
5
|
-
*
|
|
6
|
-
* @param key - The key to update
|
|
7
|
-
* @param update - Function that receives the current value and returns the new value
|
|
8
|
-
* @returns The map instance for method chaining
|
|
9
|
-
*/
|
|
10
|
-
declare function mapUpdate<T extends GenericMap<K, V, 'set' | 'get'>, K, V>(ins: T, key: K, update: (value: V | undefined, key: K, map: T) => V): T;
|
|
11
|
-
declare function mapUpdate<K, V>(ins: Map<K, V>, key: K, update: (value: V | undefined, key: K, map: Map<K, V>) => V): typeof ins;
|
|
12
|
-
|
|
13
|
-
export { mapUpdate };
|
package/lib/mapUpdate.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
|
|
4
|
-
// src/mapUpdate.ts
|
|
5
|
-
function mapUpdate(ins, key, update) {
|
|
6
|
-
const newValue = update(ins.get(key), key, ins);
|
|
7
|
-
ins.set(key, newValue);
|
|
8
|
-
return ins;
|
|
9
|
-
}
|
|
10
|
-
__name(mapUpdate, "mapUpdate");
|
|
11
|
-
|
|
12
|
-
export { mapUpdate };
|
package/lib/sort.cjs
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
5
|
-
|
|
6
|
-
// src/sort.ts
|
|
7
|
-
function sort(ins, compare) {
|
|
8
|
-
const entries = Array.from(ins).sort(compare);
|
|
9
|
-
ins.clear();
|
|
10
|
-
for (const [k, v] of entries) {
|
|
11
|
-
ins.set(k, v);
|
|
12
|
-
}
|
|
13
|
-
return ins;
|
|
14
|
-
}
|
|
15
|
-
__name(sort, "sort");
|
|
16
|
-
|
|
17
|
-
exports.sort = sort;
|
package/lib/sort.d.cts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { G as GenericMap } from './GenericMap-B4OM3vGu.cjs';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Sorts the map entries using a custom comparison function and updates the map in place.
|
|
5
|
-
* This is Map-specific because it maintains insertion order.
|
|
6
|
-
*
|
|
7
|
-
* @param ins - The map instance to sort
|
|
8
|
-
* @param compare - Function that compares two entries
|
|
9
|
-
* @returns The map instance for method chaining
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```typescript
|
|
13
|
-
* const map = new ExtMap<string, number>([
|
|
14
|
-
* ['c', 3],
|
|
15
|
-
* ['a', 1],
|
|
16
|
-
* ['b', 2],
|
|
17
|
-
* ])
|
|
18
|
-
*
|
|
19
|
-
* sort(map, ([k1], [k2]) => k1.localeCompare(k2))
|
|
20
|
-
* console.log(entriesArray(map)) // [['a', 1], ['b', 2], ['c', 3]]
|
|
21
|
-
* ```
|
|
22
|
-
*/
|
|
23
|
-
declare function sort<K, V>(ins: GenericMap<K, V, 'set' | 'clear' | typeof Symbol.iterator>, compare: (a: [K, V], b: [K, V]) => number): GenericMap<K, V, 'set' | 'clear' | typeof Symbol.iterator>;
|
|
24
|
-
|
|
25
|
-
export { sort };
|
package/lib/sort.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { G as GenericMap } from './GenericMap-B4OM3vGu.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Sorts the map entries using a custom comparison function and updates the map in place.
|
|
5
|
-
* This is Map-specific because it maintains insertion order.
|
|
6
|
-
*
|
|
7
|
-
* @param ins - The map instance to sort
|
|
8
|
-
* @param compare - Function that compares two entries
|
|
9
|
-
* @returns The map instance for method chaining
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```typescript
|
|
13
|
-
* const map = new ExtMap<string, number>([
|
|
14
|
-
* ['c', 3],
|
|
15
|
-
* ['a', 1],
|
|
16
|
-
* ['b', 2],
|
|
17
|
-
* ])
|
|
18
|
-
*
|
|
19
|
-
* sort(map, ([k1], [k2]) => k1.localeCompare(k2))
|
|
20
|
-
* console.log(entriesArray(map)) // [['a', 1], ['b', 2], ['c', 3]]
|
|
21
|
-
* ```
|
|
22
|
-
*/
|
|
23
|
-
declare function sort<K, V>(ins: GenericMap<K, V, 'set' | 'clear' | typeof Symbol.iterator>, compare: (a: [K, V], b: [K, V]) => number): GenericMap<K, V, 'set' | 'clear' | typeof Symbol.iterator>;
|
|
24
|
-
|
|
25
|
-
export { sort };
|
package/lib/sort.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
|
|
4
|
-
// src/sort.ts
|
|
5
|
-
function sort(ins, compare) {
|
|
6
|
-
const entries = Array.from(ins).sort(compare);
|
|
7
|
-
ins.clear();
|
|
8
|
-
for (const [k, v] of entries) {
|
|
9
|
-
ins.set(k, v);
|
|
10
|
-
}
|
|
11
|
-
return ins;
|
|
12
|
-
}
|
|
13
|
-
__name(sort, "sort");
|
|
14
|
-
|
|
15
|
-
export { sort };
|
package/lib/sortByKeys.cjs
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
5
|
-
|
|
6
|
-
// src/sortByKeys.ts
|
|
7
|
-
function sortByKeys(ins, compare) {
|
|
8
|
-
const entries = Array.from(ins).sort((a, b) => {
|
|
9
|
-
return compare(a[0], b[0]);
|
|
10
|
-
});
|
|
11
|
-
ins.clear();
|
|
12
|
-
for (const [k, v] of entries) {
|
|
13
|
-
ins.set(k, v);
|
|
14
|
-
}
|
|
15
|
-
return ins;
|
|
16
|
-
}
|
|
17
|
-
__name(sortByKeys, "sortByKeys");
|
|
18
|
-
|
|
19
|
-
exports.sortByKeys = sortByKeys;
|
package/lib/sortByKeys.d.cts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { G as GenericMap } from './GenericMap-B4OM3vGu.cjs';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Sorts the map entries by their keys and updates the map in place.
|
|
5
|
-
*
|
|
6
|
-
* @param ins - The map instance to sort
|
|
7
|
-
* @param compare - Function that compares two keys
|
|
8
|
-
* @returns The map instance for method chaining
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* ```typescript
|
|
12
|
-
* const map = new ExtMap<string, number>([
|
|
13
|
-
* ['c', 3],
|
|
14
|
-
* ['a', 1],
|
|
15
|
-
* ['b', 2],
|
|
16
|
-
* ])
|
|
17
|
-
*
|
|
18
|
-
* sortByKeys(map, (a, b) => a.localeCompare(b))
|
|
19
|
-
* console.log(entriesArray(map)) // [['a', 1], ['b', 2], ['c', 3]]
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
declare function sortByKeys<K, V>(ins: GenericMap<K, V, 'set' | 'clear' | typeof Symbol.iterator>, compare: (a: K, b: K) => number): GenericMap<K, V, 'set' | 'clear' | typeof Symbol.iterator>;
|
|
23
|
-
|
|
24
|
-
export { sortByKeys };
|
package/lib/sortByKeys.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { G as GenericMap } from './GenericMap-B4OM3vGu.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Sorts the map entries by their keys and updates the map in place.
|
|
5
|
-
*
|
|
6
|
-
* @param ins - The map instance to sort
|
|
7
|
-
* @param compare - Function that compares two keys
|
|
8
|
-
* @returns The map instance for method chaining
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* ```typescript
|
|
12
|
-
* const map = new ExtMap<string, number>([
|
|
13
|
-
* ['c', 3],
|
|
14
|
-
* ['a', 1],
|
|
15
|
-
* ['b', 2],
|
|
16
|
-
* ])
|
|
17
|
-
*
|
|
18
|
-
* sortByKeys(map, (a, b) => a.localeCompare(b))
|
|
19
|
-
* console.log(entriesArray(map)) // [['a', 1], ['b', 2], ['c', 3]]
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
declare function sortByKeys<K, V>(ins: GenericMap<K, V, 'set' | 'clear' | typeof Symbol.iterator>, compare: (a: K, b: K) => number): GenericMap<K, V, 'set' | 'clear' | typeof Symbol.iterator>;
|
|
23
|
-
|
|
24
|
-
export { sortByKeys };
|
package/lib/sortByKeys.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
|
|
4
|
-
// src/sortByKeys.ts
|
|
5
|
-
function sortByKeys(ins, compare) {
|
|
6
|
-
const entries = Array.from(ins).sort((a, b) => {
|
|
7
|
-
return compare(a[0], b[0]);
|
|
8
|
-
});
|
|
9
|
-
ins.clear();
|
|
10
|
-
for (const [k, v] of entries) {
|
|
11
|
-
ins.set(k, v);
|
|
12
|
-
}
|
|
13
|
-
return ins;
|
|
14
|
-
}
|
|
15
|
-
__name(sortByKeys, "sortByKeys");
|
|
16
|
-
|
|
17
|
-
export { sortByKeys };
|
package/lib/sortByValues.cjs
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
5
|
-
|
|
6
|
-
// src/sortByValues.ts
|
|
7
|
-
function sortByValues(ins, compare) {
|
|
8
|
-
const entries = Array.from(ins).sort((a, b) => {
|
|
9
|
-
return compare(a[1], b[1]);
|
|
10
|
-
});
|
|
11
|
-
ins.clear();
|
|
12
|
-
for (const [k, v] of entries) {
|
|
13
|
-
ins.set(k, v);
|
|
14
|
-
}
|
|
15
|
-
return ins;
|
|
16
|
-
}
|
|
17
|
-
__name(sortByValues, "sortByValues");
|
|
18
|
-
|
|
19
|
-
exports.sortByValues = sortByValues;
|
package/lib/sortByValues.d.cts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { G as GenericMap } from './GenericMap-B4OM3vGu.cjs';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Sorts the map entries by their values and updates the map in place.
|
|
5
|
-
*
|
|
6
|
-
* @param ins - The map instance to sort
|
|
7
|
-
* @param compare - Function that compares two values
|
|
8
|
-
* @returns The map instance for method chaining
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* ```typescript
|
|
12
|
-
* const map = new ExtMap<string, number>([
|
|
13
|
-
* ['c', 3],
|
|
14
|
-
* ['a', 1],
|
|
15
|
-
* ['b', 2],
|
|
16
|
-
* ])
|
|
17
|
-
*
|
|
18
|
-
* sortByValues(map, (a, b) => a - b)
|
|
19
|
-
* console.log(entriesArray(map)) // [['a', 1], ['b', 2], ['c', 3]]
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
declare function sortByValues<T extends GenericMap<K, V, 'set' | 'clear' | typeof Symbol.iterator>, K, V>(ins: T, compare: (a: V, b: V) => number): T;
|
|
23
|
-
declare function sortByValues<K, V>(ins: GenericMap<K, V, 'set' | 'clear' | typeof Symbol.iterator>, compare: (a: V, b: V) => number): GenericMap<K, V, 'set' | 'clear' | typeof Symbol.iterator>;
|
|
24
|
-
|
|
25
|
-
export { sortByValues };
|
package/lib/sortByValues.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { G as GenericMap } from './GenericMap-B4OM3vGu.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Sorts the map entries by their values and updates the map in place.
|
|
5
|
-
*
|
|
6
|
-
* @param ins - The map instance to sort
|
|
7
|
-
* @param compare - Function that compares two values
|
|
8
|
-
* @returns The map instance for method chaining
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* ```typescript
|
|
12
|
-
* const map = new ExtMap<string, number>([
|
|
13
|
-
* ['c', 3],
|
|
14
|
-
* ['a', 1],
|
|
15
|
-
* ['b', 2],
|
|
16
|
-
* ])
|
|
17
|
-
*
|
|
18
|
-
* sortByValues(map, (a, b) => a - b)
|
|
19
|
-
* console.log(entriesArray(map)) // [['a', 1], ['b', 2], ['c', 3]]
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
declare function sortByValues<T extends GenericMap<K, V, 'set' | 'clear' | typeof Symbol.iterator>, K, V>(ins: T, compare: (a: V, b: V) => number): T;
|
|
23
|
-
declare function sortByValues<K, V>(ins: GenericMap<K, V, 'set' | 'clear' | typeof Symbol.iterator>, compare: (a: V, b: V) => number): GenericMap<K, V, 'set' | 'clear' | typeof Symbol.iterator>;
|
|
24
|
-
|
|
25
|
-
export { sortByValues };
|
package/lib/sortByValues.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
|
|
4
|
-
// src/sortByValues.ts
|
|
5
|
-
function sortByValues(ins, compare) {
|
|
6
|
-
const entries = Array.from(ins).sort((a, b) => {
|
|
7
|
-
return compare(a[1], b[1]);
|
|
8
|
-
});
|
|
9
|
-
ins.clear();
|
|
10
|
-
for (const [k, v] of entries) {
|
|
11
|
-
ins.set(k, v);
|
|
12
|
-
}
|
|
13
|
-
return ins;
|
|
14
|
-
}
|
|
15
|
-
__name(sortByValues, "sortByValues");
|
|
16
|
-
|
|
17
|
-
export { sortByValues };
|
package/lib/toMap.cjs
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
5
|
-
|
|
6
|
-
// src/toMap.ts
|
|
7
|
-
function toMap(ins) {
|
|
8
|
-
return new Map(ins);
|
|
9
|
-
}
|
|
10
|
-
__name(toMap, "toMap");
|
|
11
|
-
|
|
12
|
-
exports.toMap = toMap;
|
package/lib/toMap.d.cts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { G as GenericMap } from './GenericMap-B4OM3vGu.cjs';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Converts a GenericMap to a native Map.
|
|
5
|
-
*
|
|
6
|
-
* @param ins - The GenericMap instance to convert
|
|
7
|
-
* @returns A new native Map with the same entries
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* ```typescript
|
|
11
|
-
* const extMap = new ExtMap<string, number>()
|
|
12
|
-
* .load([['a', 1], ['b', 2], ['c', 3]])
|
|
13
|
-
*
|
|
14
|
-
* const nativeMap = toMap(extMap)
|
|
15
|
-
* console.log(nativeMap instanceof Map) // true
|
|
16
|
-
* ```
|
|
17
|
-
*/
|
|
18
|
-
declare function toMap<K, V>(ins: GenericMap<K, V, typeof Symbol.iterator>): Map<K, V>;
|
|
19
|
-
|
|
20
|
-
export { toMap };
|
package/lib/toMap.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { G as GenericMap } from './GenericMap-B4OM3vGu.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Converts a GenericMap to a native Map.
|
|
5
|
-
*
|
|
6
|
-
* @param ins - The GenericMap instance to convert
|
|
7
|
-
* @returns A new native Map with the same entries
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* ```typescript
|
|
11
|
-
* const extMap = new ExtMap<string, number>()
|
|
12
|
-
* .load([['a', 1], ['b', 2], ['c', 3]])
|
|
13
|
-
*
|
|
14
|
-
* const nativeMap = toMap(extMap)
|
|
15
|
-
* console.log(nativeMap instanceof Map) // true
|
|
16
|
-
* ```
|
|
17
|
-
*/
|
|
18
|
-
declare function toMap<K, V>(ins: GenericMap<K, V, typeof Symbol.iterator>): Map<K, V>;
|
|
19
|
-
|
|
20
|
-
export { toMap };
|
package/lib/toMap.js
DELETED
package/lib/valuesArray.cjs
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
5
|
-
|
|
6
|
-
// src/valuesArray.ts
|
|
7
|
-
function valuesArray(ins) {
|
|
8
|
-
return Array.from(ins.values());
|
|
9
|
-
}
|
|
10
|
-
__name(valuesArray, "valuesArray");
|
|
11
|
-
|
|
12
|
-
exports.valuesArray = valuesArray;
|
package/lib/valuesArray.d.cts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { G as GenericMap } from './GenericMap-B4OM3vGu.cjs';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Returns an array of all values in the map.
|
|
5
|
-
* Convenience method that converts the values iterator to an array.
|
|
6
|
-
*
|
|
7
|
-
* @returns Array of all values
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* ```typescript
|
|
11
|
-
* const map = new ExtMap<string, number>()
|
|
12
|
-
* .load([['a', 1], ['b', 2], ['c', 3]])
|
|
13
|
-
*
|
|
14
|
-
* console.log(valuesArray(map)) // [1, 2, 3]
|
|
15
|
-
* ```
|
|
16
|
-
*/
|
|
17
|
-
declare function valuesArray<K, V>(ins: GenericMap<K, V, 'values'>): V[];
|
|
18
|
-
|
|
19
|
-
export { valuesArray };
|
package/lib/valuesArray.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { G as GenericMap } from './GenericMap-B4OM3vGu.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Returns an array of all values in the map.
|
|
5
|
-
* Convenience method that converts the values iterator to an array.
|
|
6
|
-
*
|
|
7
|
-
* @returns Array of all values
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* ```typescript
|
|
11
|
-
* const map = new ExtMap<string, number>()
|
|
12
|
-
* .load([['a', 1], ['b', 2], ['c', 3]])
|
|
13
|
-
*
|
|
14
|
-
* console.log(valuesArray(map)) // [1, 2, 3]
|
|
15
|
-
* ```
|
|
16
|
-
*/
|
|
17
|
-
declare function valuesArray<K, V>(ins: GenericMap<K, V, 'values'>): V[];
|
|
18
|
-
|
|
19
|
-
export { valuesArray };
|
package/lib/valuesArray.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
|
|
4
|
-
// src/valuesArray.ts
|
|
5
|
-
function valuesArray(ins) {
|
|
6
|
-
return Array.from(ins.values());
|
|
7
|
-
}
|
|
8
|
-
__name(valuesArray, "valuesArray");
|
|
9
|
-
|
|
10
|
-
export { valuesArray };
|