Add settings page for managing forecasting API key and URL via UI
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
cae411eae7
commit
1c411e402e
19809 changed files with 1962608 additions and 97 deletions
36
frontend/node_modules/es-toolkit/dist/map/countBy.d.mts
generated
vendored
Normal file
36
frontend/node_modules/es-toolkit/dist/map/countBy.d.mts
generated
vendored
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
//#region src/map/countBy.d.ts
|
||||
/**
|
||||
* Counts the occurrences of items in a Map based on a transformation function.
|
||||
*
|
||||
* This function takes a Map and a function that generates a key from each value-key pair.
|
||||
* It returns an object with the generated keys as properties and their counts as values.
|
||||
* The count is incremented for each entry for which the transformation produces the same key.
|
||||
*
|
||||
* @template K - The type of the Map's keys.
|
||||
* @template V - The type of the Map's values.
|
||||
* @template K2 - The type of keys produced by the transformation function.
|
||||
* @param map - The Map to count occurrences from.
|
||||
* @param mapper - The function to produce a key for counting.
|
||||
* @returns An object containing the mapped keys and their counts.
|
||||
*
|
||||
* @example
|
||||
* const map = new Map([
|
||||
* ['a', 1],
|
||||
* ['b', 2],
|
||||
* ['c', 1]
|
||||
* ]);
|
||||
* const result = countBy(map, (value) => value);
|
||||
* // result will be { 1: 2, 2: 1 }
|
||||
*
|
||||
* @example
|
||||
* const map = new Map([
|
||||
* ['alice', 20],
|
||||
* ['bob', 30],
|
||||
* ['carol', 20]
|
||||
* ]);
|
||||
* const result = countBy(map, (value, key) => key[0]);
|
||||
* // result will be { a: 1, b: 1, c: 1 }
|
||||
*/
|
||||
declare function countBy<K, V, K2 extends PropertyKey>(map: Map<K, V>, mapper: (value: V, key: K, object: Map<K, V>) => K2): Map<K2, number>;
|
||||
//#endregion
|
||||
export { countBy };
|
||||
36
frontend/node_modules/es-toolkit/dist/map/countBy.d.ts
generated
vendored
Normal file
36
frontend/node_modules/es-toolkit/dist/map/countBy.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
//#region src/map/countBy.d.ts
|
||||
/**
|
||||
* Counts the occurrences of items in a Map based on a transformation function.
|
||||
*
|
||||
* This function takes a Map and a function that generates a key from each value-key pair.
|
||||
* It returns an object with the generated keys as properties and their counts as values.
|
||||
* The count is incremented for each entry for which the transformation produces the same key.
|
||||
*
|
||||
* @template K - The type of the Map's keys.
|
||||
* @template V - The type of the Map's values.
|
||||
* @template K2 - The type of keys produced by the transformation function.
|
||||
* @param map - The Map to count occurrences from.
|
||||
* @param mapper - The function to produce a key for counting.
|
||||
* @returns An object containing the mapped keys and their counts.
|
||||
*
|
||||
* @example
|
||||
* const map = new Map([
|
||||
* ['a', 1],
|
||||
* ['b', 2],
|
||||
* ['c', 1]
|
||||
* ]);
|
||||
* const result = countBy(map, (value) => value);
|
||||
* // result will be { 1: 2, 2: 1 }
|
||||
*
|
||||
* @example
|
||||
* const map = new Map([
|
||||
* ['alice', 20],
|
||||
* ['bob', 30],
|
||||
* ['carol', 20]
|
||||
* ]);
|
||||
* const result = countBy(map, (value, key) => key[0]);
|
||||
* // result will be { a: 1, b: 1, c: 1 }
|
||||
*/
|
||||
declare function countBy<K, V, K2 extends PropertyKey>(map: Map<K, V>, mapper: (value: V, key: K, object: Map<K, V>) => K2): Map<K2, number>;
|
||||
//#endregion
|
||||
export { countBy };
|
||||
43
frontend/node_modules/es-toolkit/dist/map/countBy.js
generated
vendored
Normal file
43
frontend/node_modules/es-toolkit/dist/map/countBy.js
generated
vendored
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
//#region src/map/countBy.ts
|
||||
/**
|
||||
* Counts the occurrences of items in a Map based on a transformation function.
|
||||
*
|
||||
* This function takes a Map and a function that generates a key from each value-key pair.
|
||||
* It returns an object with the generated keys as properties and their counts as values.
|
||||
* The count is incremented for each entry for which the transformation produces the same key.
|
||||
*
|
||||
* @template K - The type of the Map's keys.
|
||||
* @template V - The type of the Map's values.
|
||||
* @template K2 - The type of keys produced by the transformation function.
|
||||
* @param map - The Map to count occurrences from.
|
||||
* @param mapper - The function to produce a key for counting.
|
||||
* @returns An object containing the mapped keys and their counts.
|
||||
*
|
||||
* @example
|
||||
* const map = new Map([
|
||||
* ['a', 1],
|
||||
* ['b', 2],
|
||||
* ['c', 1]
|
||||
* ]);
|
||||
* const result = countBy(map, (value) => value);
|
||||
* // result will be { 1: 2, 2: 1 }
|
||||
*
|
||||
* @example
|
||||
* const map = new Map([
|
||||
* ['alice', 20],
|
||||
* ['bob', 30],
|
||||
* ['carol', 20]
|
||||
* ]);
|
||||
* const result = countBy(map, (value, key) => key[0]);
|
||||
* // result will be { a: 1, b: 1, c: 1 }
|
||||
*/
|
||||
function countBy(map, mapper) {
|
||||
const result = /* @__PURE__ */ new Map();
|
||||
for (const [key, value] of map) {
|
||||
const mappedKey = mapper(value, key, map);
|
||||
result.set(mappedKey, (result.get(mappedKey) ?? 0) + 1);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
//#endregion
|
||||
exports.countBy = countBy;
|
||||
43
frontend/node_modules/es-toolkit/dist/map/countBy.mjs
generated
vendored
Normal file
43
frontend/node_modules/es-toolkit/dist/map/countBy.mjs
generated
vendored
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
//#region src/map/countBy.ts
|
||||
/**
|
||||
* Counts the occurrences of items in a Map based on a transformation function.
|
||||
*
|
||||
* This function takes a Map and a function that generates a key from each value-key pair.
|
||||
* It returns an object with the generated keys as properties and their counts as values.
|
||||
* The count is incremented for each entry for which the transformation produces the same key.
|
||||
*
|
||||
* @template K - The type of the Map's keys.
|
||||
* @template V - The type of the Map's values.
|
||||
* @template K2 - The type of keys produced by the transformation function.
|
||||
* @param map - The Map to count occurrences from.
|
||||
* @param mapper - The function to produce a key for counting.
|
||||
* @returns An object containing the mapped keys and their counts.
|
||||
*
|
||||
* @example
|
||||
* const map = new Map([
|
||||
* ['a', 1],
|
||||
* ['b', 2],
|
||||
* ['c', 1]
|
||||
* ]);
|
||||
* const result = countBy(map, (value) => value);
|
||||
* // result will be { 1: 2, 2: 1 }
|
||||
*
|
||||
* @example
|
||||
* const map = new Map([
|
||||
* ['alice', 20],
|
||||
* ['bob', 30],
|
||||
* ['carol', 20]
|
||||
* ]);
|
||||
* const result = countBy(map, (value, key) => key[0]);
|
||||
* // result will be { a: 1, b: 1, c: 1 }
|
||||
*/
|
||||
function countBy(map, mapper) {
|
||||
const result = /* @__PURE__ */ new Map();
|
||||
for (const [key, value] of map) {
|
||||
const mappedKey = mapper(value, key, map);
|
||||
result.set(mappedKey, (result.get(mappedKey) ?? 0) + 1);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
//#endregion
|
||||
export { countBy };
|
||||
29
frontend/node_modules/es-toolkit/dist/map/every.d.mts
generated
vendored
Normal file
29
frontend/node_modules/es-toolkit/dist/map/every.d.mts
generated
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
//#region src/map/every.d.ts
|
||||
/**
|
||||
* Tests whether all entries in a Map satisfy the provided predicate function.
|
||||
*
|
||||
* This function iterates through all entries of the Map and checks if the predicate function
|
||||
* returns true for every entry. It returns true if the predicate is satisfied for all entries,
|
||||
* and false otherwise.
|
||||
*
|
||||
* @template K - The type of keys in the Map.
|
||||
* @template V - The type of values in the Map.
|
||||
* @param map - The Map to test.
|
||||
* @param doesMatch - A predicate function that tests each entry.
|
||||
* @returns true if all entries satisfy the predicate, false otherwise.
|
||||
*
|
||||
* @example
|
||||
* const map = new Map([
|
||||
* ['a', 10],
|
||||
* ['b', 20],
|
||||
* ['c', 30]
|
||||
* ]);
|
||||
* const result = every(map, (value) => value > 5);
|
||||
* // result will be: true
|
||||
*
|
||||
* const result2 = every(map, (value) => value > 15);
|
||||
* // result2 will be: false
|
||||
*/
|
||||
declare function every<K, V>(map: Map<K, V>, doesMatch: (value: V, key: K, map: Map<K, V>) => boolean): boolean;
|
||||
//#endregion
|
||||
export { every };
|
||||
29
frontend/node_modules/es-toolkit/dist/map/every.d.ts
generated
vendored
Normal file
29
frontend/node_modules/es-toolkit/dist/map/every.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
//#region src/map/every.d.ts
|
||||
/**
|
||||
* Tests whether all entries in a Map satisfy the provided predicate function.
|
||||
*
|
||||
* This function iterates through all entries of the Map and checks if the predicate function
|
||||
* returns true for every entry. It returns true if the predicate is satisfied for all entries,
|
||||
* and false otherwise.
|
||||
*
|
||||
* @template K - The type of keys in the Map.
|
||||
* @template V - The type of values in the Map.
|
||||
* @param map - The Map to test.
|
||||
* @param doesMatch - A predicate function that tests each entry.
|
||||
* @returns true if all entries satisfy the predicate, false otherwise.
|
||||
*
|
||||
* @example
|
||||
* const map = new Map([
|
||||
* ['a', 10],
|
||||
* ['b', 20],
|
||||
* ['c', 30]
|
||||
* ]);
|
||||
* const result = every(map, (value) => value > 5);
|
||||
* // result will be: true
|
||||
*
|
||||
* const result2 = every(map, (value) => value > 15);
|
||||
* // result2 will be: false
|
||||
*/
|
||||
declare function every<K, V>(map: Map<K, V>, doesMatch: (value: V, key: K, map: Map<K, V>) => boolean): boolean;
|
||||
//#endregion
|
||||
export { every };
|
||||
32
frontend/node_modules/es-toolkit/dist/map/every.js
generated
vendored
Normal file
32
frontend/node_modules/es-toolkit/dist/map/every.js
generated
vendored
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
//#region src/map/every.ts
|
||||
/**
|
||||
* Tests whether all entries in a Map satisfy the provided predicate function.
|
||||
*
|
||||
* This function iterates through all entries of the Map and checks if the predicate function
|
||||
* returns true for every entry. It returns true if the predicate is satisfied for all entries,
|
||||
* and false otherwise.
|
||||
*
|
||||
* @template K - The type of keys in the Map.
|
||||
* @template V - The type of values in the Map.
|
||||
* @param map - The Map to test.
|
||||
* @param doesMatch - A predicate function that tests each entry.
|
||||
* @returns true if all entries satisfy the predicate, false otherwise.
|
||||
*
|
||||
* @example
|
||||
* const map = new Map([
|
||||
* ['a', 10],
|
||||
* ['b', 20],
|
||||
* ['c', 30]
|
||||
* ]);
|
||||
* const result = every(map, (value) => value > 5);
|
||||
* // result will be: true
|
||||
*
|
||||
* const result2 = every(map, (value) => value > 15);
|
||||
* // result2 will be: false
|
||||
*/
|
||||
function every(map, doesMatch) {
|
||||
for (const [key, value] of map) if (!doesMatch(value, key, map)) return false;
|
||||
return true;
|
||||
}
|
||||
//#endregion
|
||||
exports.every = every;
|
||||
32
frontend/node_modules/es-toolkit/dist/map/every.mjs
generated
vendored
Normal file
32
frontend/node_modules/es-toolkit/dist/map/every.mjs
generated
vendored
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
//#region src/map/every.ts
|
||||
/**
|
||||
* Tests whether all entries in a Map satisfy the provided predicate function.
|
||||
*
|
||||
* This function iterates through all entries of the Map and checks if the predicate function
|
||||
* returns true for every entry. It returns true if the predicate is satisfied for all entries,
|
||||
* and false otherwise.
|
||||
*
|
||||
* @template K - The type of keys in the Map.
|
||||
* @template V - The type of values in the Map.
|
||||
* @param map - The Map to test.
|
||||
* @param doesMatch - A predicate function that tests each entry.
|
||||
* @returns true if all entries satisfy the predicate, false otherwise.
|
||||
*
|
||||
* @example
|
||||
* const map = new Map([
|
||||
* ['a', 10],
|
||||
* ['b', 20],
|
||||
* ['c', 30]
|
||||
* ]);
|
||||
* const result = every(map, (value) => value > 5);
|
||||
* // result will be: true
|
||||
*
|
||||
* const result2 = every(map, (value) => value > 15);
|
||||
* // result2 will be: false
|
||||
*/
|
||||
function every(map, doesMatch) {
|
||||
for (const [key, value] of map) if (!doesMatch(value, key, map)) return false;
|
||||
return true;
|
||||
}
|
||||
//#endregion
|
||||
export { every };
|
||||
30
frontend/node_modules/es-toolkit/dist/map/filter.d.mts
generated
vendored
Normal file
30
frontend/node_modules/es-toolkit/dist/map/filter.d.mts
generated
vendored
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
//#region src/map/filter.d.ts
|
||||
/**
|
||||
* Filters a Map based on a predicate function.
|
||||
*
|
||||
* This function takes a Map and a predicate function, and returns a new Map containing
|
||||
* only the entries for which the predicate function returns true.
|
||||
*
|
||||
* @template K - The type of keys in the Map.
|
||||
* @template V - The type of values in the Map.
|
||||
* @param map - The Map to filter.
|
||||
* @param callback - A predicate function that tests each entry.
|
||||
* @returns A new Map containing only the entries that satisfy the predicate.
|
||||
*
|
||||
* @example
|
||||
* const map = new Map([
|
||||
* ['a', 1],
|
||||
* ['b', 2],
|
||||
* ['c', 3],
|
||||
* ['d', 4]
|
||||
* ]);
|
||||
* const result = filter(map, (value) => value > 2);
|
||||
* // result will be:
|
||||
* // Map(2) {
|
||||
* // 'c' => 3,
|
||||
* // 'd' => 4
|
||||
* // }
|
||||
*/
|
||||
declare function filter<K, V>(map: Map<K, V>, callback: (value: V, key: K, map: Map<K, V>) => boolean): Map<K, V>;
|
||||
//#endregion
|
||||
export { filter };
|
||||
30
frontend/node_modules/es-toolkit/dist/map/filter.d.ts
generated
vendored
Normal file
30
frontend/node_modules/es-toolkit/dist/map/filter.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
//#region src/map/filter.d.ts
|
||||
/**
|
||||
* Filters a Map based on a predicate function.
|
||||
*
|
||||
* This function takes a Map and a predicate function, and returns a new Map containing
|
||||
* only the entries for which the predicate function returns true.
|
||||
*
|
||||
* @template K - The type of keys in the Map.
|
||||
* @template V - The type of values in the Map.
|
||||
* @param map - The Map to filter.
|
||||
* @param callback - A predicate function that tests each entry.
|
||||
* @returns A new Map containing only the entries that satisfy the predicate.
|
||||
*
|
||||
* @example
|
||||
* const map = new Map([
|
||||
* ['a', 1],
|
||||
* ['b', 2],
|
||||
* ['c', 3],
|
||||
* ['d', 4]
|
||||
* ]);
|
||||
* const result = filter(map, (value) => value > 2);
|
||||
* // result will be:
|
||||
* // Map(2) {
|
||||
* // 'c' => 3,
|
||||
* // 'd' => 4
|
||||
* // }
|
||||
*/
|
||||
declare function filter<K, V>(map: Map<K, V>, callback: (value: V, key: K, map: Map<K, V>) => boolean): Map<K, V>;
|
||||
//#endregion
|
||||
export { filter };
|
||||
34
frontend/node_modules/es-toolkit/dist/map/filter.js
generated
vendored
Normal file
34
frontend/node_modules/es-toolkit/dist/map/filter.js
generated
vendored
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
//#region src/map/filter.ts
|
||||
/**
|
||||
* Filters a Map based on a predicate function.
|
||||
*
|
||||
* This function takes a Map and a predicate function, and returns a new Map containing
|
||||
* only the entries for which the predicate function returns true.
|
||||
*
|
||||
* @template K - The type of keys in the Map.
|
||||
* @template V - The type of values in the Map.
|
||||
* @param map - The Map to filter.
|
||||
* @param callback - A predicate function that tests each entry.
|
||||
* @returns A new Map containing only the entries that satisfy the predicate.
|
||||
*
|
||||
* @example
|
||||
* const map = new Map([
|
||||
* ['a', 1],
|
||||
* ['b', 2],
|
||||
* ['c', 3],
|
||||
* ['d', 4]
|
||||
* ]);
|
||||
* const result = filter(map, (value) => value > 2);
|
||||
* // result will be:
|
||||
* // Map(2) {
|
||||
* // 'c' => 3,
|
||||
* // 'd' => 4
|
||||
* // }
|
||||
*/
|
||||
function filter(map, callback) {
|
||||
const result = /* @__PURE__ */ new Map();
|
||||
for (const [key, value] of map) if (callback(value, key, map)) result.set(key, value);
|
||||
return result;
|
||||
}
|
||||
//#endregion
|
||||
exports.filter = filter;
|
||||
34
frontend/node_modules/es-toolkit/dist/map/filter.mjs
generated
vendored
Normal file
34
frontend/node_modules/es-toolkit/dist/map/filter.mjs
generated
vendored
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
//#region src/map/filter.ts
|
||||
/**
|
||||
* Filters a Map based on a predicate function.
|
||||
*
|
||||
* This function takes a Map and a predicate function, and returns a new Map containing
|
||||
* only the entries for which the predicate function returns true.
|
||||
*
|
||||
* @template K - The type of keys in the Map.
|
||||
* @template V - The type of values in the Map.
|
||||
* @param map - The Map to filter.
|
||||
* @param callback - A predicate function that tests each entry.
|
||||
* @returns A new Map containing only the entries that satisfy the predicate.
|
||||
*
|
||||
* @example
|
||||
* const map = new Map([
|
||||
* ['a', 1],
|
||||
* ['b', 2],
|
||||
* ['c', 3],
|
||||
* ['d', 4]
|
||||
* ]);
|
||||
* const result = filter(map, (value) => value > 2);
|
||||
* // result will be:
|
||||
* // Map(2) {
|
||||
* // 'c' => 3,
|
||||
* // 'd' => 4
|
||||
* // }
|
||||
*/
|
||||
function filter(map, callback) {
|
||||
const result = /* @__PURE__ */ new Map();
|
||||
for (const [key, value] of map) if (callback(value, key, map)) result.set(key, value);
|
||||
return result;
|
||||
}
|
||||
//#endregion
|
||||
export { filter };
|
||||
26
frontend/node_modules/es-toolkit/dist/map/findKey.d.mts
generated
vendored
Normal file
26
frontend/node_modules/es-toolkit/dist/map/findKey.d.mts
generated
vendored
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
//#region src/map/findKey.d.ts
|
||||
/**
|
||||
* Finds the first key in a Map for which the predicate function returns true.
|
||||
*
|
||||
* This function iterates through the entries of the Map and returns the key of the first
|
||||
* entry for which the predicate function returns true. If no entry satisfies the predicate,
|
||||
* it returns undefined.
|
||||
*
|
||||
* @template K - The type of keys in the Map.
|
||||
* @template V - The type of values in the Map.
|
||||
* @param map - The Map to search.
|
||||
* @param doesMatch - A predicate function that tests each entry.
|
||||
* @returns The key of the first entry that satisfies the predicate, or undefined if none found.
|
||||
*
|
||||
* @example
|
||||
* const map = new Map([
|
||||
* ['apple', { color: 'red', quantity: 10 }],
|
||||
* ['banana', { color: 'yellow', quantity: 5 }],
|
||||
* ['grape', { color: 'purple', quantity: 15 }]
|
||||
* ]);
|
||||
* const result = findKey(map, (value) => value.quantity > 10);
|
||||
* // result will be: 'grape'
|
||||
*/
|
||||
declare function findKey<K, V>(map: Map<K, V>, doesMatch: (value: V, key: K, map: Map<K, V>) => boolean): K | undefined;
|
||||
//#endregion
|
||||
export { findKey };
|
||||
26
frontend/node_modules/es-toolkit/dist/map/findKey.d.ts
generated
vendored
Normal file
26
frontend/node_modules/es-toolkit/dist/map/findKey.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
//#region src/map/findKey.d.ts
|
||||
/**
|
||||
* Finds the first key in a Map for which the predicate function returns true.
|
||||
*
|
||||
* This function iterates through the entries of the Map and returns the key of the first
|
||||
* entry for which the predicate function returns true. If no entry satisfies the predicate,
|
||||
* it returns undefined.
|
||||
*
|
||||
* @template K - The type of keys in the Map.
|
||||
* @template V - The type of values in the Map.
|
||||
* @param map - The Map to search.
|
||||
* @param doesMatch - A predicate function that tests each entry.
|
||||
* @returns The key of the first entry that satisfies the predicate, or undefined if none found.
|
||||
*
|
||||
* @example
|
||||
* const map = new Map([
|
||||
* ['apple', { color: 'red', quantity: 10 }],
|
||||
* ['banana', { color: 'yellow', quantity: 5 }],
|
||||
* ['grape', { color: 'purple', quantity: 15 }]
|
||||
* ]);
|
||||
* const result = findKey(map, (value) => value.quantity > 10);
|
||||
* // result will be: 'grape'
|
||||
*/
|
||||
declare function findKey<K, V>(map: Map<K, V>, doesMatch: (value: V, key: K, map: Map<K, V>) => boolean): K | undefined;
|
||||
//#endregion
|
||||
export { findKey };
|
||||
33
frontend/node_modules/es-toolkit/dist/map/findKey.js
generated
vendored
Normal file
33
frontend/node_modules/es-toolkit/dist/map/findKey.js
generated
vendored
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
//#region src/map/findKey.ts
|
||||
/**
|
||||
* Finds the first key in a Map for which the predicate function returns true.
|
||||
*
|
||||
* This function iterates through the entries of the Map and returns the key of the first
|
||||
* entry for which the predicate function returns true. If no entry satisfies the predicate,
|
||||
* it returns undefined.
|
||||
*
|
||||
* @template K - The type of keys in the Map.
|
||||
* @template V - The type of values in the Map.
|
||||
* @param map - The Map to search.
|
||||
* @param doesMatch - A predicate function that tests each entry.
|
||||
* @returns The key of the first entry that satisfies the predicate, or undefined if none found.
|
||||
*
|
||||
* @example
|
||||
* const map = new Map([
|
||||
* ['apple', { color: 'red', quantity: 10 }],
|
||||
* ['banana', { color: 'yellow', quantity: 5 }],
|
||||
* ['grape', { color: 'purple', quantity: 15 }]
|
||||
* ]);
|
||||
* const result = findKey(map, (value) => value.quantity > 10);
|
||||
* // result will be: 'grape'
|
||||
*/
|
||||
function findKey(map, doesMatch) {
|
||||
let result = void 0;
|
||||
for (const [key, value] of map) if (doesMatch(value, key, map)) {
|
||||
result = key;
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
//#endregion
|
||||
exports.findKey = findKey;
|
||||
33
frontend/node_modules/es-toolkit/dist/map/findKey.mjs
generated
vendored
Normal file
33
frontend/node_modules/es-toolkit/dist/map/findKey.mjs
generated
vendored
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
//#region src/map/findKey.ts
|
||||
/**
|
||||
* Finds the first key in a Map for which the predicate function returns true.
|
||||
*
|
||||
* This function iterates through the entries of the Map and returns the key of the first
|
||||
* entry for which the predicate function returns true. If no entry satisfies the predicate,
|
||||
* it returns undefined.
|
||||
*
|
||||
* @template K - The type of keys in the Map.
|
||||
* @template V - The type of values in the Map.
|
||||
* @param map - The Map to search.
|
||||
* @param doesMatch - A predicate function that tests each entry.
|
||||
* @returns The key of the first entry that satisfies the predicate, or undefined if none found.
|
||||
*
|
||||
* @example
|
||||
* const map = new Map([
|
||||
* ['apple', { color: 'red', quantity: 10 }],
|
||||
* ['banana', { color: 'yellow', quantity: 5 }],
|
||||
* ['grape', { color: 'purple', quantity: 15 }]
|
||||
* ]);
|
||||
* const result = findKey(map, (value) => value.quantity > 10);
|
||||
* // result will be: 'grape'
|
||||
*/
|
||||
function findKey(map, doesMatch) {
|
||||
let result = void 0;
|
||||
for (const [key, value] of map) if (doesMatch(value, key, map)) {
|
||||
result = key;
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
//#endregion
|
||||
export { findKey };
|
||||
26
frontend/node_modules/es-toolkit/dist/map/findValue.d.mts
generated
vendored
Normal file
26
frontend/node_modules/es-toolkit/dist/map/findValue.d.mts
generated
vendored
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
//#region src/map/findValue.d.ts
|
||||
/**
|
||||
* Finds the first value in a Map for which the predicate function returns true.
|
||||
*
|
||||
* This function iterates through the entries of the Map and returns the value of the first
|
||||
* entry for which the predicate function returns true. If no entry satisfies the predicate,
|
||||
* it returns undefined.
|
||||
*
|
||||
* @template K - The type of keys in the Map.
|
||||
* @template V - The type of values in the Map.
|
||||
* @param map - The Map to search.
|
||||
* @param doesMatch - A predicate function that tests each entry.
|
||||
* @returns The value of the first entry that satisfies the predicate, or undefined if none found.
|
||||
*
|
||||
* @example
|
||||
* const map = new Map([
|
||||
* ['apple', { color: 'red', quantity: 10 }],
|
||||
* ['banana', { color: 'yellow', quantity: 5 }],
|
||||
* ['grape', { color: 'purple', quantity: 15 }]
|
||||
* ]);
|
||||
* const result = findValue(map, (value) => value.quantity > 10);
|
||||
* // result will be: { color: 'purple', quantity: 15 }
|
||||
*/
|
||||
declare function findValue<K, V>(map: Map<K, V>, doesMatch: (value: V, key: K, map: Map<K, V>) => boolean): V | undefined;
|
||||
//#endregion
|
||||
export { findValue };
|
||||
26
frontend/node_modules/es-toolkit/dist/map/findValue.d.ts
generated
vendored
Normal file
26
frontend/node_modules/es-toolkit/dist/map/findValue.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
//#region src/map/findValue.d.ts
|
||||
/**
|
||||
* Finds the first value in a Map for which the predicate function returns true.
|
||||
*
|
||||
* This function iterates through the entries of the Map and returns the value of the first
|
||||
* entry for which the predicate function returns true. If no entry satisfies the predicate,
|
||||
* it returns undefined.
|
||||
*
|
||||
* @template K - The type of keys in the Map.
|
||||
* @template V - The type of values in the Map.
|
||||
* @param map - The Map to search.
|
||||
* @param doesMatch - A predicate function that tests each entry.
|
||||
* @returns The value of the first entry that satisfies the predicate, or undefined if none found.
|
||||
*
|
||||
* @example
|
||||
* const map = new Map([
|
||||
* ['apple', { color: 'red', quantity: 10 }],
|
||||
* ['banana', { color: 'yellow', quantity: 5 }],
|
||||
* ['grape', { color: 'purple', quantity: 15 }]
|
||||
* ]);
|
||||
* const result = findValue(map, (value) => value.quantity > 10);
|
||||
* // result will be: { color: 'purple', quantity: 15 }
|
||||
*/
|
||||
declare function findValue<K, V>(map: Map<K, V>, doesMatch: (value: V, key: K, map: Map<K, V>) => boolean): V | undefined;
|
||||
//#endregion
|
||||
export { findValue };
|
||||
33
frontend/node_modules/es-toolkit/dist/map/findValue.js
generated
vendored
Normal file
33
frontend/node_modules/es-toolkit/dist/map/findValue.js
generated
vendored
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
//#region src/map/findValue.ts
|
||||
/**
|
||||
* Finds the first value in a Map for which the predicate function returns true.
|
||||
*
|
||||
* This function iterates through the entries of the Map and returns the value of the first
|
||||
* entry for which the predicate function returns true. If no entry satisfies the predicate,
|
||||
* it returns undefined.
|
||||
*
|
||||
* @template K - The type of keys in the Map.
|
||||
* @template V - The type of values in the Map.
|
||||
* @param map - The Map to search.
|
||||
* @param doesMatch - A predicate function that tests each entry.
|
||||
* @returns The value of the first entry that satisfies the predicate, or undefined if none found.
|
||||
*
|
||||
* @example
|
||||
* const map = new Map([
|
||||
* ['apple', { color: 'red', quantity: 10 }],
|
||||
* ['banana', { color: 'yellow', quantity: 5 }],
|
||||
* ['grape', { color: 'purple', quantity: 15 }]
|
||||
* ]);
|
||||
* const result = findValue(map, (value) => value.quantity > 10);
|
||||
* // result will be: { color: 'purple', quantity: 15 }
|
||||
*/
|
||||
function findValue(map, doesMatch) {
|
||||
let result = void 0;
|
||||
for (const [key, value] of map) if (doesMatch(value, key, map)) {
|
||||
result = value;
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
//#endregion
|
||||
exports.findValue = findValue;
|
||||
33
frontend/node_modules/es-toolkit/dist/map/findValue.mjs
generated
vendored
Normal file
33
frontend/node_modules/es-toolkit/dist/map/findValue.mjs
generated
vendored
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
//#region src/map/findValue.ts
|
||||
/**
|
||||
* Finds the first value in a Map for which the predicate function returns true.
|
||||
*
|
||||
* This function iterates through the entries of the Map and returns the value of the first
|
||||
* entry for which the predicate function returns true. If no entry satisfies the predicate,
|
||||
* it returns undefined.
|
||||
*
|
||||
* @template K - The type of keys in the Map.
|
||||
* @template V - The type of values in the Map.
|
||||
* @param map - The Map to search.
|
||||
* @param doesMatch - A predicate function that tests each entry.
|
||||
* @returns The value of the first entry that satisfies the predicate, or undefined if none found.
|
||||
*
|
||||
* @example
|
||||
* const map = new Map([
|
||||
* ['apple', { color: 'red', quantity: 10 }],
|
||||
* ['banana', { color: 'yellow', quantity: 5 }],
|
||||
* ['grape', { color: 'purple', quantity: 15 }]
|
||||
* ]);
|
||||
* const result = findValue(map, (value) => value.quantity > 10);
|
||||
* // result will be: { color: 'purple', quantity: 15 }
|
||||
*/
|
||||
function findValue(map, doesMatch) {
|
||||
let result = void 0;
|
||||
for (const [key, value] of map) if (doesMatch(value, key, map)) {
|
||||
result = value;
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
//#endregion
|
||||
export { findValue };
|
||||
29
frontend/node_modules/es-toolkit/dist/map/forEach.d.mts
generated
vendored
Normal file
29
frontend/node_modules/es-toolkit/dist/map/forEach.d.mts
generated
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
//#region src/map/forEach.d.ts
|
||||
/**
|
||||
* Executes a provided function once for each entry in a Map.
|
||||
*
|
||||
* This function iterates through all entries of the Map and executes the callback function
|
||||
* for each entry. The callback receives the value, key, and the Map itself as arguments.
|
||||
*
|
||||
* @template K - The type of keys in the Map.
|
||||
* @template V - The type of values in the Map.
|
||||
* @param map - The Map to iterate over.
|
||||
* @param callback - A function to execute for each entry.
|
||||
*
|
||||
* @example
|
||||
* const map = new Map([
|
||||
* ['a', 1],
|
||||
* ['b', 2],
|
||||
* ['c', 3]
|
||||
* ]);
|
||||
* forEach(map, (value, key) => {
|
||||
* console.log(`${key}: ${value}`);
|
||||
* });
|
||||
* // Output:
|
||||
* // a: 1
|
||||
* // b: 2
|
||||
* // c: 3
|
||||
*/
|
||||
declare function forEach<K, V>(map: Map<K, V>, callback: (value: V, key: K, map: Map<K, V>) => void): void;
|
||||
//#endregion
|
||||
export { forEach };
|
||||
29
frontend/node_modules/es-toolkit/dist/map/forEach.d.ts
generated
vendored
Normal file
29
frontend/node_modules/es-toolkit/dist/map/forEach.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
//#region src/map/forEach.d.ts
|
||||
/**
|
||||
* Executes a provided function once for each entry in a Map.
|
||||
*
|
||||
* This function iterates through all entries of the Map and executes the callback function
|
||||
* for each entry. The callback receives the value, key, and the Map itself as arguments.
|
||||
*
|
||||
* @template K - The type of keys in the Map.
|
||||
* @template V - The type of values in the Map.
|
||||
* @param map - The Map to iterate over.
|
||||
* @param callback - A function to execute for each entry.
|
||||
*
|
||||
* @example
|
||||
* const map = new Map([
|
||||
* ['a', 1],
|
||||
* ['b', 2],
|
||||
* ['c', 3]
|
||||
* ]);
|
||||
* forEach(map, (value, key) => {
|
||||
* console.log(`${key}: ${value}`);
|
||||
* });
|
||||
* // Output:
|
||||
* // a: 1
|
||||
* // b: 2
|
||||
* // c: 3
|
||||
*/
|
||||
declare function forEach<K, V>(map: Map<K, V>, callback: (value: V, key: K, map: Map<K, V>) => void): void;
|
||||
//#endregion
|
||||
export { forEach };
|
||||
31
frontend/node_modules/es-toolkit/dist/map/forEach.js
generated
vendored
Normal file
31
frontend/node_modules/es-toolkit/dist/map/forEach.js
generated
vendored
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
//#region src/map/forEach.ts
|
||||
/**
|
||||
* Executes a provided function once for each entry in a Map.
|
||||
*
|
||||
* This function iterates through all entries of the Map and executes the callback function
|
||||
* for each entry. The callback receives the value, key, and the Map itself as arguments.
|
||||
*
|
||||
* @template K - The type of keys in the Map.
|
||||
* @template V - The type of values in the Map.
|
||||
* @param map - The Map to iterate over.
|
||||
* @param callback - A function to execute for each entry.
|
||||
*
|
||||
* @example
|
||||
* const map = new Map([
|
||||
* ['a', 1],
|
||||
* ['b', 2],
|
||||
* ['c', 3]
|
||||
* ]);
|
||||
* forEach(map, (value, key) => {
|
||||
* console.log(`${key}: ${value}`);
|
||||
* });
|
||||
* // Output:
|
||||
* // a: 1
|
||||
* // b: 2
|
||||
* // c: 3
|
||||
*/
|
||||
function forEach(map, callback) {
|
||||
for (const [key, value] of map) callback(value, key, map);
|
||||
}
|
||||
//#endregion
|
||||
exports.forEach = forEach;
|
||||
31
frontend/node_modules/es-toolkit/dist/map/forEach.mjs
generated
vendored
Normal file
31
frontend/node_modules/es-toolkit/dist/map/forEach.mjs
generated
vendored
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
//#region src/map/forEach.ts
|
||||
/**
|
||||
* Executes a provided function once for each entry in a Map.
|
||||
*
|
||||
* This function iterates through all entries of the Map and executes the callback function
|
||||
* for each entry. The callback receives the value, key, and the Map itself as arguments.
|
||||
*
|
||||
* @template K - The type of keys in the Map.
|
||||
* @template V - The type of values in the Map.
|
||||
* @param map - The Map to iterate over.
|
||||
* @param callback - A function to execute for each entry.
|
||||
*
|
||||
* @example
|
||||
* const map = new Map([
|
||||
* ['a', 1],
|
||||
* ['b', 2],
|
||||
* ['c', 3]
|
||||
* ]);
|
||||
* forEach(map, (value, key) => {
|
||||
* console.log(`${key}: ${value}`);
|
||||
* });
|
||||
* // Output:
|
||||
* // a: 1
|
||||
* // b: 2
|
||||
* // c: 3
|
||||
*/
|
||||
function forEach(map, callback) {
|
||||
for (const [key, value] of map) callback(value, key, map);
|
||||
}
|
||||
//#endregion
|
||||
export { forEach };
|
||||
29
frontend/node_modules/es-toolkit/dist/map/hasValue.d.mts
generated
vendored
Normal file
29
frontend/node_modules/es-toolkit/dist/map/hasValue.d.mts
generated
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
//#region src/map/hasValue.d.ts
|
||||
/**
|
||||
* Checks if a Map contains a specific value.
|
||||
*
|
||||
* This function iterates through all values in the Map and checks if any value
|
||||
* is equal to the search element using SameValueZero comparison (similar to
|
||||
* Array.prototype.includes). This means that NaN is considered equal to NaN.
|
||||
*
|
||||
* @template K - The type of keys in the Map.
|
||||
* @template V - The type of values in the Map.
|
||||
* @param map - The Map to search.
|
||||
* @param searchElement - The value to search for.
|
||||
* @returns true if the Map contains the value, false otherwise.
|
||||
*
|
||||
* @example
|
||||
* const map = new Map([
|
||||
* ['a', 1],
|
||||
* ['b', 2],
|
||||
* ['c', 3]
|
||||
* ]);
|
||||
* const result = hasValue(map, 2);
|
||||
* // result will be: true
|
||||
*
|
||||
* const result2 = hasValue(map, 5);
|
||||
* // result2 will be: false
|
||||
*/
|
||||
declare function hasValue<K, V>(map: Map<K, V>, searchElement: V): boolean;
|
||||
//#endregion
|
||||
export { hasValue };
|
||||
29
frontend/node_modules/es-toolkit/dist/map/hasValue.d.ts
generated
vendored
Normal file
29
frontend/node_modules/es-toolkit/dist/map/hasValue.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
//#region src/map/hasValue.d.ts
|
||||
/**
|
||||
* Checks if a Map contains a specific value.
|
||||
*
|
||||
* This function iterates through all values in the Map and checks if any value
|
||||
* is equal to the search element using SameValueZero comparison (similar to
|
||||
* Array.prototype.includes). This means that NaN is considered equal to NaN.
|
||||
*
|
||||
* @template K - The type of keys in the Map.
|
||||
* @template V - The type of values in the Map.
|
||||
* @param map - The Map to search.
|
||||
* @param searchElement - The value to search for.
|
||||
* @returns true if the Map contains the value, false otherwise.
|
||||
*
|
||||
* @example
|
||||
* const map = new Map([
|
||||
* ['a', 1],
|
||||
* ['b', 2],
|
||||
* ['c', 3]
|
||||
* ]);
|
||||
* const result = hasValue(map, 2);
|
||||
* // result will be: true
|
||||
*
|
||||
* const result2 = hasValue(map, 5);
|
||||
* // result2 will be: false
|
||||
*/
|
||||
declare function hasValue<K, V>(map: Map<K, V>, searchElement: V): boolean;
|
||||
//#endregion
|
||||
export { hasValue };
|
||||
33
frontend/node_modules/es-toolkit/dist/map/hasValue.js
generated
vendored
Normal file
33
frontend/node_modules/es-toolkit/dist/map/hasValue.js
generated
vendored
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
const require_isEqualsSameValueZero = require("../_internal/isEqualsSameValueZero.js");
|
||||
//#region src/map/hasValue.ts
|
||||
/**
|
||||
* Checks if a Map contains a specific value.
|
||||
*
|
||||
* This function iterates through all values in the Map and checks if any value
|
||||
* is equal to the search element using SameValueZero comparison (similar to
|
||||
* Array.prototype.includes). This means that NaN is considered equal to NaN.
|
||||
*
|
||||
* @template K - The type of keys in the Map.
|
||||
* @template V - The type of values in the Map.
|
||||
* @param map - The Map to search.
|
||||
* @param searchElement - The value to search for.
|
||||
* @returns true if the Map contains the value, false otherwise.
|
||||
*
|
||||
* @example
|
||||
* const map = new Map([
|
||||
* ['a', 1],
|
||||
* ['b', 2],
|
||||
* ['c', 3]
|
||||
* ]);
|
||||
* const result = hasValue(map, 2);
|
||||
* // result will be: true
|
||||
*
|
||||
* const result2 = hasValue(map, 5);
|
||||
* // result2 will be: false
|
||||
*/
|
||||
function hasValue(map, searchElement) {
|
||||
for (const value of map.values()) if (require_isEqualsSameValueZero.isEqualsSameValueZero(value, searchElement)) return true;
|
||||
return false;
|
||||
}
|
||||
//#endregion
|
||||
exports.hasValue = hasValue;
|
||||
33
frontend/node_modules/es-toolkit/dist/map/hasValue.mjs
generated
vendored
Normal file
33
frontend/node_modules/es-toolkit/dist/map/hasValue.mjs
generated
vendored
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
import { isEqualsSameValueZero } from "../_internal/isEqualsSameValueZero.mjs";
|
||||
//#region src/map/hasValue.ts
|
||||
/**
|
||||
* Checks if a Map contains a specific value.
|
||||
*
|
||||
* This function iterates through all values in the Map and checks if any value
|
||||
* is equal to the search element using SameValueZero comparison (similar to
|
||||
* Array.prototype.includes). This means that NaN is considered equal to NaN.
|
||||
*
|
||||
* @template K - The type of keys in the Map.
|
||||
* @template V - The type of values in the Map.
|
||||
* @param map - The Map to search.
|
||||
* @param searchElement - The value to search for.
|
||||
* @returns true if the Map contains the value, false otherwise.
|
||||
*
|
||||
* @example
|
||||
* const map = new Map([
|
||||
* ['a', 1],
|
||||
* ['b', 2],
|
||||
* ['c', 3]
|
||||
* ]);
|
||||
* const result = hasValue(map, 2);
|
||||
* // result will be: true
|
||||
*
|
||||
* const result2 = hasValue(map, 5);
|
||||
* // result2 will be: false
|
||||
*/
|
||||
function hasValue(map, searchElement) {
|
||||
for (const value of map.values()) if (isEqualsSameValueZero(value, searchElement)) return true;
|
||||
return false;
|
||||
}
|
||||
//#endregion
|
||||
export { hasValue };
|
||||
13
frontend/node_modules/es-toolkit/dist/map/index.d.mts
generated
vendored
Normal file
13
frontend/node_modules/es-toolkit/dist/map/index.d.mts
generated
vendored
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
import { countBy } from "./countBy.mjs";
|
||||
import { every } from "./every.mjs";
|
||||
import { filter } from "./filter.mjs";
|
||||
import { findKey } from "./findKey.mjs";
|
||||
import { findValue } from "./findValue.mjs";
|
||||
import { forEach } from "./forEach.mjs";
|
||||
import { hasValue } from "./hasValue.mjs";
|
||||
import { keyBy } from "./keyBy.mjs";
|
||||
import { mapKeys } from "./mapKeys.mjs";
|
||||
import { mapValues } from "./mapValues.mjs";
|
||||
import { reduce } from "./reduce.mjs";
|
||||
import { some } from "./some.mjs";
|
||||
export { countBy, every, filter, findKey, findValue, forEach, hasValue, keyBy, mapKeys, mapValues, reduce, some };
|
||||
13
frontend/node_modules/es-toolkit/dist/map/index.d.ts
generated
vendored
Normal file
13
frontend/node_modules/es-toolkit/dist/map/index.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
import { countBy } from "./countBy.js";
|
||||
import { every } from "./every.js";
|
||||
import { filter } from "./filter.js";
|
||||
import { findKey } from "./findKey.js";
|
||||
import { findValue } from "./findValue.js";
|
||||
import { forEach } from "./forEach.js";
|
||||
import { hasValue } from "./hasValue.js";
|
||||
import { keyBy } from "./keyBy.js";
|
||||
import { mapKeys } from "./mapKeys.js";
|
||||
import { mapValues } from "./mapValues.js";
|
||||
import { reduce } from "./reduce.js";
|
||||
import { some } from "./some.js";
|
||||
export { countBy, every, filter, findKey, findValue, forEach, hasValue, keyBy, mapKeys, mapValues, reduce, some };
|
||||
25
frontend/node_modules/es-toolkit/dist/map/index.js
generated
vendored
Normal file
25
frontend/node_modules/es-toolkit/dist/map/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
||||
const require_countBy = require("./countBy.js");
|
||||
const require_every = require("./every.js");
|
||||
const require_filter = require("./filter.js");
|
||||
const require_findKey = require("./findKey.js");
|
||||
const require_findValue = require("./findValue.js");
|
||||
const require_forEach = require("./forEach.js");
|
||||
const require_hasValue = require("./hasValue.js");
|
||||
const require_keyBy = require("./keyBy.js");
|
||||
const require_mapKeys = require("./mapKeys.js");
|
||||
const require_mapValues = require("./mapValues.js");
|
||||
const require_reduce = require("./reduce.js");
|
||||
const require_some = require("./some.js");
|
||||
exports.countBy = require_countBy.countBy;
|
||||
exports.every = require_every.every;
|
||||
exports.filter = require_filter.filter;
|
||||
exports.findKey = require_findKey.findKey;
|
||||
exports.findValue = require_findValue.findValue;
|
||||
exports.forEach = require_forEach.forEach;
|
||||
exports.hasValue = require_hasValue.hasValue;
|
||||
exports.keyBy = require_keyBy.keyBy;
|
||||
exports.mapKeys = require_mapKeys.mapKeys;
|
||||
exports.mapValues = require_mapValues.mapValues;
|
||||
exports.reduce = require_reduce.reduce;
|
||||
exports.some = require_some.some;
|
||||
13
frontend/node_modules/es-toolkit/dist/map/index.mjs
generated
vendored
Normal file
13
frontend/node_modules/es-toolkit/dist/map/index.mjs
generated
vendored
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
import { countBy } from "./countBy.mjs";
|
||||
import { every } from "./every.mjs";
|
||||
import { filter } from "./filter.mjs";
|
||||
import { findKey } from "./findKey.mjs";
|
||||
import { findValue } from "./findValue.mjs";
|
||||
import { forEach } from "./forEach.mjs";
|
||||
import { hasValue } from "./hasValue.mjs";
|
||||
import { keyBy } from "./keyBy.mjs";
|
||||
import { mapKeys } from "./mapKeys.mjs";
|
||||
import { mapValues } from "./mapValues.mjs";
|
||||
import { reduce } from "./reduce.mjs";
|
||||
import { some } from "./some.mjs";
|
||||
export { countBy, every, filter, findKey, findValue, forEach, hasValue, keyBy, mapKeys, mapValues, reduce, some };
|
||||
32
frontend/node_modules/es-toolkit/dist/map/keyBy.d.mts
generated
vendored
Normal file
32
frontend/node_modules/es-toolkit/dist/map/keyBy.d.mts
generated
vendored
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
//#region src/map/keyBy.d.ts
|
||||
/**
|
||||
* Maps each entry of a Map based on a provided key-generating function.
|
||||
*
|
||||
* This function takes a Map and a function that generates a key from each value-key pair.
|
||||
* It returns a new Map where the keys are generated by the key function and the values are
|
||||
* the corresponding values from the original map. If multiple entries produce the same key,
|
||||
* the last value encountered will be used.
|
||||
*
|
||||
* @template K - The type of keys in the original Map.
|
||||
* @template V - The type of values in the original Map.
|
||||
* @template K2 - The type of keys to produce in the returned Map.
|
||||
* @param map - The map of entries to be mapped.
|
||||
* @param getKeyFromEntry - A function that generates a key from a value-key pair.
|
||||
* @returns A Map where the generated keys are mapped to each entry's value.
|
||||
*
|
||||
* @example
|
||||
* const map = new Map([
|
||||
* ['x', { type: 'fruit', name: 'apple' }],
|
||||
* ['y', { type: 'fruit', name: 'banana' }],
|
||||
* ['z', { type: 'vegetable', name: 'carrot' }]
|
||||
* ]);
|
||||
* const result = keyBy(map, item => item.type);
|
||||
* // result will be:
|
||||
* // Map(2) {
|
||||
* // 'fruit' => { type: 'fruit', name: 'banana' },
|
||||
* // 'vegetable' => { type: 'vegetable', name: 'carrot' }
|
||||
* // }
|
||||
*/
|
||||
declare function keyBy<K, V, K2>(map: Map<K, V>, getKeyFromEntry: (value: V, key: K, object: Map<K, V>) => K2): Map<K2, V>;
|
||||
//#endregion
|
||||
export { keyBy };
|
||||
32
frontend/node_modules/es-toolkit/dist/map/keyBy.d.ts
generated
vendored
Normal file
32
frontend/node_modules/es-toolkit/dist/map/keyBy.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
//#region src/map/keyBy.d.ts
|
||||
/**
|
||||
* Maps each entry of a Map based on a provided key-generating function.
|
||||
*
|
||||
* This function takes a Map and a function that generates a key from each value-key pair.
|
||||
* It returns a new Map where the keys are generated by the key function and the values are
|
||||
* the corresponding values from the original map. If multiple entries produce the same key,
|
||||
* the last value encountered will be used.
|
||||
*
|
||||
* @template K - The type of keys in the original Map.
|
||||
* @template V - The type of values in the original Map.
|
||||
* @template K2 - The type of keys to produce in the returned Map.
|
||||
* @param map - The map of entries to be mapped.
|
||||
* @param getKeyFromEntry - A function that generates a key from a value-key pair.
|
||||
* @returns A Map where the generated keys are mapped to each entry's value.
|
||||
*
|
||||
* @example
|
||||
* const map = new Map([
|
||||
* ['x', { type: 'fruit', name: 'apple' }],
|
||||
* ['y', { type: 'fruit', name: 'banana' }],
|
||||
* ['z', { type: 'vegetable', name: 'carrot' }]
|
||||
* ]);
|
||||
* const result = keyBy(map, item => item.type);
|
||||
* // result will be:
|
||||
* // Map(2) {
|
||||
* // 'fruit' => { type: 'fruit', name: 'banana' },
|
||||
* // 'vegetable' => { type: 'vegetable', name: 'carrot' }
|
||||
* // }
|
||||
*/
|
||||
declare function keyBy<K, V, K2>(map: Map<K, V>, getKeyFromEntry: (value: V, key: K, object: Map<K, V>) => K2): Map<K2, V>;
|
||||
//#endregion
|
||||
export { keyBy };
|
||||
39
frontend/node_modules/es-toolkit/dist/map/keyBy.js
generated
vendored
Normal file
39
frontend/node_modules/es-toolkit/dist/map/keyBy.js
generated
vendored
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
//#region src/map/keyBy.ts
|
||||
/**
|
||||
* Maps each entry of a Map based on a provided key-generating function.
|
||||
*
|
||||
* This function takes a Map and a function that generates a key from each value-key pair.
|
||||
* It returns a new Map where the keys are generated by the key function and the values are
|
||||
* the corresponding values from the original map. If multiple entries produce the same key,
|
||||
* the last value encountered will be used.
|
||||
*
|
||||
* @template K - The type of keys in the original Map.
|
||||
* @template V - The type of values in the original Map.
|
||||
* @template K2 - The type of keys to produce in the returned Map.
|
||||
* @param map - The map of entries to be mapped.
|
||||
* @param getKeyFromEntry - A function that generates a key from a value-key pair.
|
||||
* @returns A Map where the generated keys are mapped to each entry's value.
|
||||
*
|
||||
* @example
|
||||
* const map = new Map([
|
||||
* ['x', { type: 'fruit', name: 'apple' }],
|
||||
* ['y', { type: 'fruit', name: 'banana' }],
|
||||
* ['z', { type: 'vegetable', name: 'carrot' }]
|
||||
* ]);
|
||||
* const result = keyBy(map, item => item.type);
|
||||
* // result will be:
|
||||
* // Map(2) {
|
||||
* // 'fruit' => { type: 'fruit', name: 'banana' },
|
||||
* // 'vegetable' => { type: 'vegetable', name: 'carrot' }
|
||||
* // }
|
||||
*/
|
||||
function keyBy(map, getKeyFromEntry) {
|
||||
const result = /* @__PURE__ */ new Map();
|
||||
for (const [key, value] of map) {
|
||||
const newKey = getKeyFromEntry(value, key, map);
|
||||
result.set(newKey, value);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
//#endregion
|
||||
exports.keyBy = keyBy;
|
||||
39
frontend/node_modules/es-toolkit/dist/map/keyBy.mjs
generated
vendored
Normal file
39
frontend/node_modules/es-toolkit/dist/map/keyBy.mjs
generated
vendored
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
//#region src/map/keyBy.ts
|
||||
/**
|
||||
* Maps each entry of a Map based on a provided key-generating function.
|
||||
*
|
||||
* This function takes a Map and a function that generates a key from each value-key pair.
|
||||
* It returns a new Map where the keys are generated by the key function and the values are
|
||||
* the corresponding values from the original map. If multiple entries produce the same key,
|
||||
* the last value encountered will be used.
|
||||
*
|
||||
* @template K - The type of keys in the original Map.
|
||||
* @template V - The type of values in the original Map.
|
||||
* @template K2 - The type of keys to produce in the returned Map.
|
||||
* @param map - The map of entries to be mapped.
|
||||
* @param getKeyFromEntry - A function that generates a key from a value-key pair.
|
||||
* @returns A Map where the generated keys are mapped to each entry's value.
|
||||
*
|
||||
* @example
|
||||
* const map = new Map([
|
||||
* ['x', { type: 'fruit', name: 'apple' }],
|
||||
* ['y', { type: 'fruit', name: 'banana' }],
|
||||
* ['z', { type: 'vegetable', name: 'carrot' }]
|
||||
* ]);
|
||||
* const result = keyBy(map, item => item.type);
|
||||
* // result will be:
|
||||
* // Map(2) {
|
||||
* // 'fruit' => { type: 'fruit', name: 'banana' },
|
||||
* // 'vegetable' => { type: 'vegetable', name: 'carrot' }
|
||||
* // }
|
||||
*/
|
||||
function keyBy(map, getKeyFromEntry) {
|
||||
const result = /* @__PURE__ */ new Map();
|
||||
for (const [key, value] of map) {
|
||||
const newKey = getKeyFromEntry(value, key, map);
|
||||
result.set(newKey, value);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
//#endregion
|
||||
export { keyBy };
|
||||
31
frontend/node_modules/es-toolkit/dist/map/mapKeys.d.mts
generated
vendored
Normal file
31
frontend/node_modules/es-toolkit/dist/map/mapKeys.d.mts
generated
vendored
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
//#region src/map/mapKeys.d.ts
|
||||
/**
|
||||
* Creates a new Map with the same values but with keys transformed by the provided function.
|
||||
*
|
||||
* This function takes a Map and a function that generates a new key from each value-key pair.
|
||||
* It returns a new Map where the keys are the result of applying the function to each entry,
|
||||
* while the values remain the same.
|
||||
*
|
||||
* @template K - The type of keys in the Map.
|
||||
* @template V - The type of values in the Map.
|
||||
* @param map - The Map to transform.
|
||||
* @param getNewKey - A function that generates a new key from a value-key pair.
|
||||
* @returns A new Map with transformed keys and the same values.
|
||||
*
|
||||
* @example
|
||||
* const map = new Map([
|
||||
* ['a', 1],
|
||||
* ['b', 2],
|
||||
* ['c', 3]
|
||||
* ]);
|
||||
* const result = mapKeys(map, (value, key) => key.toUpperCase());
|
||||
* // result will be:
|
||||
* // Map(3) {
|
||||
* // 'A' => 1,
|
||||
* // 'B' => 2,
|
||||
* // 'C' => 3
|
||||
* // }
|
||||
*/
|
||||
declare function mapKeys<K, V>(map: Map<K, V>, getNewKey: (value: V, key: K, object: Map<K, V>) => K): Map<K, V>;
|
||||
//#endregion
|
||||
export { mapKeys };
|
||||
31
frontend/node_modules/es-toolkit/dist/map/mapKeys.d.ts
generated
vendored
Normal file
31
frontend/node_modules/es-toolkit/dist/map/mapKeys.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
//#region src/map/mapKeys.d.ts
|
||||
/**
|
||||
* Creates a new Map with the same values but with keys transformed by the provided function.
|
||||
*
|
||||
* This function takes a Map and a function that generates a new key from each value-key pair.
|
||||
* It returns a new Map where the keys are the result of applying the function to each entry,
|
||||
* while the values remain the same.
|
||||
*
|
||||
* @template K - The type of keys in the Map.
|
||||
* @template V - The type of values in the Map.
|
||||
* @param map - The Map to transform.
|
||||
* @param getNewKey - A function that generates a new key from a value-key pair.
|
||||
* @returns A new Map with transformed keys and the same values.
|
||||
*
|
||||
* @example
|
||||
* const map = new Map([
|
||||
* ['a', 1],
|
||||
* ['b', 2],
|
||||
* ['c', 3]
|
||||
* ]);
|
||||
* const result = mapKeys(map, (value, key) => key.toUpperCase());
|
||||
* // result will be:
|
||||
* // Map(3) {
|
||||
* // 'A' => 1,
|
||||
* // 'B' => 2,
|
||||
* // 'C' => 3
|
||||
* // }
|
||||
*/
|
||||
declare function mapKeys<K, V>(map: Map<K, V>, getNewKey: (value: V, key: K, object: Map<K, V>) => K): Map<K, V>;
|
||||
//#endregion
|
||||
export { mapKeys };
|
||||
38
frontend/node_modules/es-toolkit/dist/map/mapKeys.js
generated
vendored
Normal file
38
frontend/node_modules/es-toolkit/dist/map/mapKeys.js
generated
vendored
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
//#region src/map/mapKeys.ts
|
||||
/**
|
||||
* Creates a new Map with the same values but with keys transformed by the provided function.
|
||||
*
|
||||
* This function takes a Map and a function that generates a new key from each value-key pair.
|
||||
* It returns a new Map where the keys are the result of applying the function to each entry,
|
||||
* while the values remain the same.
|
||||
*
|
||||
* @template K - The type of keys in the Map.
|
||||
* @template V - The type of values in the Map.
|
||||
* @param map - The Map to transform.
|
||||
* @param getNewKey - A function that generates a new key from a value-key pair.
|
||||
* @returns A new Map with transformed keys and the same values.
|
||||
*
|
||||
* @example
|
||||
* const map = new Map([
|
||||
* ['a', 1],
|
||||
* ['b', 2],
|
||||
* ['c', 3]
|
||||
* ]);
|
||||
* const result = mapKeys(map, (value, key) => key.toUpperCase());
|
||||
* // result will be:
|
||||
* // Map(3) {
|
||||
* // 'A' => 1,
|
||||
* // 'B' => 2,
|
||||
* // 'C' => 3
|
||||
* // }
|
||||
*/
|
||||
function mapKeys(map, getNewKey) {
|
||||
const result = /* @__PURE__ */ new Map();
|
||||
for (const [key, value] of map) {
|
||||
const newKey = getNewKey(value, key, map);
|
||||
result.set(newKey, value);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
//#endregion
|
||||
exports.mapKeys = mapKeys;
|
||||
38
frontend/node_modules/es-toolkit/dist/map/mapKeys.mjs
generated
vendored
Normal file
38
frontend/node_modules/es-toolkit/dist/map/mapKeys.mjs
generated
vendored
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
//#region src/map/mapKeys.ts
|
||||
/**
|
||||
* Creates a new Map with the same values but with keys transformed by the provided function.
|
||||
*
|
||||
* This function takes a Map and a function that generates a new key from each value-key pair.
|
||||
* It returns a new Map where the keys are the result of applying the function to each entry,
|
||||
* while the values remain the same.
|
||||
*
|
||||
* @template K - The type of keys in the Map.
|
||||
* @template V - The type of values in the Map.
|
||||
* @param map - The Map to transform.
|
||||
* @param getNewKey - A function that generates a new key from a value-key pair.
|
||||
* @returns A new Map with transformed keys and the same values.
|
||||
*
|
||||
* @example
|
||||
* const map = new Map([
|
||||
* ['a', 1],
|
||||
* ['b', 2],
|
||||
* ['c', 3]
|
||||
* ]);
|
||||
* const result = mapKeys(map, (value, key) => key.toUpperCase());
|
||||
* // result will be:
|
||||
* // Map(3) {
|
||||
* // 'A' => 1,
|
||||
* // 'B' => 2,
|
||||
* // 'C' => 3
|
||||
* // }
|
||||
*/
|
||||
function mapKeys(map, getNewKey) {
|
||||
const result = /* @__PURE__ */ new Map();
|
||||
for (const [key, value] of map) {
|
||||
const newKey = getNewKey(value, key, map);
|
||||
result.set(newKey, value);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
//#endregion
|
||||
export { mapKeys };
|
||||
31
frontend/node_modules/es-toolkit/dist/map/mapValues.d.mts
generated
vendored
Normal file
31
frontend/node_modules/es-toolkit/dist/map/mapValues.d.mts
generated
vendored
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
//#region src/map/mapValues.d.ts
|
||||
/**
|
||||
* Creates a new Map with the same keys but with values transformed by the provided function.
|
||||
*
|
||||
* This function takes a Map and a function that generates a new value from each value-key pair.
|
||||
* It returns a new Map where the values are the result of applying the function to each entry,
|
||||
* while the keys remain the same.
|
||||
*
|
||||
* @template K - The type of keys in the Map.
|
||||
* @template V - The type of values in the Map.
|
||||
* @param map - The Map to transform.
|
||||
* @param getNewValue - A function that generates a new value from a value-key pair.
|
||||
* @returns A new Map with the same keys and transformed values.
|
||||
*
|
||||
* @example
|
||||
* const map = new Map([
|
||||
* ['a', 1],
|
||||
* ['b', 2],
|
||||
* ['c', 3]
|
||||
* ]);
|
||||
* const result = mapValues(map, (value) => value * 2);
|
||||
* // result will be:
|
||||
* // Map(3) {
|
||||
* // 'a' => 2,
|
||||
* // 'b' => 4,
|
||||
* // 'c' => 6
|
||||
* // }
|
||||
*/
|
||||
declare function mapValues<K, V, R>(map: Map<K, V>, getNewValue: (value: V, key: K, object: Map<K, V>) => R): Map<K, R>;
|
||||
//#endregion
|
||||
export { mapValues };
|
||||
31
frontend/node_modules/es-toolkit/dist/map/mapValues.d.ts
generated
vendored
Normal file
31
frontend/node_modules/es-toolkit/dist/map/mapValues.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
//#region src/map/mapValues.d.ts
|
||||
/**
|
||||
* Creates a new Map with the same keys but with values transformed by the provided function.
|
||||
*
|
||||
* This function takes a Map and a function that generates a new value from each value-key pair.
|
||||
* It returns a new Map where the values are the result of applying the function to each entry,
|
||||
* while the keys remain the same.
|
||||
*
|
||||
* @template K - The type of keys in the Map.
|
||||
* @template V - The type of values in the Map.
|
||||
* @param map - The Map to transform.
|
||||
* @param getNewValue - A function that generates a new value from a value-key pair.
|
||||
* @returns A new Map with the same keys and transformed values.
|
||||
*
|
||||
* @example
|
||||
* const map = new Map([
|
||||
* ['a', 1],
|
||||
* ['b', 2],
|
||||
* ['c', 3]
|
||||
* ]);
|
||||
* const result = mapValues(map, (value) => value * 2);
|
||||
* // result will be:
|
||||
* // Map(3) {
|
||||
* // 'a' => 2,
|
||||
* // 'b' => 4,
|
||||
* // 'c' => 6
|
||||
* // }
|
||||
*/
|
||||
declare function mapValues<K, V, R>(map: Map<K, V>, getNewValue: (value: V, key: K, object: Map<K, V>) => R): Map<K, R>;
|
||||
//#endregion
|
||||
export { mapValues };
|
||||
38
frontend/node_modules/es-toolkit/dist/map/mapValues.js
generated
vendored
Normal file
38
frontend/node_modules/es-toolkit/dist/map/mapValues.js
generated
vendored
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
//#region src/map/mapValues.ts
|
||||
/**
|
||||
* Creates a new Map with the same keys but with values transformed by the provided function.
|
||||
*
|
||||
* This function takes a Map and a function that generates a new value from each value-key pair.
|
||||
* It returns a new Map where the values are the result of applying the function to each entry,
|
||||
* while the keys remain the same.
|
||||
*
|
||||
* @template K - The type of keys in the Map.
|
||||
* @template V - The type of values in the Map.
|
||||
* @param map - The Map to transform.
|
||||
* @param getNewValue - A function that generates a new value from a value-key pair.
|
||||
* @returns A new Map with the same keys and transformed values.
|
||||
*
|
||||
* @example
|
||||
* const map = new Map([
|
||||
* ['a', 1],
|
||||
* ['b', 2],
|
||||
* ['c', 3]
|
||||
* ]);
|
||||
* const result = mapValues(map, (value) => value * 2);
|
||||
* // result will be:
|
||||
* // Map(3) {
|
||||
* // 'a' => 2,
|
||||
* // 'b' => 4,
|
||||
* // 'c' => 6
|
||||
* // }
|
||||
*/
|
||||
function mapValues(map, getNewValue) {
|
||||
const result = /* @__PURE__ */ new Map();
|
||||
for (const [key, value] of map) {
|
||||
const newValue = getNewValue(value, key, map);
|
||||
result.set(key, newValue);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
//#endregion
|
||||
exports.mapValues = mapValues;
|
||||
38
frontend/node_modules/es-toolkit/dist/map/mapValues.mjs
generated
vendored
Normal file
38
frontend/node_modules/es-toolkit/dist/map/mapValues.mjs
generated
vendored
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
//#region src/map/mapValues.ts
|
||||
/**
|
||||
* Creates a new Map with the same keys but with values transformed by the provided function.
|
||||
*
|
||||
* This function takes a Map and a function that generates a new value from each value-key pair.
|
||||
* It returns a new Map where the values are the result of applying the function to each entry,
|
||||
* while the keys remain the same.
|
||||
*
|
||||
* @template K - The type of keys in the Map.
|
||||
* @template V - The type of values in the Map.
|
||||
* @param map - The Map to transform.
|
||||
* @param getNewValue - A function that generates a new value from a value-key pair.
|
||||
* @returns A new Map with the same keys and transformed values.
|
||||
*
|
||||
* @example
|
||||
* const map = new Map([
|
||||
* ['a', 1],
|
||||
* ['b', 2],
|
||||
* ['c', 3]
|
||||
* ]);
|
||||
* const result = mapValues(map, (value) => value * 2);
|
||||
* // result will be:
|
||||
* // Map(3) {
|
||||
* // 'a' => 2,
|
||||
* // 'b' => 4,
|
||||
* // 'c' => 6
|
||||
* // }
|
||||
*/
|
||||
function mapValues(map, getNewValue) {
|
||||
const result = /* @__PURE__ */ new Map();
|
||||
for (const [key, value] of map) {
|
||||
const newValue = getNewValue(value, key, map);
|
||||
result.set(key, newValue);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
//#endregion
|
||||
export { mapValues };
|
||||
36
frontend/node_modules/es-toolkit/dist/map/reduce.d.mts
generated
vendored
Normal file
36
frontend/node_modules/es-toolkit/dist/map/reduce.d.mts
generated
vendored
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
//#region src/map/reduce.d.ts
|
||||
/**
|
||||
* Reduces a Map to a single value by iterating through its entries and applying a callback function.
|
||||
*
|
||||
* This function iterates through all entries of the Map and applies the callback function to each entry,
|
||||
* accumulating the result. If an initial value is provided, it is used as the starting accumulator value.
|
||||
* If no initial value is provided and the Map is empty, a TypeError is thrown.
|
||||
*
|
||||
* @template K - The type of keys in the Map.
|
||||
* @template V - The type of values in the Map.
|
||||
* @param map - The Map to reduce.
|
||||
* @param callback - A function that processes each entry and updates the accumulator.
|
||||
* @param [initialValue] - The initial value for the accumulator. If not provided, the first value in the Map is used.
|
||||
* @returns The final accumulated value.
|
||||
* @throws {TypeError} If the Map is empty and no initial value is provided.
|
||||
*
|
||||
* @example
|
||||
* const map = new Map([
|
||||
* ['a', 1],
|
||||
* ['b', 2],
|
||||
* ['c', 3]
|
||||
* ]);
|
||||
* const result = reduce(map, (acc, value) => acc + value, 0);
|
||||
* // result will be: 6
|
||||
*
|
||||
* @example
|
||||
* const map = new Map([
|
||||
* ['a', 10],
|
||||
* ['b', 20]
|
||||
* ]);
|
||||
* const result = reduce(map, (acc, value) => acc + value);
|
||||
* // result will be: 30 (starts with first value 10)
|
||||
*/
|
||||
declare function reduce<K, V, A = V>(map: Map<K, V>, callback: (accumulator: A, value: V, key: K, map: Map<K, V>) => A, initialValue?: A): A;
|
||||
//#endregion
|
||||
export { reduce };
|
||||
36
frontend/node_modules/es-toolkit/dist/map/reduce.d.ts
generated
vendored
Normal file
36
frontend/node_modules/es-toolkit/dist/map/reduce.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
//#region src/map/reduce.d.ts
|
||||
/**
|
||||
* Reduces a Map to a single value by iterating through its entries and applying a callback function.
|
||||
*
|
||||
* This function iterates through all entries of the Map and applies the callback function to each entry,
|
||||
* accumulating the result. If an initial value is provided, it is used as the starting accumulator value.
|
||||
* If no initial value is provided and the Map is empty, a TypeError is thrown.
|
||||
*
|
||||
* @template K - The type of keys in the Map.
|
||||
* @template V - The type of values in the Map.
|
||||
* @param map - The Map to reduce.
|
||||
* @param callback - A function that processes each entry and updates the accumulator.
|
||||
* @param [initialValue] - The initial value for the accumulator. If not provided, the first value in the Map is used.
|
||||
* @returns The final accumulated value.
|
||||
* @throws {TypeError} If the Map is empty and no initial value is provided.
|
||||
*
|
||||
* @example
|
||||
* const map = new Map([
|
||||
* ['a', 1],
|
||||
* ['b', 2],
|
||||
* ['c', 3]
|
||||
* ]);
|
||||
* const result = reduce(map, (acc, value) => acc + value, 0);
|
||||
* // result will be: 6
|
||||
*
|
||||
* @example
|
||||
* const map = new Map([
|
||||
* ['a', 10],
|
||||
* ['b', 20]
|
||||
* ]);
|
||||
* const result = reduce(map, (acc, value) => acc + value);
|
||||
* // result will be: 30 (starts with first value 10)
|
||||
*/
|
||||
declare function reduce<K, V, A = V>(map: Map<K, V>, callback: (accumulator: A, value: V, key: K, map: Map<K, V>) => A, initialValue?: A): A;
|
||||
//#endregion
|
||||
export { reduce };
|
||||
42
frontend/node_modules/es-toolkit/dist/map/reduce.js
generated
vendored
Normal file
42
frontend/node_modules/es-toolkit/dist/map/reduce.js
generated
vendored
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
//#region src/map/reduce.ts
|
||||
/**
|
||||
* Reduces a Map to a single value by iterating through its entries and applying a callback function.
|
||||
*
|
||||
* This function iterates through all entries of the Map and applies the callback function to each entry,
|
||||
* accumulating the result. If an initial value is provided, it is used as the starting accumulator value.
|
||||
* If no initial value is provided and the Map is empty, a TypeError is thrown.
|
||||
*
|
||||
* @template K - The type of keys in the Map.
|
||||
* @template V - The type of values in the Map.
|
||||
* @param map - The Map to reduce.
|
||||
* @param callback - A function that processes each entry and updates the accumulator.
|
||||
* @param [initialValue] - The initial value for the accumulator. If not provided, the first value in the Map is used.
|
||||
* @returns The final accumulated value.
|
||||
* @throws {TypeError} If the Map is empty and no initial value is provided.
|
||||
*
|
||||
* @example
|
||||
* const map = new Map([
|
||||
* ['a', 1],
|
||||
* ['b', 2],
|
||||
* ['c', 3]
|
||||
* ]);
|
||||
* const result = reduce(map, (acc, value) => acc + value, 0);
|
||||
* // result will be: 6
|
||||
*
|
||||
* @example
|
||||
* const map = new Map([
|
||||
* ['a', 10],
|
||||
* ['b', 20]
|
||||
* ]);
|
||||
* const result = reduce(map, (acc, value) => acc + value);
|
||||
* // result will be: 30 (starts with first value 10)
|
||||
*/
|
||||
function reduce(map, callback, initialValue) {
|
||||
if (initialValue == null && map.size === 0) throw new TypeError("Reduce of empty map with no initial value");
|
||||
let accumulator = initialValue;
|
||||
for (const [key, value] of map) if (accumulator == null) accumulator = value;
|
||||
else accumulator = callback(accumulator, value, key, map);
|
||||
return accumulator;
|
||||
}
|
||||
//#endregion
|
||||
exports.reduce = reduce;
|
||||
42
frontend/node_modules/es-toolkit/dist/map/reduce.mjs
generated
vendored
Normal file
42
frontend/node_modules/es-toolkit/dist/map/reduce.mjs
generated
vendored
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
//#region src/map/reduce.ts
|
||||
/**
|
||||
* Reduces a Map to a single value by iterating through its entries and applying a callback function.
|
||||
*
|
||||
* This function iterates through all entries of the Map and applies the callback function to each entry,
|
||||
* accumulating the result. If an initial value is provided, it is used as the starting accumulator value.
|
||||
* If no initial value is provided and the Map is empty, a TypeError is thrown.
|
||||
*
|
||||
* @template K - The type of keys in the Map.
|
||||
* @template V - The type of values in the Map.
|
||||
* @param map - The Map to reduce.
|
||||
* @param callback - A function that processes each entry and updates the accumulator.
|
||||
* @param [initialValue] - The initial value for the accumulator. If not provided, the first value in the Map is used.
|
||||
* @returns The final accumulated value.
|
||||
* @throws {TypeError} If the Map is empty and no initial value is provided.
|
||||
*
|
||||
* @example
|
||||
* const map = new Map([
|
||||
* ['a', 1],
|
||||
* ['b', 2],
|
||||
* ['c', 3]
|
||||
* ]);
|
||||
* const result = reduce(map, (acc, value) => acc + value, 0);
|
||||
* // result will be: 6
|
||||
*
|
||||
* @example
|
||||
* const map = new Map([
|
||||
* ['a', 10],
|
||||
* ['b', 20]
|
||||
* ]);
|
||||
* const result = reduce(map, (acc, value) => acc + value);
|
||||
* // result will be: 30 (starts with first value 10)
|
||||
*/
|
||||
function reduce(map, callback, initialValue) {
|
||||
if (initialValue == null && map.size === 0) throw new TypeError("Reduce of empty map with no initial value");
|
||||
let accumulator = initialValue;
|
||||
for (const [key, value] of map) if (accumulator == null) accumulator = value;
|
||||
else accumulator = callback(accumulator, value, key, map);
|
||||
return accumulator;
|
||||
}
|
||||
//#endregion
|
||||
export { reduce };
|
||||
29
frontend/node_modules/es-toolkit/dist/map/some.d.mts
generated
vendored
Normal file
29
frontend/node_modules/es-toolkit/dist/map/some.d.mts
generated
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
//#region src/map/some.d.ts
|
||||
/**
|
||||
* Tests whether at least one entry in a Map satisfies the provided predicate function.
|
||||
*
|
||||
* This function iterates through the entries of the Map and checks if the predicate function
|
||||
* returns true for at least one entry. It returns true if any entry satisfies the predicate,
|
||||
* and false otherwise.
|
||||
*
|
||||
* @template K - The type of keys in the Map.
|
||||
* @template V - The type of values in the Map.
|
||||
* @param map - The Map to test.
|
||||
* @param doesMatch - A predicate function that tests each entry.
|
||||
* @returns true if at least one entry satisfies the predicate, false otherwise.
|
||||
*
|
||||
* @example
|
||||
* const map = new Map([
|
||||
* ['a', 1],
|
||||
* ['b', 2],
|
||||
* ['c', 3]
|
||||
* ]);
|
||||
* const result = some(map, (value) => value > 2);
|
||||
* // result will be: true
|
||||
*
|
||||
* const result2 = some(map, (value) => value > 5);
|
||||
* // result2 will be: false
|
||||
*/
|
||||
declare function some<K, V>(map: Map<K, V>, doesMatch: (value: V, key: K, map: Map<K, V>) => boolean): boolean;
|
||||
//#endregion
|
||||
export { some };
|
||||
29
frontend/node_modules/es-toolkit/dist/map/some.d.ts
generated
vendored
Normal file
29
frontend/node_modules/es-toolkit/dist/map/some.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
//#region src/map/some.d.ts
|
||||
/**
|
||||
* Tests whether at least one entry in a Map satisfies the provided predicate function.
|
||||
*
|
||||
* This function iterates through the entries of the Map and checks if the predicate function
|
||||
* returns true for at least one entry. It returns true if any entry satisfies the predicate,
|
||||
* and false otherwise.
|
||||
*
|
||||
* @template K - The type of keys in the Map.
|
||||
* @template V - The type of values in the Map.
|
||||
* @param map - The Map to test.
|
||||
* @param doesMatch - A predicate function that tests each entry.
|
||||
* @returns true if at least one entry satisfies the predicate, false otherwise.
|
||||
*
|
||||
* @example
|
||||
* const map = new Map([
|
||||
* ['a', 1],
|
||||
* ['b', 2],
|
||||
* ['c', 3]
|
||||
* ]);
|
||||
* const result = some(map, (value) => value > 2);
|
||||
* // result will be: true
|
||||
*
|
||||
* const result2 = some(map, (value) => value > 5);
|
||||
* // result2 will be: false
|
||||
*/
|
||||
declare function some<K, V>(map: Map<K, V>, doesMatch: (value: V, key: K, map: Map<K, V>) => boolean): boolean;
|
||||
//#endregion
|
||||
export { some };
|
||||
32
frontend/node_modules/es-toolkit/dist/map/some.js
generated
vendored
Normal file
32
frontend/node_modules/es-toolkit/dist/map/some.js
generated
vendored
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
//#region src/map/some.ts
|
||||
/**
|
||||
* Tests whether at least one entry in a Map satisfies the provided predicate function.
|
||||
*
|
||||
* This function iterates through the entries of the Map and checks if the predicate function
|
||||
* returns true for at least one entry. It returns true if any entry satisfies the predicate,
|
||||
* and false otherwise.
|
||||
*
|
||||
* @template K - The type of keys in the Map.
|
||||
* @template V - The type of values in the Map.
|
||||
* @param map - The Map to test.
|
||||
* @param doesMatch - A predicate function that tests each entry.
|
||||
* @returns true if at least one entry satisfies the predicate, false otherwise.
|
||||
*
|
||||
* @example
|
||||
* const map = new Map([
|
||||
* ['a', 1],
|
||||
* ['b', 2],
|
||||
* ['c', 3]
|
||||
* ]);
|
||||
* const result = some(map, (value) => value > 2);
|
||||
* // result will be: true
|
||||
*
|
||||
* const result2 = some(map, (value) => value > 5);
|
||||
* // result2 will be: false
|
||||
*/
|
||||
function some(map, doesMatch) {
|
||||
for (const [key, value] of map) if (doesMatch(value, key, map)) return true;
|
||||
return false;
|
||||
}
|
||||
//#endregion
|
||||
exports.some = some;
|
||||
32
frontend/node_modules/es-toolkit/dist/map/some.mjs
generated
vendored
Normal file
32
frontend/node_modules/es-toolkit/dist/map/some.mjs
generated
vendored
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
//#region src/map/some.ts
|
||||
/**
|
||||
* Tests whether at least one entry in a Map satisfies the provided predicate function.
|
||||
*
|
||||
* This function iterates through the entries of the Map and checks if the predicate function
|
||||
* returns true for at least one entry. It returns true if any entry satisfies the predicate,
|
||||
* and false otherwise.
|
||||
*
|
||||
* @template K - The type of keys in the Map.
|
||||
* @template V - The type of values in the Map.
|
||||
* @param map - The Map to test.
|
||||
* @param doesMatch - A predicate function that tests each entry.
|
||||
* @returns true if at least one entry satisfies the predicate, false otherwise.
|
||||
*
|
||||
* @example
|
||||
* const map = new Map([
|
||||
* ['a', 1],
|
||||
* ['b', 2],
|
||||
* ['c', 3]
|
||||
* ]);
|
||||
* const result = some(map, (value) => value > 2);
|
||||
* // result will be: true
|
||||
*
|
||||
* const result2 = some(map, (value) => value > 5);
|
||||
* // result2 will be: false
|
||||
*/
|
||||
function some(map, doesMatch) {
|
||||
for (const [key, value] of map) if (doesMatch(value, key, map)) return true;
|
||||
return false;
|
||||
}
|
||||
//#endregion
|
||||
export { some };
|
||||
Loading…
Add table
Add a link
Reference in a new issue