@valkyriestudios/utils 12.33.0 → 12.34.0

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 CHANGED
@@ -31,7 +31,11 @@ isNotEmptyArray([0, 1, 2]); // TRUE
31
31
  ```
32
32
 
33
33
  ### array/mapKey(val:Record[], key:string, opts?:{merge?:boolean;filter_fn?:(el:T) => boolean})
34
- Map a non-primitive object array into an object map by key
34
+ Map a non-primitive object array into an object map by key.
35
+
36
+ **Take Note**: The function `array/mapKeyAsMap` has the same behavior as the mapKey function with the sole difference being that it returns a
37
+ **Map** instead of an object.
38
+
35
39
  ```typescript
36
40
  import mapKey from '@valkyriestudios/utils/array/mapKey';
37
41
  mapKey([
@@ -114,6 +118,9 @@ mapKey([
114
118
  }
115
119
  ```
116
120
 
121
+ ### array/mapKeyAsMap(val:Record[], key:string, opts?:{merge?:boolean;filter_fn?:(el:T) => boolean})
122
+ Same behavior as mapKey but returns a Map instead of an object
123
+
117
124
  ### array/mapFn(val:Record[], key:Function, opts:object={})
118
125
  Same behavior as mapKey but instead of a key, a function is passed to generate your own key. Eg:
119
126
 
@@ -134,6 +141,9 @@ mapFn([
134
141
 
135
142
  options are the same as the mapKey function
136
143
 
144
+ ### array/mapFnAsMap(val:Record[], key:Function, opts:object={})
145
+ Same behavior as mapFn but returns a Map instead of an object
146
+
137
147
  ### array/mapPrimitive(val:any[], opts?:{valtrim:false;keyround:false;valround:false;filter_fn:(el)=>boolean})
138
148
  Map an array of primitives (number/string)
139
149
  ```typescript
package/array/index.d.ts CHANGED
@@ -3,10 +3,12 @@ import { isArray } from './is';
3
3
  import { isNotEmptyArray } from './isNotEmpty';
4
4
  import { join } from './join';
5
5
  import { mapFn } from './mapFn';
6
+ import { mapFnAsMap } from './mapFnAsMap';
6
7
  import { mapKey } from './mapKey';
8
+ import { mapKeyAsMap } from './mapKeyAsMap';
7
9
  import { mapPrimitive } from './mapPrimitive';
8
10
  import { groupBy } from './groupBy';
9
11
  import { shuffle } from './shuffle';
10
12
  import { split } from './split';
11
13
  import { sort } from './sort';
12
- export { dedupe, isArray, isArray as is, isNotEmptyArray, isNotEmptyArray as isNotEmpty, isNotEmptyArray as isNeArray, isNotEmptyArray as isNe, join, mapFn, mapKey, mapPrimitive, groupBy, shuffle, split, sort };
14
+ export { dedupe, isArray, isArray as is, isNotEmptyArray, isNotEmptyArray as isNotEmpty, isNotEmptyArray as isNeArray, isNotEmptyArray as isNe, join, mapFn, mapFnAsMap, mapKey, mapKeyAsMap, mapPrimitive, groupBy, shuffle, split, sort };
package/array/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.sort = exports.split = exports.shuffle = exports.groupBy = exports.mapPrimitive = exports.mapKey = exports.mapFn = exports.join = exports.isNe = exports.isNeArray = exports.isNotEmpty = exports.isNotEmptyArray = exports.is = exports.isArray = exports.dedupe = void 0;
3
+ exports.sort = exports.split = exports.shuffle = exports.groupBy = exports.mapPrimitive = exports.mapKeyAsMap = exports.mapKey = exports.mapFnAsMap = exports.mapFn = exports.join = exports.isNe = exports.isNeArray = exports.isNotEmpty = exports.isNotEmptyArray = exports.is = exports.isArray = exports.dedupe = void 0;
4
4
  const dedupe_1 = require("./dedupe");
5
5
  Object.defineProperty(exports, "dedupe", { enumerable: true, get: function () { return dedupe_1.dedupe; } });
6
6
  const is_1 = require("./is");
@@ -15,8 +15,12 @@ const join_1 = require("./join");
15
15
  Object.defineProperty(exports, "join", { enumerable: true, get: function () { return join_1.join; } });
16
16
  const mapFn_1 = require("./mapFn");
17
17
  Object.defineProperty(exports, "mapFn", { enumerable: true, get: function () { return mapFn_1.mapFn; } });
18
+ const mapFnAsMap_1 = require("./mapFnAsMap");
19
+ Object.defineProperty(exports, "mapFnAsMap", { enumerable: true, get: function () { return mapFnAsMap_1.mapFnAsMap; } });
18
20
  const mapKey_1 = require("./mapKey");
19
21
  Object.defineProperty(exports, "mapKey", { enumerable: true, get: function () { return mapKey_1.mapKey; } });
22
+ const mapKeyAsMap_1 = require("./mapKeyAsMap");
23
+ Object.defineProperty(exports, "mapKeyAsMap", { enumerable: true, get: function () { return mapKeyAsMap_1.mapKeyAsMap; } });
20
24
  const mapPrimitive_1 = require("./mapPrimitive");
21
25
  Object.defineProperty(exports, "mapPrimitive", { enumerable: true, get: function () { return mapPrimitive_1.mapPrimitive; } });
22
26
  const groupBy_1 = require("./groupBy");
package/array/mapFn.d.ts CHANGED
@@ -25,8 +25,6 @@ type MapFn<T extends Record<string, any>> = (entry: T) => (string | number | boo
25
25
  * @param {Record<string, any>[]} val - Array to map
26
26
  * @param {MapFn} fn - Handler function which is run for each of the objects and should return a string or number
27
27
  * @param {MapOptions?} opts - Options object to override built-in defaults
28
- *
29
- * @returns {Record<string, T>} KV-Map object
30
28
  */
31
29
  declare function mapFn<T extends Record<string, any>>(arr: T[], fn: MapFn<T>, opts?: MapOptions): Record<string, T>;
32
30
  export { mapFn, mapFn as default };
package/array/mapFn.js CHANGED
@@ -9,16 +9,16 @@ function mapFn(arr, fn, opts) {
9
9
  return {};
10
10
  const MERGE = opts?.merge === true;
11
11
  const map = {};
12
- let hash = false;
13
12
  for (let i = 0; i < arr.length; i++) {
14
13
  const el = arr[i];
15
14
  if (Object.prototype.toString.call(el) !== '[object Object]')
16
15
  continue;
17
- hash = fn(el);
18
- if (!Number.isFinite(hash) && !(typeof hash === 'string' && hash.trim().length))
19
- continue;
20
- hash = hash + '';
21
- map[hash] = (MERGE && hash in map ? (0, merge_1.merge)(map[hash], el, { union: true }) : el);
16
+ let hash = fn(el);
17
+ if (Number.isFinite(hash) ||
18
+ (typeof hash === 'string' && hash.length)) {
19
+ hash = hash + '';
20
+ map[hash] = MERGE && hash in map ? (0, merge_1.merge)(map[hash], el, { union: true }) : el;
21
+ }
22
22
  }
23
23
  return map;
24
24
  }
@@ -0,0 +1,33 @@
1
+ type MapOptions = {
2
+ /**
3
+ * Allow merging existing keys or not, if not keys will be overriden if they exist
4
+ * (default=false)
5
+ *
6
+ * Example:
7
+ * mapFnAsMap([{uid: 12, a: 'hi'}, {uid: 12, b: 'ho'}], el => el.uid, {merge: true})
8
+ * Output:
9
+ * {12: {uid: 12, a: 'hi', b: 'ho'}}
10
+ * Output if merge is false
11
+ * {12: {uid: 12, b: 'ho'}}
12
+ */
13
+ merge?: boolean;
14
+ };
15
+ type MapFn<T extends Record<string, any>> = (entry: T) => string | number | null;
16
+ /**
17
+ * Map an object array into a Map through a function that generates a key. Returning a non-string,
18
+ * non-numeric value from the function (eg: null) will filter out the object.
19
+ *
20
+ * Example:
21
+ * mapFnAsMap([{uid: 12, name: 'Peter'}, {uid: 15, name: 'Jonas'}], el => el.uid);
22
+ * Output:
23
+ * new Map([
24
+ * [12, {uid: 12, name: 'Peter'}],
25
+ * [15, {uid: 15, name: 'Jonas'}],
26
+ * ])
27
+ *
28
+ * @param {Record<string, any>[]} val - Array to map
29
+ * @param {MapFn} fn - Handler function which is run for each of the objects and should return a string or number
30
+ * @param {MapOptions?} opts - Options object to override built-in defaults
31
+ */
32
+ declare function mapFnAsMap<T extends Record<string, any>, TFN extends MapFn<T>>(arr: T[], fn: TFN, opts?: MapOptions): Map<NonNullable<ReturnType<TFN>>, T>;
33
+ export { mapFnAsMap, mapFnAsMap as default };
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.mapFnAsMap = mapFnAsMap;
4
+ exports.default = mapFnAsMap;
5
+ const merge_1 = require("../object/merge");
6
+ function mapFnAsMap(arr, fn, opts) {
7
+ if ((!Array.isArray(arr) || !arr.length) ||
8
+ typeof fn !== 'function')
9
+ return new Map();
10
+ const MERGE = opts?.merge === true;
11
+ const map = new Map();
12
+ for (let i = 0; i < arr.length; i++) {
13
+ const el = arr[i];
14
+ if (Object.prototype.toString.call(el) !== '[object Object]')
15
+ continue;
16
+ const hash = fn(el);
17
+ if (Number.isFinite(hash) ||
18
+ (typeof hash === 'string' && hash.trim().length))
19
+ map.set(hash, MERGE && map.has(hash) ? (0, merge_1.merge)(map.get(hash), el, { union: true }) : el);
20
+ }
21
+ return map;
22
+ }
package/array/mapKey.d.ts CHANGED
@@ -28,8 +28,6 @@ type MapOptions<T> = {
28
28
  * @param {Record<string,any>[]} val - Array to map
29
29
  * @param {string} key - Key to map by
30
30
  * @param {MapOptions?} opts - Options object to override built-in defaults
31
- *
32
- * @returns {Record<string, T>} KV-Map object
33
31
  */
34
- declare function mapKey<T extends Record<string, any>>(arr: T[], key: string, opts?: MapOptions<T>): Record<string, T>;
32
+ declare function mapKey<T extends Record<string, any>, TKey extends keyof T>(arr: T[], key: TKey, opts?: MapOptions<T>): Record<string, T>;
35
33
  export { mapKey, mapKey as default };
package/array/mapKey.js CHANGED
@@ -4,25 +4,20 @@ exports.mapKey = mapKey;
4
4
  exports.default = mapKey;
5
5
  const merge_1 = require("../object/merge");
6
6
  function mapKey(arr, key, opts) {
7
- if (!Array.isArray(arr) || typeof key !== 'string')
8
- return {};
9
- const len = arr.length;
10
- if (!len)
11
- return {};
12
- const key_s = key.trim();
13
- if (!key_s.length)
7
+ if (!Array.isArray(arr) ||
8
+ !arr.length ||
9
+ typeof key !== 'string' ||
10
+ !key.length)
14
11
  return {};
15
12
  const FILTER_FN = opts?.filter_fn;
16
13
  const MERGE = opts?.merge === true;
17
14
  const map = {};
18
- for (let i = 0; i < len; i++) {
15
+ for (let i = 0; i < arr.length; i++) {
19
16
  const el = arr[i];
20
- const el_key = el?.[key_s];
21
- if (el_key === undefined)
22
- continue;
23
- if (FILTER_FN && !FILTER_FN(el))
24
- continue;
25
- map[el_key] = (MERGE && el_key in map ? (0, merge_1.merge)(map[el_key], el, { union: true }) : el);
17
+ const el_key = el?.[key];
18
+ if (el_key !== undefined &&
19
+ (!FILTER_FN || FILTER_FN(el)))
20
+ map[el_key] = (MERGE && el_key in map ? (0, merge_1.merge)(map[el_key], el, { union: true }) : el);
26
21
  }
27
22
  return map;
28
23
  }
@@ -0,0 +1,36 @@
1
+ type MapOptions<T> = {
2
+ /**
3
+ * Allow merging existing keys or not, if not keys will be overriden if they exist
4
+ * (default=false)
5
+ *
6
+ * Example:
7
+ * mapKey([{uid: 12, a: 'hi'}, {uid: 12, b: 'ho'}], 'uid', {merge: true})
8
+ * Output:
9
+ * {12: {uid: 12, a: 'hi', b: 'ho'}}
10
+ * Output if merge is false
11
+ * {12: {uid: 12, b: 'ho'}}
12
+ */
13
+ merge?: boolean;
14
+ /**
15
+ * Pass a custom filter function which will be run in O(n) while iterating
16
+ */
17
+ filter_fn?: (el: T) => boolean;
18
+ };
19
+ /**
20
+ * Map an object array into a Map by passing a common key that exists on the objects. Objects for
21
+ * which the key doesn't exist will be filtered out automatically
22
+ *
23
+ * Example:
24
+ * mapKey([{uid: 12, name: 'Peter'}, {uid: 15, name: 'Jonas'}], 'uid');
25
+ * Output:
26
+ * new Map([
27
+ * [12, {uid: 12, name: 'Peter'}],
28
+ * [15, {uid: 15, name: 'Jonas'}],
29
+ * ])
30
+ *
31
+ * @param {Record<string,any>[]} val - Array to map
32
+ * @param {string} key - Key to map by
33
+ * @param {MapOptions?} opts - Options object to override built-in defaults
34
+ */
35
+ declare function mapKeyAsMap<T extends Record<string, any>, TKey extends keyof T>(arr: T[], key: TKey, opts?: MapOptions<T>): Map<T[TKey], T>;
36
+ export { mapKeyAsMap, mapKeyAsMap as default };
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.mapKeyAsMap = mapKeyAsMap;
4
+ exports.default = mapKeyAsMap;
5
+ const merge_1 = require("../object/merge");
6
+ function mapKeyAsMap(arr, key, opts) {
7
+ if (!Array.isArray(arr) ||
8
+ !arr.length ||
9
+ typeof key !== 'string' ||
10
+ !key.length)
11
+ return new Map();
12
+ const FILTER_FN = opts?.filter_fn;
13
+ const MERGE = opts?.merge === true;
14
+ const map = new Map();
15
+ for (let i = 0; i < arr.length; i++) {
16
+ const el = arr[i];
17
+ const el_key = el?.[key];
18
+ if (el_key !== undefined &&
19
+ (!FILTER_FN || FILTER_FN(el)))
20
+ map.set(el_key, MERGE && map.has(el_key) ? (0, merge_1.merge)(map.get(el_key), el, { union: true }) : el);
21
+ }
22
+ return map;
23
+ }
package/index.d.ts CHANGED
@@ -45,18 +45,10 @@ declare module "object/merge" {
45
45
  [K in keyof T]: K extends keyof U ? U[K] : T[K];
46
46
  };
47
47
  type MergeArray<T, U extends Record<string, unknown>[], Union extends boolean> = U extends [infer Head, ...infer Tail] ? Head extends Record<string, unknown> ? Tail extends Record<string, unknown>[] ? MergeArray<Union extends true ? Merge<T, Head> : MergeNonUnion<T, Head>, Tail, Union> : Union extends true ? Merge<T, Head> : MergeNonUnion<T, Head> : T : T;
48
- function merge<T extends Record<string, unknown>, U extends Record<string, unknown>>(target: T, source: U, opts: {
49
- union: true;
50
- }): Merge<T, U>;
51
- function merge<T extends Record<string, unknown>, U extends Record<string, unknown>>(target: T, source: U, opts?: {
52
- union?: false;
53
- }): MergeNonUnion<T, U>;
54
- function merge<T extends Record<string, unknown>, U extends Record<string, unknown>[]>(target: T, sources: [...U], opts: {
55
- union: true;
56
- }): MergeArray<T, U, true>;
57
- function merge<T extends Record<string, unknown>, U extends Record<string, unknown>[]>(target: T, sources: [...U], opts?: {
58
- union?: false;
59
- }): MergeArray<T, U, false>;
48
+ type Merged<T extends Record<string, unknown>, U extends Record<string, unknown> | Record<string, unknown>[], Union extends boolean> = U extends any[] ? MergeArray<T, U, Union> : Union extends true ? Merge<T, U> : MergeNonUnion<T, U>;
49
+ function merge<T extends Record<string, unknown>, U extends Record<string, unknown> | [Record<string, unknown>, ...Record<string, unknown>[]], Union extends boolean = false>(target: T, source: U, opts?: {
50
+ union?: Union;
51
+ }): Merged<T, U, Union>;
60
52
  export { merge, merge as default };
61
53
  }
62
54
  declare module "array/mapFn" {
@@ -67,14 +59,30 @@ declare module "array/mapFn" {
67
59
  function mapFn<T extends Record<string, any>>(arr: T[], fn: MapFn<T>, opts?: MapOptions): Record<string, T>;
68
60
  export { mapFn, mapFn as default };
69
61
  }
62
+ declare module "array/mapFnAsMap" {
63
+ type MapOptions = {
64
+ merge?: boolean;
65
+ };
66
+ type MapFn<T extends Record<string, any>> = (entry: T) => string | number | null;
67
+ function mapFnAsMap<T extends Record<string, any>, TFN extends MapFn<T>>(arr: T[], fn: TFN, opts?: MapOptions): Map<NonNullable<ReturnType<TFN>>, T>;
68
+ export { mapFnAsMap, mapFnAsMap as default };
69
+ }
70
70
  declare module "array/mapKey" {
71
71
  type MapOptions<T> = {
72
72
  merge?: boolean;
73
73
  filter_fn?: (el: T) => boolean;
74
74
  };
75
- function mapKey<T extends Record<string, any>>(arr: T[], key: string, opts?: MapOptions<T>): Record<string, T>;
75
+ function mapKey<T extends Record<string, any>, TKey extends keyof T>(arr: T[], key: TKey, opts?: MapOptions<T>): Record<string, T>;
76
76
  export { mapKey, mapKey as default };
77
77
  }
78
+ declare module "array/mapKeyAsMap" {
79
+ type MapOptions<T> = {
80
+ merge?: boolean;
81
+ filter_fn?: (el: T) => boolean;
82
+ };
83
+ function mapKeyAsMap<T extends Record<string, any>, TKey extends keyof T>(arr: T[], key: TKey, opts?: MapOptions<T>): Map<T[TKey], T>;
84
+ export { mapKeyAsMap, mapKeyAsMap as default };
85
+ }
78
86
  declare module "array/mapPrimitive" {
79
87
  type MapOptions = {
80
88
  valtrim?: boolean;
@@ -128,13 +136,15 @@ declare module "array/index" {
128
136
  import { isNotEmptyArray } from "array/isNotEmpty";
129
137
  import { join } from "array/join";
130
138
  import { mapFn } from "array/mapFn";
139
+ import { mapFnAsMap } from "array/mapFnAsMap";
131
140
  import { mapKey } from "array/mapKey";
141
+ import { mapKeyAsMap } from "array/mapKeyAsMap";
132
142
  import { mapPrimitive } from "array/mapPrimitive";
133
143
  import { groupBy } from "array/groupBy";
134
144
  import { shuffle } from "array/shuffle";
135
145
  import { split } from "array/split";
136
146
  import { sort } from "array/sort";
137
- export { dedupe, isArray, isArray as is, isNotEmptyArray, isNotEmptyArray as isNotEmpty, isNotEmptyArray as isNeArray, isNotEmptyArray as isNe, join, mapFn, mapKey, mapPrimitive, groupBy, shuffle, split, sort };
147
+ export { dedupe, isArray, isArray as is, isNotEmptyArray, isNotEmptyArray as isNotEmpty, isNotEmptyArray as isNeArray, isNotEmptyArray as isNe, join, mapFn, mapFnAsMap, mapKey, mapKeyAsMap, mapPrimitive, groupBy, shuffle, split, sort };
138
148
  }
139
149
  declare module "boolean/is" {
140
150
  function isBoolean(val: unknown): val is boolean;
package/object/merge.d.ts CHANGED
@@ -16,16 +16,20 @@ type MergeNonUnion<T, U> = {
16
16
  * or MergeNonUnion (if union is false).
17
17
  */
18
18
  type MergeArray<T, U extends Record<string, unknown>[], Union extends boolean> = U extends [infer Head, ...infer Tail] ? Head extends Record<string, unknown> ? Tail extends Record<string, unknown>[] ? MergeArray<Union extends true ? Merge<T, Head> : MergeNonUnion<T, Head>, Tail, Union> : Union extends true ? Merge<T, Head> : MergeNonUnion<T, Head> : T : T;
19
- declare function merge<T extends Record<string, unknown>, U extends Record<string, unknown>>(target: T, source: U, opts: {
20
- union: true;
21
- }): Merge<T, U>;
22
- declare function merge<T extends Record<string, unknown>, U extends Record<string, unknown>>(target: T, source: U, opts?: {
23
- union?: false;
24
- }): MergeNonUnion<T, U>;
25
- declare function merge<T extends Record<string, unknown>, U extends Record<string, unknown>[]>(target: T, sources: [...U], opts: {
26
- union: true;
27
- }): MergeArray<T, U, true>;
28
- declare function merge<T extends Record<string, unknown>, U extends Record<string, unknown>[]>(target: T, sources: [...U], opts?: {
29
- union?: false;
30
- }): MergeArray<T, U, false>;
19
+ type Merged<T extends Record<string, unknown>, U extends Record<string, unknown> | Record<string, unknown>[], Union extends boolean> = U extends any[] ? MergeArray<T, U, Union> : Union extends true ? Merge<T, U> : MergeNonUnion<T, U>;
20
+ /**
21
+ * Deep merge two objects together while ensuring nested objects also get merged,
22
+ * take note: this does not merge onto passed objects by reference but instead
23
+ * returns a new object
24
+ *
25
+ * @param {Record<string,unknown>} target - Base Object
26
+ * @param {Record<string,unknown>|Record<string,unknown>[]} source - (default={}) Object to merge onto base object
27
+ */
28
+ declare function merge<T extends Record<string, unknown>, U extends Record<string, unknown> | [Record<string, unknown>, ...Record<string, unknown>[]], Union extends boolean = false>(target: T, source: U, opts?: {
29
+ /**
30
+ * Defaults to false, when passed as true it ensures all keys from both objects
31
+ * are available in the merged object
32
+ */
33
+ union?: Union;
34
+ }): Merged<T, U, Union>;
31
35
  export { merge, merge as default };
package/object/merge.js CHANGED
@@ -18,7 +18,7 @@ function innerMerge(target, source, UNION) {
18
18
  }
19
19
  return target;
20
20
  }
21
- function merge(target, source = {}, opts = {}) {
21
+ function merge(target, source, opts = {}) {
22
22
  if (Object.prototype.toString.call(target) !== PROTO_OBJ)
23
23
  throw new Error('object/merge: Please ensure valid target/source is passed');
24
24
  const union = opts?.union === true;
@@ -26,7 +26,7 @@ function merge(target, source = {}, opts = {}) {
26
26
  let acc = { ...target };
27
27
  for (let i = 0; i < sources.length; i++) {
28
28
  const el = sources[i];
29
- if (Object.prototype.toString.call(el) !== PROTO_OBJ)
29
+ if (!el || Object.prototype.toString.call(el) !== PROTO_OBJ)
30
30
  continue;
31
31
  acc = innerMerge(acc, el, union);
32
32
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@valkyriestudios/utils",
3
- "version": "12.33.0",
3
+ "version": "12.34.0",
4
4
  "description": "A collection of single-function utilities for common tasks",
5
5
  "author": {
6
6
  "name": "Peter Vermeulen",
@@ -158,6 +158,18 @@
158
158
  "default": "./array/mapFn.js",
159
159
  "types": "./array/mapFn.d.ts"
160
160
  },
161
+ "./array/mapFnAsMap": {
162
+ "import": {
163
+ "default": "./array/mapFnAsMap.js",
164
+ "types": "./array/mapFnAsMap.d.ts"
165
+ },
166
+ "require": {
167
+ "default": "./array/mapFnAsMap.js",
168
+ "types": "./array/mapFnAsMap.d.ts"
169
+ },
170
+ "default": "./array/mapFnAsMap.js",
171
+ "types": "./array/mapFnAsMap.d.ts"
172
+ },
161
173
  "./array/mapKey": {
162
174
  "import": {
163
175
  "default": "./array/mapKey.js",
@@ -170,6 +182,18 @@
170
182
  "default": "./array/mapKey.js",
171
183
  "types": "./array/mapKey.d.ts"
172
184
  },
185
+ "./array/mapKeyAsMap": {
186
+ "import": {
187
+ "default": "./array/mapKeyAsMap.js",
188
+ "types": "./array/mapKeyAsMap.d.ts"
189
+ },
190
+ "require": {
191
+ "default": "./array/mapKeyAsMap.js",
192
+ "types": "./array/mapKeyAsMap.d.ts"
193
+ },
194
+ "default": "./array/mapKeyAsMap.js",
195
+ "types": "./array/mapKeyAsMap.d.ts"
196
+ },
173
197
  "./array/mapPrimitive": {
174
198
  "import": {
175
199
  "default": "./array/mapPrimitive.js",
@@ -686,6 +710,18 @@
686
710
  "default": "./hash/guid.js",
687
711
  "types": "./hash/guid.d.ts"
688
712
  },
713
+ "./modules/PubSub": {
714
+ "import": {
715
+ "default": "./modules/PubSub.js",
716
+ "types": "./modules/PubSub.d.ts"
717
+ },
718
+ "require": {
719
+ "default": "./modules/PubSub.js",
720
+ "types": "./modules/PubSub.d.ts"
721
+ },
722
+ "default": "./modules/PubSub.js",
723
+ "types": "./modules/PubSub.d.ts"
724
+ },
689
725
  "./number": {
690
726
  "import": {
691
727
  "default": "./number/index.js",
@@ -1108,11 +1144,11 @@
1108
1144
  }
1109
1145
  },
1110
1146
  "devDependencies": {
1111
- "@types/node": "^22.13.5",
1147
+ "@types/node": "^22.13.10",
1112
1148
  "esbuild-register": "^3.6.0",
1113
- "eslint": "^9.21.0",
1149
+ "eslint": "^9.22.0",
1114
1150
  "nyc": "^17.1.0",
1115
- "typescript": "^5.7.3",
1116
- "typescript-eslint": "^8.25.0"
1151
+ "typescript": "^5.8.2",
1152
+ "typescript-eslint": "^8.26.0"
1117
1153
  }
1118
1154
  }