@bemoje/iter 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.
Files changed (138) hide show
  1. package/README.md +41 -15
  2. package/lib/index.cjs +5 -18
  3. package/lib/index.d.cts +524 -33
  4. package/lib/index.d.ts +524 -33
  5. package/lib/index.js +1 -14
  6. package/package.json +20 -472
  7. package/lib/filterArray.cjs +0 -20
  8. package/lib/filterArray.d.cts +0 -18
  9. package/lib/filterArray.d.ts +0 -18
  10. package/lib/filterArray.js +0 -18
  11. package/lib/filterIterable.cjs +0 -14
  12. package/lib/filterIterable.d.cts +0 -18
  13. package/lib/filterIterable.d.ts +0 -18
  14. package/lib/filterIterable.js +0 -12
  15. package/lib/filterIterableEntries.cjs +0 -12
  16. package/lib/filterIterableEntries.d.cts +0 -18
  17. package/lib/filterIterableEntries.d.ts +0 -18
  18. package/lib/filterIterableEntries.js +0 -10
  19. package/lib/filterIterableKeys.cjs +0 -14
  20. package/lib/filterIterableKeys.d.cts +0 -18
  21. package/lib/filterIterableKeys.d.ts +0 -18
  22. package/lib/filterIterableKeys.js +0 -12
  23. package/lib/filterIterableValues.cjs +0 -14
  24. package/lib/filterIterableValues.d.cts +0 -18
  25. package/lib/filterIterableValues.d.ts +0 -18
  26. package/lib/filterIterableValues.js +0 -12
  27. package/lib/filterMap.cjs +0 -18
  28. package/lib/filterMap.d.cts +0 -18
  29. package/lib/filterMap.d.ts +0 -18
  30. package/lib/filterMap.js +0 -16
  31. package/lib/filterObject.cjs +0 -24
  32. package/lib/filterObject.d.cts +0 -18
  33. package/lib/filterObject.d.ts +0 -18
  34. package/lib/filterObject.js +0 -22
  35. package/lib/filterSet.cjs +0 -18
  36. package/lib/filterSet.d.cts +0 -18
  37. package/lib/filterSet.d.ts +0 -18
  38. package/lib/filterSet.js +0 -16
  39. package/lib/forEachArray.cjs +0 -16
  40. package/lib/forEachArray.d.cts +0 -17
  41. package/lib/forEachArray.d.ts +0 -17
  42. package/lib/forEachArray.js +0 -14
  43. package/lib/forEachIterable.cjs +0 -14
  44. package/lib/forEachIterable.d.cts +0 -17
  45. package/lib/forEachIterable.d.ts +0 -17
  46. package/lib/forEachIterable.js +0 -12
  47. package/lib/forEachIterableEntries.cjs +0 -14
  48. package/lib/forEachIterableEntries.d.cts +0 -6
  49. package/lib/forEachIterableEntries.d.ts +0 -6
  50. package/lib/forEachIterableEntries.js +0 -12
  51. package/lib/forEachIterableKeys.cjs +0 -14
  52. package/lib/forEachIterableKeys.d.cts +0 -17
  53. package/lib/forEachIterableKeys.d.ts +0 -17
  54. package/lib/forEachIterableKeys.js +0 -12
  55. package/lib/forEachIterableValues.cjs +0 -14
  56. package/lib/forEachIterableValues.d.cts +0 -17
  57. package/lib/forEachIterableValues.d.ts +0 -17
  58. package/lib/forEachIterableValues.js +0 -12
  59. package/lib/forEachMap.cjs +0 -14
  60. package/lib/forEachMap.d.cts +0 -17
  61. package/lib/forEachMap.d.ts +0 -17
  62. package/lib/forEachMap.js +0 -12
  63. package/lib/forEachObject.cjs +0 -20
  64. package/lib/forEachObject.d.cts +0 -17
  65. package/lib/forEachObject.d.ts +0 -17
  66. package/lib/forEachObject.js +0 -18
  67. package/lib/forEachSet.cjs +0 -14
  68. package/lib/forEachSet.d.cts +0 -17
  69. package/lib/forEachSet.d.ts +0 -17
  70. package/lib/forEachSet.js +0 -12
  71. package/lib/mapArray.cjs +0 -18
  72. package/lib/mapArray.d.cts +0 -17
  73. package/lib/mapArray.d.ts +0 -17
  74. package/lib/mapArray.js +0 -16
  75. package/lib/mapIterable.cjs +0 -14
  76. package/lib/mapIterable.d.cts +0 -17
  77. package/lib/mapIterable.d.ts +0 -17
  78. package/lib/mapIterable.js +0 -12
  79. package/lib/mapIterableEntries.cjs +0 -12
  80. package/lib/mapIterableEntries.d.cts +0 -17
  81. package/lib/mapIterableEntries.d.ts +0 -17
  82. package/lib/mapIterableEntries.js +0 -10
  83. package/lib/mapIterableKeys.cjs +0 -17
  84. package/lib/mapIterableKeys.d.cts +0 -17
  85. package/lib/mapIterableKeys.d.ts +0 -17
  86. package/lib/mapIterableKeys.js +0 -15
  87. package/lib/mapIterableValues.cjs +0 -17
  88. package/lib/mapIterableValues.d.cts +0 -17
  89. package/lib/mapIterableValues.d.ts +0 -17
  90. package/lib/mapIterableValues.js +0 -15
  91. package/lib/mapMap.cjs +0 -16
  92. package/lib/mapMap.d.cts +0 -17
  93. package/lib/mapMap.d.ts +0 -17
  94. package/lib/mapMap.js +0 -14
  95. package/lib/mapObject.cjs +0 -22
  96. package/lib/mapObject.d.cts +0 -17
  97. package/lib/mapObject.d.ts +0 -17
  98. package/lib/mapObject.js +0 -20
  99. package/lib/mapSet.cjs +0 -16
  100. package/lib/mapSet.d.cts +0 -17
  101. package/lib/mapSet.d.ts +0 -17
  102. package/lib/mapSet.js +0 -14
  103. package/lib/reduceArray.cjs +0 -18
  104. package/lib/reduceArray.d.cts +0 -18
  105. package/lib/reduceArray.d.ts +0 -18
  106. package/lib/reduceArray.js +0 -16
  107. package/lib/reduceIterable.cjs +0 -16
  108. package/lib/reduceIterable.d.cts +0 -18
  109. package/lib/reduceIterable.d.ts +0 -18
  110. package/lib/reduceIterable.js +0 -14
  111. package/lib/reduceIterableEntries.cjs +0 -16
  112. package/lib/reduceIterableEntries.d.cts +0 -18
  113. package/lib/reduceIterableEntries.d.ts +0 -18
  114. package/lib/reduceIterableEntries.js +0 -14
  115. package/lib/reduceIterableKeys.cjs +0 -16
  116. package/lib/reduceIterableKeys.d.cts +0 -18
  117. package/lib/reduceIterableKeys.d.ts +0 -18
  118. package/lib/reduceIterableKeys.js +0 -14
  119. package/lib/reduceIterableValues.cjs +0 -16
  120. package/lib/reduceIterableValues.d.cts +0 -18
  121. package/lib/reduceIterableValues.d.ts +0 -18
  122. package/lib/reduceIterableValues.js +0 -14
  123. package/lib/reduceMap.cjs +0 -16
  124. package/lib/reduceMap.d.cts +0 -18
  125. package/lib/reduceMap.d.ts +0 -18
  126. package/lib/reduceMap.js +0 -14
  127. package/lib/reduceObject.cjs +0 -22
  128. package/lib/reduceObject.d.cts +0 -18
  129. package/lib/reduceObject.d.ts +0 -18
  130. package/lib/reduceObject.js +0 -20
  131. package/lib/reduceSet.cjs +0 -16
  132. package/lib/reduceSet.d.cts +0 -18
  133. package/lib/reduceSet.d.ts +0 -18
  134. package/lib/reduceSet.js +0 -14
  135. package/lib/toObjectIterable.cjs +0 -20
  136. package/lib/toObjectIterable.d.cts +0 -7
  137. package/lib/toObjectIterable.d.ts +0 -7
  138. package/lib/toObjectIterable.js +0 -18
@@ -1,17 +0,0 @@
1
- /**
2
- * Execute a callback function for each key in an iterable of key-value pairs.
3
- *
4
- * @param mapLike - An iterable of key-value tuples to iterate over
5
- * @param callback - A function to execute for each key-value pair
6
- *
7
- * @example
8
- * ```ts
9
- * const entries: [string, number][] = [['apple', 1], ['banana', 2], ['apricot', 3]]
10
- * forEachIterableKeys(entries, (key, value) => {
11
- * console.log(`Key: ${key}, Value: ${value}`)
12
- * })
13
- * ```
14
- */
15
- declare function forEachIterableKeys<K, V>(mapLike: Iterable<[K, V]>, callback: (key: K, value: V) => void): void;
16
-
17
- export { forEachIterableKeys };
@@ -1,12 +0,0 @@
1
- import { forEach } from 'iter-tools';
2
-
3
- var __defProp = Object.defineProperty;
4
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
5
- function forEachIterableKeys(mapLike, callback) {
6
- forEach(([k, v]) => {
7
- callback(k, v);
8
- }, mapLike);
9
- }
10
- __name(forEachIterableKeys, "forEachIterableKeys");
11
-
12
- export { forEachIterableKeys };
@@ -1,14 +0,0 @@
1
- 'use strict';
2
-
3
- var iterTools = require('iter-tools');
4
-
5
- var __defProp = Object.defineProperty;
6
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
- function forEachIterableValues(mapLike, callback) {
8
- iterTools.forEach(([k, v]) => {
9
- callback(v, k);
10
- }, mapLike);
11
- }
12
- __name(forEachIterableValues, "forEachIterableValues");
13
-
14
- exports.forEachIterableValues = forEachIterableValues;
@@ -1,17 +0,0 @@
1
- /**
2
- * Execute a callback function for each value in an iterable of key-value pairs.
3
- *
4
- * @param mapLike - An iterable of key-value tuples to iterate over
5
- * @param callback - A function to execute for each value
6
- *
7
- * @example
8
- * ```ts
9
- * const entries: [string, number][] = [['a', 1], ['b', 2], ['c', 3]]
10
- * forEachIterableValues(entries, (value, key) => {
11
- * console.log(`Value: ${value}, Key: ${key}`)
12
- * })
13
- * ```
14
- */
15
- declare function forEachIterableValues<K, V>(mapLike: Iterable<[K, V]>, callback: (value: V, key: K) => void): void;
16
-
17
- export { forEachIterableValues };
@@ -1,17 +0,0 @@
1
- /**
2
- * Execute a callback function for each value in an iterable of key-value pairs.
3
- *
4
- * @param mapLike - An iterable of key-value tuples to iterate over
5
- * @param callback - A function to execute for each value
6
- *
7
- * @example
8
- * ```ts
9
- * const entries: [string, number][] = [['a', 1], ['b', 2], ['c', 3]]
10
- * forEachIterableValues(entries, (value, key) => {
11
- * console.log(`Value: ${value}, Key: ${key}`)
12
- * })
13
- * ```
14
- */
15
- declare function forEachIterableValues<K, V>(mapLike: Iterable<[K, V]>, callback: (value: V, key: K) => void): void;
16
-
17
- export { forEachIterableValues };
@@ -1,12 +0,0 @@
1
- import { forEach } from 'iter-tools';
2
-
3
- var __defProp = Object.defineProperty;
4
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
5
- function forEachIterableValues(mapLike, callback) {
6
- forEach(([k, v]) => {
7
- callback(v, k);
8
- }, mapLike);
9
- }
10
- __name(forEachIterableValues, "forEachIterableValues");
11
-
12
- export { forEachIterableValues };
@@ -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/forEachMap.ts
7
- function forEachMap(map, callback) {
8
- for (const [key, value] of map) {
9
- callback(value, key);
10
- }
11
- }
12
- __name(forEachMap, "forEachMap");
13
-
14
- exports.forEachMap = forEachMap;
@@ -1,17 +0,0 @@
1
- /**
2
- * Execute a callback function for each entry in a Map.
3
- *
4
- * @param map - The Map to iterate over
5
- * @param callback - A function to execute for each value-key pair
6
- *
7
- * @example
8
- * ```ts
9
- * const map = new Map([['a', 1], ['b', 2], ['c', 3]])
10
- * forEachMap(map, (value, key) => {
11
- * console.log(`${key}: ${value}`)
12
- * })
13
- * ```
14
- */
15
- declare function forEachMap<K, V>(map: ReadonlyMap<K, V>, callback: (value: V, key: K) => void): void;
16
-
17
- export { forEachMap };
@@ -1,17 +0,0 @@
1
- /**
2
- * Execute a callback function for each entry in a Map.
3
- *
4
- * @param map - The Map to iterate over
5
- * @param callback - A function to execute for each value-key pair
6
- *
7
- * @example
8
- * ```ts
9
- * const map = new Map([['a', 1], ['b', 2], ['c', 3]])
10
- * forEachMap(map, (value, key) => {
11
- * console.log(`${key}: ${value}`)
12
- * })
13
- * ```
14
- */
15
- declare function forEachMap<K, V>(map: ReadonlyMap<K, V>, callback: (value: V, key: K) => void): void;
16
-
17
- export { forEachMap };
package/lib/forEachMap.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/forEachMap.ts
5
- function forEachMap(map, callback) {
6
- for (const [key, value] of map) {
7
- callback(value, key);
8
- }
9
- }
10
- __name(forEachMap, "forEachMap");
11
-
12
- export { forEachMap };
@@ -1,20 +0,0 @@
1
- 'use strict';
2
-
3
- var __defProp = Object.defineProperty;
4
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
5
-
6
- // ../object/src/entriesOf.ts
7
- function entriesOf(obj) {
8
- return Object.entries(obj);
9
- }
10
- __name(entriesOf, "entriesOf");
11
-
12
- // src/forEachObject.ts
13
- function forEachObject(object, callback) {
14
- for (const [key, value] of entriesOf(object)) {
15
- callback(value, key);
16
- }
17
- }
18
- __name(forEachObject, "forEachObject");
19
-
20
- exports.forEachObject = forEachObject;
@@ -1,17 +0,0 @@
1
- /**
2
- * Execute a callback function for each property in an object.
3
- *
4
- * @param object - The object to iterate over
5
- * @param callback - A function to execute for each value-key pair
6
- *
7
- * @example
8
- * ```ts
9
- * const obj = { a: 1, b: 2, c: 3 }
10
- * forEachObject(obj, (value, key) => {
11
- * console.log(`${key}: ${value}`)
12
- * })
13
- * ```
14
- */
15
- declare function forEachObject<T extends Record<string, unknown>>(object: T, callback: (value: T[keyof T], key: keyof T) => void): void;
16
-
17
- export { forEachObject };
@@ -1,17 +0,0 @@
1
- /**
2
- * Execute a callback function for each property in an object.
3
- *
4
- * @param object - The object to iterate over
5
- * @param callback - A function to execute for each value-key pair
6
- *
7
- * @example
8
- * ```ts
9
- * const obj = { a: 1, b: 2, c: 3 }
10
- * forEachObject(obj, (value, key) => {
11
- * console.log(`${key}: ${value}`)
12
- * })
13
- * ```
14
- */
15
- declare function forEachObject<T extends Record<string, unknown>>(object: T, callback: (value: T[keyof T], key: keyof T) => void): void;
16
-
17
- export { forEachObject };
@@ -1,18 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
-
4
- // ../object/src/entriesOf.ts
5
- function entriesOf(obj) {
6
- return Object.entries(obj);
7
- }
8
- __name(entriesOf, "entriesOf");
9
-
10
- // src/forEachObject.ts
11
- function forEachObject(object, callback) {
12
- for (const [key, value] of entriesOf(object)) {
13
- callback(value, key);
14
- }
15
- }
16
- __name(forEachObject, "forEachObject");
17
-
18
- export { forEachObject };
@@ -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/forEachSet.ts
7
- function forEachSet(set, callback) {
8
- for (const value of set) {
9
- callback(value);
10
- }
11
- }
12
- __name(forEachSet, "forEachSet");
13
-
14
- exports.forEachSet = forEachSet;
@@ -1,17 +0,0 @@
1
- /**
2
- * Execute a callback function for each value in a Set.
3
- *
4
- * @param set - The Set to iterate over
5
- * @param callback - A function to execute for each value
6
- *
7
- * @example
8
- * ```ts
9
- * const set = new Set([1, 2, 3, 4, 5])
10
- * forEachSet(set, (n) => {
11
- * console.log(n)
12
- * })
13
- * ```
14
- */
15
- declare function forEachSet<V>(set: ReadonlySet<V>, callback: (value: V) => void): void;
16
-
17
- export { forEachSet };
@@ -1,17 +0,0 @@
1
- /**
2
- * Execute a callback function for each value in a Set.
3
- *
4
- * @param set - The Set to iterate over
5
- * @param callback - A function to execute for each value
6
- *
7
- * @example
8
- * ```ts
9
- * const set = new Set([1, 2, 3, 4, 5])
10
- * forEachSet(set, (n) => {
11
- * console.log(n)
12
- * })
13
- * ```
14
- */
15
- declare function forEachSet<V>(set: ReadonlySet<V>, callback: (value: V) => void): void;
16
-
17
- export { forEachSet };
package/lib/forEachSet.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/forEachSet.ts
5
- function forEachSet(set, callback) {
6
- for (const value of set) {
7
- callback(value);
8
- }
9
- }
10
- __name(forEachSet, "forEachSet");
11
-
12
- export { forEachSet };
package/lib/mapArray.cjs DELETED
@@ -1,18 +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/mapArray.ts
7
- function mapArray(array, mapper) {
8
- let index = 0;
9
- const result = [];
10
- for (const value of array) {
11
- result.push(mapper(value, index));
12
- index++;
13
- }
14
- return result;
15
- }
16
- __name(mapArray, "mapArray");
17
-
18
- exports.mapArray = mapArray;
@@ -1,17 +0,0 @@
1
- /**
2
- * Transform each element in an array using a mapper function.
3
- *
4
- * @param array - The array to transform
5
- * @param mapper - A function that transforms each element
6
- * @returns A new array containing the transformed elements
7
- *
8
- * @example
9
- * ```ts
10
- * const numbers = [1, 2, 3, 4, 5]
11
- * const doubled = mapArray(numbers, (n) => n * 2)
12
- * // doubled: [2, 4, 6, 8, 10]
13
- * ```
14
- */
15
- declare function mapArray<V, R>(array: readonly V[], mapper: (value: V, index: number) => R): R[];
16
-
17
- export { mapArray };
package/lib/mapArray.d.ts DELETED
@@ -1,17 +0,0 @@
1
- /**
2
- * Transform each element in an array using a mapper function.
3
- *
4
- * @param array - The array to transform
5
- * @param mapper - A function that transforms each element
6
- * @returns A new array containing the transformed elements
7
- *
8
- * @example
9
- * ```ts
10
- * const numbers = [1, 2, 3, 4, 5]
11
- * const doubled = mapArray(numbers, (n) => n * 2)
12
- * // doubled: [2, 4, 6, 8, 10]
13
- * ```
14
- */
15
- declare function mapArray<V, R>(array: readonly V[], mapper: (value: V, index: number) => R): R[];
16
-
17
- export { mapArray };
package/lib/mapArray.js DELETED
@@ -1,16 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
-
4
- // src/mapArray.ts
5
- function mapArray(array, mapper) {
6
- let index = 0;
7
- const result = [];
8
- for (const value of array) {
9
- result.push(mapper(value, index));
10
- index++;
11
- }
12
- return result;
13
- }
14
- __name(mapArray, "mapArray");
15
-
16
- export { mapArray };
@@ -1,14 +0,0 @@
1
- 'use strict';
2
-
3
- var iterTools = require('iter-tools');
4
-
5
- var __defProp = Object.defineProperty;
6
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
- function mapIterable(collection, mapper) {
8
- return iterTools.map((value) => {
9
- return mapper(value);
10
- }, collection);
11
- }
12
- __name(mapIterable, "mapIterable");
13
-
14
- exports.mapIterable = mapIterable;
@@ -1,17 +0,0 @@
1
- /**
2
- * Transform each element in an iterable using a mapper function.
3
- *
4
- * @param collection - The iterable to transform
5
- * @param mapper - A function that transforms each element
6
- * @returns An iterable containing the transformed elements
7
- *
8
- * @example
9
- * ```ts
10
- * const numbers = [1, 2, 3, 4, 5]
11
- * const doubled = mapIterable(numbers, (n) => n * 2)
12
- * // doubled: Iterable of [2, 4, 6, 8, 10]
13
- * ```
14
- */
15
- declare function mapIterable<T, R>(collection: Iterable<T>, mapper: (value: T) => R): Iterable<R>;
16
-
17
- export { mapIterable };
@@ -1,17 +0,0 @@
1
- /**
2
- * Transform each element in an iterable using a mapper function.
3
- *
4
- * @param collection - The iterable to transform
5
- * @param mapper - A function that transforms each element
6
- * @returns An iterable containing the transformed elements
7
- *
8
- * @example
9
- * ```ts
10
- * const numbers = [1, 2, 3, 4, 5]
11
- * const doubled = mapIterable(numbers, (n) => n * 2)
12
- * // doubled: Iterable of [2, 4, 6, 8, 10]
13
- * ```
14
- */
15
- declare function mapIterable<T, R>(collection: Iterable<T>, mapper: (value: T) => R): Iterable<R>;
16
-
17
- export { mapIterable };
@@ -1,12 +0,0 @@
1
- import { map } from 'iter-tools';
2
-
3
- var __defProp = Object.defineProperty;
4
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
5
- function mapIterable(collection, mapper) {
6
- return map((value) => {
7
- return mapper(value);
8
- }, collection);
9
- }
10
- __name(mapIterable, "mapIterable");
11
-
12
- export { mapIterable };
@@ -1,12 +0,0 @@
1
- 'use strict';
2
-
3
- var iterTools = require('iter-tools');
4
-
5
- var __defProp = Object.defineProperty;
6
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
- function mapIterableEntries(mapLike, mapper) {
8
- return iterTools.map(mapper, mapLike);
9
- }
10
- __name(mapIterableEntries, "mapIterableEntries");
11
-
12
- exports.mapIterableEntries = mapIterableEntries;
@@ -1,17 +0,0 @@
1
- /**
2
- * Transform each entry in an iterable of key-value pairs using a mapper function.
3
- *
4
- * @param mapLike - An iterable of key-value tuples to transform
5
- * @param mapper - A function that transforms each entry
6
- * @returns An iterable containing the transformed entries
7
- *
8
- * @example
9
- * ```ts
10
- * const entries: [string, number][] = [['a', 1], ['b', 2], ['c', 3]]
11
- * const mapped = mapIterableEntries(entries, ([key, value]) => [key, value * 2])
12
- * // mapped: Iterable of [['a', 2], ['b', 4], ['c', 6]]
13
- * ```
14
- */
15
- declare function mapIterableEntries<K, V, K2, V2>(mapLike: Iterable<[K, V]>, mapper: (entry: [K, V]) => [K2, V2]): Iterable<[K2, V2]>;
16
-
17
- export { mapIterableEntries };
@@ -1,17 +0,0 @@
1
- /**
2
- * Transform each entry in an iterable of key-value pairs using a mapper function.
3
- *
4
- * @param mapLike - An iterable of key-value tuples to transform
5
- * @param mapper - A function that transforms each entry
6
- * @returns An iterable containing the transformed entries
7
- *
8
- * @example
9
- * ```ts
10
- * const entries: [string, number][] = [['a', 1], ['b', 2], ['c', 3]]
11
- * const mapped = mapIterableEntries(entries, ([key, value]) => [key, value * 2])
12
- * // mapped: Iterable of [['a', 2], ['b', 4], ['c', 6]]
13
- * ```
14
- */
15
- declare function mapIterableEntries<K, V, K2, V2>(mapLike: Iterable<[K, V]>, mapper: (entry: [K, V]) => [K2, V2]): Iterable<[K2, V2]>;
16
-
17
- export { mapIterableEntries };
@@ -1,10 +0,0 @@
1
- import { map } from 'iter-tools';
2
-
3
- var __defProp = Object.defineProperty;
4
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
5
- function mapIterableEntries(mapLike, mapper) {
6
- return map(mapper, mapLike);
7
- }
8
- __name(mapIterableEntries, "mapIterableEntries");
9
-
10
- export { mapIterableEntries };
@@ -1,17 +0,0 @@
1
- 'use strict';
2
-
3
- var iterTools = require('iter-tools');
4
-
5
- var __defProp = Object.defineProperty;
6
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
- function mapIterableKeys(mapLike, mapper) {
8
- return iterTools.map(([k, v]) => {
9
- return [
10
- mapper(k, v),
11
- v
12
- ];
13
- }, mapLike);
14
- }
15
- __name(mapIterableKeys, "mapIterableKeys");
16
-
17
- exports.mapIterableKeys = mapIterableKeys;
@@ -1,17 +0,0 @@
1
- /**
2
- * Transform the keys in an iterable of key-value pairs using a mapper function.
3
- *
4
- * @param mapLike - An iterable of key-value tuples to transform
5
- * @param mapper - A function that transforms each key
6
- * @returns An iterable containing entries with transformed keys
7
- *
8
- * @example
9
- * ```ts
10
- * const entries: [string, number][] = [['a', 1], ['b', 2], ['c', 3]]
11
- * const mapped = mapIterableKeys(entries, (key) => key.toUpperCase())
12
- * // mapped: Iterable of [['A', 1], ['B', 2], ['C', 3]]
13
- * ```
14
- */
15
- declare function mapIterableKeys<K, V, K2>(mapLike: Iterable<[K, V]>, mapper: (key: K, value: V) => K2): Iterable<[K2, V]>;
16
-
17
- export { mapIterableKeys };
@@ -1,17 +0,0 @@
1
- /**
2
- * Transform the keys in an iterable of key-value pairs using a mapper function.
3
- *
4
- * @param mapLike - An iterable of key-value tuples to transform
5
- * @param mapper - A function that transforms each key
6
- * @returns An iterable containing entries with transformed keys
7
- *
8
- * @example
9
- * ```ts
10
- * const entries: [string, number][] = [['a', 1], ['b', 2], ['c', 3]]
11
- * const mapped = mapIterableKeys(entries, (key) => key.toUpperCase())
12
- * // mapped: Iterable of [['A', 1], ['B', 2], ['C', 3]]
13
- * ```
14
- */
15
- declare function mapIterableKeys<K, V, K2>(mapLike: Iterable<[K, V]>, mapper: (key: K, value: V) => K2): Iterable<[K2, V]>;
16
-
17
- export { mapIterableKeys };
@@ -1,15 +0,0 @@
1
- import { map } from 'iter-tools';
2
-
3
- var __defProp = Object.defineProperty;
4
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
5
- function mapIterableKeys(mapLike, mapper) {
6
- return map(([k, v]) => {
7
- return [
8
- mapper(k, v),
9
- v
10
- ];
11
- }, mapLike);
12
- }
13
- __name(mapIterableKeys, "mapIterableKeys");
14
-
15
- export { mapIterableKeys };
@@ -1,17 +0,0 @@
1
- 'use strict';
2
-
3
- var iterTools = require('iter-tools');
4
-
5
- var __defProp = Object.defineProperty;
6
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
- function mapIterableValues(mapLike, mapper) {
8
- return iterTools.map(([k, v]) => {
9
- return [
10
- k,
11
- mapper(v, k)
12
- ];
13
- }, mapLike);
14
- }
15
- __name(mapIterableValues, "mapIterableValues");
16
-
17
- exports.mapIterableValues = mapIterableValues;
@@ -1,17 +0,0 @@
1
- /**
2
- * Transform the values in an iterable of key-value pairs using a mapper function.
3
- *
4
- * @param mapLike - An iterable of key-value tuples to transform
5
- * @param mapper - A function that transforms each value
6
- * @returns An iterable containing entries with transformed values
7
- *
8
- * @example
9
- * ```ts
10
- * const entries: [string, number][] = [['a', 1], ['b', 2], ['c', 3]]
11
- * const mapped = mapIterableValues(entries, (value) => value * 2)
12
- * // mapped: Iterable of [['a', 2], ['b', 4], ['c', 6]]
13
- * ```
14
- */
15
- declare function mapIterableValues<K, V, V2>(mapLike: Iterable<[K, V]>, mapper: (value: V, key: K) => V2): Iterable<[K, V2]>;
16
-
17
- export { mapIterableValues };
@@ -1,17 +0,0 @@
1
- /**
2
- * Transform the values in an iterable of key-value pairs using a mapper function.
3
- *
4
- * @param mapLike - An iterable of key-value tuples to transform
5
- * @param mapper - A function that transforms each value
6
- * @returns An iterable containing entries with transformed values
7
- *
8
- * @example
9
- * ```ts
10
- * const entries: [string, number][] = [['a', 1], ['b', 2], ['c', 3]]
11
- * const mapped = mapIterableValues(entries, (value) => value * 2)
12
- * // mapped: Iterable of [['a', 2], ['b', 4], ['c', 6]]
13
- * ```
14
- */
15
- declare function mapIterableValues<K, V, V2>(mapLike: Iterable<[K, V]>, mapper: (value: V, key: K) => V2): Iterable<[K, V2]>;
16
-
17
- export { mapIterableValues };
@@ -1,15 +0,0 @@
1
- import { map } from 'iter-tools';
2
-
3
- var __defProp = Object.defineProperty;
4
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
5
- function mapIterableValues(mapLike, mapper) {
6
- return map(([k, v]) => {
7
- return [
8
- k,
9
- mapper(v, k)
10
- ];
11
- }, mapLike);
12
- }
13
- __name(mapIterableValues, "mapIterableValues");
14
-
15
- export { mapIterableValues };