@gooddata/util 11.68.0-alpha.6 → 11.68.0-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/NOTICE +1 -1
- package/esm/_/_basePickBy.d.ts +14 -0
- package/esm/_/_basePickBy.d.ts.map +1 -0
- package/esm/_/_basePickBy.js +57 -0
- package/esm/_/_createCompounder.d.ts +11 -0
- package/esm/_/_createCompounder.d.ts.map +1 -0
- package/esm/_/{_arrayAggregator.js → _createCompounder.js} +12 -16
- package/esm/_/camelCase.d.ts +3 -4
- package/esm/_/camelCase.d.ts.map +1 -1
- package/esm/_/camelCase.js +8 -19
- package/esm/_/capitalize.d.ts +9 -0
- package/esm/_/capitalize.d.ts.map +1 -0
- package/esm/_/{_arrayAggregator.d.ts → capitalize.js} +10 -9
- package/esm/_/deburr.d.ts.map +1 -1
- package/esm/_/deburr.js +2 -1
- package/esm/_/difference.d.ts +14 -0
- package/esm/_/difference.d.ts.map +1 -0
- package/esm/_/difference.js +67 -0
- package/esm/_/escape.d.ts +13 -0
- package/esm/_/escape.d.ts.map +1 -0
- package/esm/_/escape.js +56 -0
- package/esm/_/has.d.ts +23 -0
- package/esm/_/has.d.ts.map +1 -0
- package/esm/_/has.js +35 -0
- package/esm/_/isPlainObject.d.ts +1 -1
- package/esm/_/isPlainObject.d.ts.map +1 -1
- package/esm/_/kebabCase.d.ts +9 -0
- package/esm/_/kebabCase.d.ts.map +1 -0
- package/esm/_/kebabCase.js +40 -0
- package/esm/_/keyBy.d.ts +17 -0
- package/esm/_/keyBy.d.ts.map +1 -0
- package/esm/_/{_baseAggregator.js → keyBy.js} +9 -16
- package/esm/_/omitBy.d.ts +21 -0
- package/esm/_/omitBy.d.ts.map +1 -0
- package/esm/_/{_createAggregator.js → omitBy.js} +4 -17
- package/esm/_/partial.d.ts +87 -0
- package/esm/_/partial.d.ts.map +1 -0
- package/esm/_/partial.js +30 -0
- package/esm/_/pickBy.d.ts +21 -0
- package/esm/_/pickBy.d.ts.map +1 -0
- package/esm/_/pickBy.js +36 -0
- package/esm/_/toString.d.ts +11 -0
- package/esm/_/toString.d.ts.map +1 -0
- package/esm/_/toString.js +57 -0
- package/esm/_/types.d.ts +38 -0
- package/esm/_/types.d.ts.map +1 -1
- package/esm/_/union.d.ts +11 -0
- package/esm/_/union.d.ts.map +1 -0
- package/esm/_/union.js +55 -0
- package/esm/_/uniqWith.d.ts +14 -0
- package/esm/_/uniqWith.d.ts.map +1 -0
- package/esm/_/uniqWith.js +59 -0
- package/esm/_/upperFirst.d.ts +10 -0
- package/esm/_/upperFirst.d.ts.map +1 -0
- package/esm/_/upperFirst.js +46 -0
- package/esm/_/zip.d.ts +28 -0
- package/esm/_/zip.d.ts.map +1 -0
- package/esm/_/zip.js +38 -0
- package/esm/index.d.ts +14 -1
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +13 -0
- package/esm/util.d.ts +299 -4
- package/package.json +3 -3
- package/esm/_/_arrayAggregator.d.ts.map +0 -1
- package/esm/_/_baseAggregator.d.ts +0 -13
- package/esm/_/_baseAggregator.d.ts.map +0 -1
- package/esm/_/_createAggregator.d.ts +0 -10
- package/esm/_/_createAggregator.d.ts.map +0 -1
package/LICENSE
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Copyright (c) 2020-
|
|
1
|
+
Copyright (c) 2020-2026 GoodData Corporation
|
|
2
2
|
|
|
3
3
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
4
|
|
package/NOTICE
CHANGED
|
@@ -3,7 +3,7 @@ Copyright (c) 2017-2026 GoodData Corporation
|
|
|
3
3
|
This product includes a number of subcomponents with separate copyright notices and license terms below. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license. This GoodData project does not necessarily use all the open source software referred to below and may also only use portions of a given package. With respect to the open source software listed in this document, if you (i) have any questions, (ii) wish to receive source code for packages under licenses that require their source code to be made available (such as the GNU Lesser Public License), or (iii) discover any errors or omissions in the licensing information provided, please contact us at legal@gooddata.com. Please identify in source code requests: (i) the packages for which you are requesting corresponding source, (ii) the GoodData product (including any available version) with which the package was provided; and (iii) an email address (if available) or postal address at which GoodData may contact you.
|
|
4
4
|
|
|
5
5
|
--------------------------------------------------------------------------------
|
|
6
|
-
Attribution Notice for @gooddata/util (11.68.0-alpha.
|
|
6
|
+
Attribution Notice for @gooddata/util (11.68.0-alpha.7)
|
|
7
7
|
Package License: MIT
|
|
8
8
|
Own License File: LICENSE
|
|
9
9
|
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
type _AnyRecord = Record<PropertyKey, unknown>;
|
|
2
|
+
/**
|
|
3
|
+
* The base implementation of `_pickBy`: creates an object composed of the own and inherited enumerable
|
|
4
|
+
* string and symbol keyed properties of `object` that `predicate` returns truthy for. The predicate is
|
|
5
|
+
* invoked with two arguments: (value, key). Picked values are kept by reference.
|
|
6
|
+
*
|
|
7
|
+
* @param object - The source object.
|
|
8
|
+
* @param predicate - The function invoked per property.
|
|
9
|
+
* @returns Returns the new object.
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
export declare function _basePickBy(object: unknown, predicate: (value: unknown, key: string | symbol) => unknown): _AnyRecord;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=_basePickBy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_basePickBy.d.ts","sourceRoot":"","sources":["../../src/_/_basePickBy.ts"],"names":[],"mappings":"AAmCA,KAAK,UAAU,GAAG,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;AAE/C;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CACvB,MAAM,EAAE,OAAO,EACf,SAAS,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,KAAK,OAAO,GAC7D,UAAU,CAmBZ"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// (C) 2026 GoodData Corporation
|
|
2
|
+
/*!
|
|
3
|
+
* Portions of this file are derived from Lodash.
|
|
4
|
+
* https://github.com/lodash/lodash
|
|
5
|
+
*
|
|
6
|
+
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
7
|
+
*
|
|
8
|
+
* Based on Underscore.js, copyright Jeremy Ashkenas,
|
|
9
|
+
* DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
|
|
10
|
+
*
|
|
11
|
+
* Modifications Copyright (c) 2026 GoodData Corporation
|
|
12
|
+
*
|
|
13
|
+
* Permission is hereby granted, free of charge, to any person obtaining
|
|
14
|
+
* a copy of this software and associated documentation files (the
|
|
15
|
+
* "Software"), to deal in the Software without restriction, including
|
|
16
|
+
* without limitation the rights to use, copy, modify, merge, publish,
|
|
17
|
+
* distribute, sublicense, and/or sell copies of the Software, and to
|
|
18
|
+
* permit persons to whom the Software is furnished to do so, subject to
|
|
19
|
+
* the following conditions:
|
|
20
|
+
*
|
|
21
|
+
* The above copyright notice and this permission notice shall be
|
|
22
|
+
* included in all copies or substantial portions of the Software.
|
|
23
|
+
*
|
|
24
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
25
|
+
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
26
|
+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
27
|
+
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
28
|
+
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
29
|
+
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
30
|
+
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
31
|
+
*/
|
|
32
|
+
import { _getAllKeysIn } from "./_getAllKeysIn.js";
|
|
33
|
+
/**
|
|
34
|
+
* The base implementation of `_pickBy`: creates an object composed of the own and inherited enumerable
|
|
35
|
+
* string and symbol keyed properties of `object` that `predicate` returns truthy for. The predicate is
|
|
36
|
+
* invoked with two arguments: (value, key). Picked values are kept by reference.
|
|
37
|
+
*
|
|
38
|
+
* @param object - The source object.
|
|
39
|
+
* @param predicate - The function invoked per property.
|
|
40
|
+
* @returns Returns the new object.
|
|
41
|
+
* @internal
|
|
42
|
+
*/
|
|
43
|
+
export function _basePickBy(object, predicate) {
|
|
44
|
+
const result = {};
|
|
45
|
+
if (object == null) {
|
|
46
|
+
return result;
|
|
47
|
+
}
|
|
48
|
+
const source = Object(object);
|
|
49
|
+
for (const key of _getAllKeysIn(source)) {
|
|
50
|
+
const value = source[key];
|
|
51
|
+
// keys that would change the prototype of the result are never written, as in lodash
|
|
52
|
+
if (predicate(value, key) && key !== "__proto__" && key !== "constructor" && key !== "prototype") {
|
|
53
|
+
result[key] = value;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return result;
|
|
57
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a function like `_camelCase`: the string is deburred, stripped of apostrophes and split into words
|
|
3
|
+
* (on separators, case changes, digits and Unicode boundaries, as lodash does), which `callback` then folds
|
|
4
|
+
* into the result, receiving the result so far, the word and its index.
|
|
5
|
+
*
|
|
6
|
+
* @param callback - The function to combine each word.
|
|
7
|
+
* @returns Returns the new compounder function.
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export declare function _createCompounder(callback: (result: string, word: string, index: number) => string): (string?: string) => string;
|
|
11
|
+
//# sourceMappingURL=_createCompounder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_createCompounder.d.ts","sourceRoot":"","sources":["../../src/_/_createCompounder.ts"],"names":[],"mappings":"AAuCA;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAC7B,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,GAClE,CAAC,MAAM,CAAC,EAAE,MAAM,KAAK,MAAM,CAE7B"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
// (C) 2026 GoodData Corporation
|
|
2
|
-
/* eslint-disable */
|
|
3
2
|
/*!
|
|
4
3
|
* Portions of this file are derived from Lodash.
|
|
5
4
|
* https://github.com/lodash/lodash
|
|
@@ -30,22 +29,19 @@
|
|
|
30
29
|
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
31
30
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
32
31
|
*/
|
|
32
|
+
import { _deburr } from "./deburr.js";
|
|
33
|
+
import { _words } from "./words.js";
|
|
34
|
+
/** Used to match apostrophes. */
|
|
35
|
+
const RE_APOS = /['’]/g;
|
|
33
36
|
/**
|
|
34
|
-
*
|
|
37
|
+
* Creates a function like `_camelCase`: the string is deburred, stripped of apostrophes and split into words
|
|
38
|
+
* (on separators, case changes, digits and Unicode boundaries, as lodash does), which `callback` then folds
|
|
39
|
+
* into the result, receiving the result so far, the word and its index.
|
|
35
40
|
*
|
|
36
|
-
* @
|
|
37
|
-
* @
|
|
38
|
-
* @
|
|
39
|
-
* @param {Function} iteratee The iteratee to transform keys.
|
|
40
|
-
* @param {Object} accumulator The initial aggregated object.
|
|
41
|
-
* @returns {Function} Returns `accumulator`.
|
|
41
|
+
* @param callback - The function to combine each word.
|
|
42
|
+
* @returns Returns the new compounder function.
|
|
43
|
+
* @internal
|
|
42
44
|
*/
|
|
43
|
-
export function
|
|
44
|
-
|
|
45
|
-
const length = array == null ? 0 : array.length;
|
|
46
|
-
while (++index < length) {
|
|
47
|
-
const value = array[index];
|
|
48
|
-
setter(accumulator, value, iteratee(value), array);
|
|
49
|
-
}
|
|
50
|
-
return accumulator;
|
|
45
|
+
export function _createCompounder(callback) {
|
|
46
|
+
return (string) => _words(_deburr(string).replace(RE_APOS, "")).reduce(callback, "");
|
|
51
47
|
}
|
package/esm/_/camelCase.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Converts `string` to camel case: the
|
|
3
|
-
*
|
|
4
|
-
* capitalised.
|
|
2
|
+
* Converts `string` to camel case: the words of the string, lower-cased, with every word but the first
|
|
3
|
+
* capitalised, joined together.
|
|
5
4
|
*
|
|
6
5
|
* @param string - The string to convert.
|
|
7
6
|
* @returns Returns the camel cased string.
|
|
8
7
|
* @internal
|
|
9
8
|
*/
|
|
10
|
-
export declare
|
|
9
|
+
export declare const _camelCase: (string?: string) => string;
|
|
11
10
|
//# sourceMappingURL=camelCase.d.ts.map
|
package/esm/_/camelCase.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"camelCase.d.ts","sourceRoot":"","sources":["../../src/_/camelCase.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"camelCase.d.ts","sourceRoot":"","sources":["../../src/_/camelCase.ts"],"names":[],"mappings":"AAoCA;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,KAAK,MAI5C,CAAC"}
|
package/esm/_/camelCase.js
CHANGED
|
@@ -29,28 +29,17 @@
|
|
|
29
29
|
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
30
30
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
31
31
|
*/
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import { _words } from "./words.js";
|
|
35
|
-
/** Used to match apostrophes. */
|
|
36
|
-
const RE_APOS = /['’]/g;
|
|
32
|
+
import { _createCompounder } from "./_createCompounder.js";
|
|
33
|
+
import { _upperFirst } from "./upperFirst.js";
|
|
37
34
|
/**
|
|
38
|
-
* Converts `string` to camel case: the
|
|
39
|
-
*
|
|
40
|
-
* capitalised.
|
|
35
|
+
* Converts `string` to camel case: the words of the string, lower-cased, with every word but the first
|
|
36
|
+
* capitalised, joined together.
|
|
41
37
|
*
|
|
42
38
|
* @param string - The string to convert.
|
|
43
39
|
* @returns Returns the camel cased string.
|
|
44
40
|
* @internal
|
|
45
41
|
*/
|
|
46
|
-
export
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}, "");
|
|
51
|
-
}
|
|
52
|
-
/** Upper-cases the first symbol of `string`, keeping a surrogate pair or joined emoji sequence whole. */
|
|
53
|
-
function _upperFirst(string) {
|
|
54
|
-
const first = (_hasUnicode(string) ? _unicodeToArray(string)[0] : string.charAt(0)) ?? "";
|
|
55
|
-
return first.toUpperCase() + string.slice(first.length);
|
|
56
|
-
}
|
|
42
|
+
export const _camelCase = _createCompounder((result, word, index) => {
|
|
43
|
+
const lower = word.toLowerCase();
|
|
44
|
+
return result + (index ? _upperFirst(lower) : lower);
|
|
45
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts the first character of `string` to upper case and the remaining to lower case.
|
|
3
|
+
*
|
|
4
|
+
* @param string - The string to capitalize.
|
|
5
|
+
* @returns Returns the capitalized string.
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export declare function _capitalize(string?: string): string;
|
|
9
|
+
//# sourceMappingURL=capitalize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capitalize.d.ts","sourceRoot":"","sources":["../../src/_/capitalize.ts"],"names":[],"mappings":"AAoCA;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAEnD"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// (C) 2026 GoodData Corporation
|
|
1
2
|
/*!
|
|
2
3
|
* Portions of this file are derived from Lodash.
|
|
3
4
|
* https://github.com/lodash/lodash
|
|
@@ -28,15 +29,15 @@
|
|
|
28
29
|
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
29
30
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
30
31
|
*/
|
|
32
|
+
import { _toString } from "./toString.js";
|
|
33
|
+
import { _upperFirst } from "./upperFirst.js";
|
|
31
34
|
/**
|
|
32
|
-
*
|
|
35
|
+
* Converts the first character of `string` to upper case and the remaining to lower case.
|
|
33
36
|
*
|
|
34
|
-
* @
|
|
35
|
-
* @
|
|
36
|
-
* @
|
|
37
|
-
* @param {Function} iteratee The iteratee to transform keys.
|
|
38
|
-
* @param {Object} accumulator The initial aggregated object.
|
|
39
|
-
* @returns {Function} Returns `accumulator`.
|
|
37
|
+
* @param string - The string to capitalize.
|
|
38
|
+
* @returns Returns the capitalized string.
|
|
39
|
+
* @internal
|
|
40
40
|
*/
|
|
41
|
-
export
|
|
42
|
-
|
|
41
|
+
export function _capitalize(string) {
|
|
42
|
+
return _upperFirst(_toString(string).toLowerCase());
|
|
43
|
+
}
|
package/esm/_/deburr.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deburr.d.ts","sourceRoot":"","sources":["../../src/_/deburr.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"deburr.d.ts","sourceRoot":"","sources":["../../src/_/deburr.ts"],"names":[],"mappings":"AA6OA;;;;;;;GAOG;AACH,wBAAgB,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAI/C"}
|
package/esm/_/deburr.js
CHANGED
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
30
30
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
31
31
|
*/
|
|
32
|
+
import { _toString } from "./toString.js";
|
|
32
33
|
/** Used to match Latin Unicode letters (excluding mathematical operators). */
|
|
33
34
|
const RE_LATIN = /[\xc0-\xd6\xd8-\xf6\xf8-\xffĀ-ſ]/g;
|
|
34
35
|
/** Used to match combining diacritical marks and combining diacritical marks for symbols. */
|
|
@@ -237,6 +238,6 @@ const DEBURRED_LETTERS = {
|
|
|
237
238
|
* @internal
|
|
238
239
|
*/
|
|
239
240
|
export function _deburr(string) {
|
|
240
|
-
const text =
|
|
241
|
+
const text = _toString(string);
|
|
241
242
|
return text.replace(RE_LATIN, (letter) => DEBURRED_LETTERS[letter] ?? letter).replace(RE_COMBO_MARK, "");
|
|
242
243
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { _List } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Creates an array of `array` values not included in the other given arrays using SameValueZero for equality
|
|
4
|
+
* comparisons. The order and references of result values are determined by the first array. Only array-like
|
|
5
|
+
* objects are inspected: any other first argument yields an empty array and any other exclusion argument is
|
|
6
|
+
* skipped.
|
|
7
|
+
*
|
|
8
|
+
* @param array - The array to inspect.
|
|
9
|
+
* @param values - The arrays of values to exclude.
|
|
10
|
+
* @returns Returns the new array of filtered values.
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
export declare function _difference<T>(array: _List<T> | null | undefined, ...values: _List<T>[]): T[];
|
|
14
|
+
//# sourceMappingURL=difference.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"difference.d.ts","sourceRoot":"","sources":["../../src/_/difference.ts"],"names":[],"mappings":"AAmCA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAExC;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,SAAS,EAAE,GAAG,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CA6B7F"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// (C) 2026 GoodData Corporation
|
|
2
|
+
/*!
|
|
3
|
+
* Portions of this file are derived from Lodash.
|
|
4
|
+
* https://github.com/lodash/lodash
|
|
5
|
+
*
|
|
6
|
+
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
7
|
+
*
|
|
8
|
+
* Based on Underscore.js, copyright Jeremy Ashkenas,
|
|
9
|
+
* DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
|
|
10
|
+
*
|
|
11
|
+
* Modifications Copyright (c) 2026 GoodData Corporation
|
|
12
|
+
*
|
|
13
|
+
* Permission is hereby granted, free of charge, to any person obtaining
|
|
14
|
+
* a copy of this software and associated documentation files (the
|
|
15
|
+
* "Software"), to deal in the Software without restriction, including
|
|
16
|
+
* without limitation the rights to use, copy, modify, merge, publish,
|
|
17
|
+
* distribute, sublicense, and/or sell copies of the Software, and to
|
|
18
|
+
* permit persons to whom the Software is furnished to do so, subject to
|
|
19
|
+
* the following conditions:
|
|
20
|
+
*
|
|
21
|
+
* The above copyright notice and this permission notice shall be
|
|
22
|
+
* included in all copies or substantial portions of the Software.
|
|
23
|
+
*
|
|
24
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
25
|
+
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
26
|
+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
27
|
+
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
28
|
+
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
29
|
+
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
30
|
+
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
31
|
+
*/
|
|
32
|
+
import { _isArrayLike } from "./isArrayLike.js";
|
|
33
|
+
import { _isObjectLike } from "./isObjectLike.js";
|
|
34
|
+
/**
|
|
35
|
+
* Creates an array of `array` values not included in the other given arrays using SameValueZero for equality
|
|
36
|
+
* comparisons. The order and references of result values are determined by the first array. Only array-like
|
|
37
|
+
* objects are inspected: any other first argument yields an empty array and any other exclusion argument is
|
|
38
|
+
* skipped.
|
|
39
|
+
*
|
|
40
|
+
* @param array - The array to inspect.
|
|
41
|
+
* @param values - The arrays of values to exclude.
|
|
42
|
+
* @returns Returns the new array of filtered values.
|
|
43
|
+
* @internal
|
|
44
|
+
*/
|
|
45
|
+
export function _difference(array, ...values) {
|
|
46
|
+
if (!_isObjectLike(array) || !_isArrayLike(array)) {
|
|
47
|
+
return [];
|
|
48
|
+
}
|
|
49
|
+
const excluded = new Set();
|
|
50
|
+
for (const list of values) {
|
|
51
|
+
if (!_isObjectLike(list) || !_isArrayLike(list)) {
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
for (let index = 0; index < list.length; index++) {
|
|
55
|
+
excluded.add(list[index]);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
const result = [];
|
|
59
|
+
for (let index = 0; index < array.length; index++) {
|
|
60
|
+
const value = array[index];
|
|
61
|
+
if (!excluded.has(value)) {
|
|
62
|
+
// lodash normalises `-0` to `+0` in the result
|
|
63
|
+
result.push(value === 0 ? 0 : value);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return result;
|
|
67
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts the characters `&`, `<`, `>`, `"` and `'` in `string` to their corresponding HTML entities.
|
|
3
|
+
*
|
|
4
|
+
* **Note:** No other characters are escaped. Though `>` is escaped for symmetry, characters like `>` and `/`
|
|
5
|
+
* don't need escaping in HTML and have no special meaning unless they're part of a tag or unquoted attribute
|
|
6
|
+
* value. When working with HTML you should always quote attribute values to reduce XSS vectors.
|
|
7
|
+
*
|
|
8
|
+
* @param string - The string to escape.
|
|
9
|
+
* @returns Returns the escaped string.
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
export declare function _escape(string?: string): string;
|
|
13
|
+
//# sourceMappingURL=escape.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"escape.d.ts","sourceRoot":"","sources":["../../src/_/escape.ts"],"names":[],"mappings":"AA+CA;;;;;;;;;;GAUG;AACH,wBAAgB,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAE/C"}
|
package/esm/_/escape.js
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// (C) 2026 GoodData Corporation
|
|
2
|
+
/*!
|
|
3
|
+
* Portions of this file are derived from Lodash.
|
|
4
|
+
* https://github.com/lodash/lodash
|
|
5
|
+
*
|
|
6
|
+
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
7
|
+
*
|
|
8
|
+
* Based on Underscore.js, copyright Jeremy Ashkenas,
|
|
9
|
+
* DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
|
|
10
|
+
*
|
|
11
|
+
* Modifications Copyright (c) 2026 GoodData Corporation
|
|
12
|
+
*
|
|
13
|
+
* Permission is hereby granted, free of charge, to any person obtaining
|
|
14
|
+
* a copy of this software and associated documentation files (the
|
|
15
|
+
* "Software"), to deal in the Software without restriction, including
|
|
16
|
+
* without limitation the rights to use, copy, modify, merge, publish,
|
|
17
|
+
* distribute, sublicense, and/or sell copies of the Software, and to
|
|
18
|
+
* permit persons to whom the Software is furnished to do so, subject to
|
|
19
|
+
* the following conditions:
|
|
20
|
+
*
|
|
21
|
+
* The above copyright notice and this permission notice shall be
|
|
22
|
+
* included in all copies or substantial portions of the Software.
|
|
23
|
+
*
|
|
24
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
25
|
+
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
26
|
+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
27
|
+
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
28
|
+
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
29
|
+
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
30
|
+
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
31
|
+
*/
|
|
32
|
+
import { _toString } from "./toString.js";
|
|
33
|
+
/** Used to match HTML characters. */
|
|
34
|
+
const RE_UNESCAPED_HTML = /[&<>"']/g;
|
|
35
|
+
/** Used to map characters to HTML entities. */
|
|
36
|
+
const HTML_ESCAPES = {
|
|
37
|
+
"&": "&",
|
|
38
|
+
"<": "<",
|
|
39
|
+
">": ">",
|
|
40
|
+
'"': """,
|
|
41
|
+
"'": "'",
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Converts the characters `&`, `<`, `>`, `"` and `'` in `string` to their corresponding HTML entities.
|
|
45
|
+
*
|
|
46
|
+
* **Note:** No other characters are escaped. Though `>` is escaped for symmetry, characters like `>` and `/`
|
|
47
|
+
* don't need escaping in HTML and have no special meaning unless they're part of a tag or unquoted attribute
|
|
48
|
+
* value. When working with HTML you should always quote attribute values to reduce XSS vectors.
|
|
49
|
+
*
|
|
50
|
+
* @param string - The string to escape.
|
|
51
|
+
* @returns Returns the escaped string.
|
|
52
|
+
* @internal
|
|
53
|
+
*/
|
|
54
|
+
export function _escape(string) {
|
|
55
|
+
return _toString(string).replace(RE_UNESCAPED_HTML, (character) => HTML_ESCAPES[character] ?? character);
|
|
56
|
+
}
|
package/esm/_/has.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { _PropertyPath } from "./set.js";
|
|
2
|
+
import type { _PropertyName } from "./types.js";
|
|
3
|
+
declare const uniqueSymbol: unique symbol;
|
|
4
|
+
/**
|
|
5
|
+
* Checks if `path` is a direct property of `object`: every segment of the path must be an own property of
|
|
6
|
+
* the value before it, or a valid index of an array or arguments object.
|
|
7
|
+
*
|
|
8
|
+
* @param object - The object to query.
|
|
9
|
+
* @param path - The path to check.
|
|
10
|
+
* @returns Returns `true` if `path` exists, else `false`.
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
export declare function _has<T, K extends _PropertyName>(object: T, path: K): object is T & {
|
|
14
|
+
[P in K]: P extends keyof T ? T[P] : Record<string, unknown> extends T ? T[keyof T] : unknown;
|
|
15
|
+
} & {
|
|
16
|
+
[uniqueSymbol]: unknown;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
export declare function _has<T>(object: T, path: _PropertyPath): boolean;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=has.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"has.d.ts","sourceRoot":"","sources":["../../src/_/has.ts"],"names":[],"mappings":"AAkCA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,OAAO,CAAC,MAAM,YAAY,EAAE,OAAO,MAAM,CAAC;AAE1C;;;;;;;;GAQG;AACH,wBAAgB,IAAI,CAAC,CAAC,EAAE,CAAC,SAAS,aAAa,EAC3C,MAAM,EAAE,CAAC,EACT,IAAI,EAAE,CAAC,GACR,MAAM,IAAI,CAAC,GAAG;KACZ,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,OAAO;CAChG,GAAG;IAAE,CAAC,YAAY,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAChC;;GAEG;AACH,wBAAgB,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC"}
|
package/esm/_/has.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// (C) 2026 GoodData Corporation
|
|
2
|
+
/*!
|
|
3
|
+
* Portions of this file are derived from Lodash.
|
|
4
|
+
* https://github.com/lodash/lodash
|
|
5
|
+
*
|
|
6
|
+
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
7
|
+
*
|
|
8
|
+
* Based on Underscore.js, copyright Jeremy Ashkenas,
|
|
9
|
+
* DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
|
|
10
|
+
*
|
|
11
|
+
* Modifications Copyright (c) 2026 GoodData Corporation
|
|
12
|
+
*
|
|
13
|
+
* Permission is hereby granted, free of charge, to any person obtaining
|
|
14
|
+
* a copy of this software and associated documentation files (the
|
|
15
|
+
* "Software"), to deal in the Software without restriction, including
|
|
16
|
+
* without limitation the rights to use, copy, modify, merge, publish,
|
|
17
|
+
* distribute, sublicense, and/or sell copies of the Software, and to
|
|
18
|
+
* permit persons to whom the Software is furnished to do so, subject to
|
|
19
|
+
* the following conditions:
|
|
20
|
+
*
|
|
21
|
+
* The above copyright notice and this permission notice shall be
|
|
22
|
+
* included in all copies or substantial portions of the Software.
|
|
23
|
+
*
|
|
24
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
25
|
+
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
26
|
+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
27
|
+
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
28
|
+
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
29
|
+
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
30
|
+
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
31
|
+
*/
|
|
32
|
+
import { _hasPath } from "./_hasPath.js";
|
|
33
|
+
export function _has(object, path) {
|
|
34
|
+
return object != null && _hasPath(object, path, (target, key) => Object.hasOwn(target, key));
|
|
35
|
+
}
|
package/esm/_/isPlainObject.d.ts
CHANGED
|
@@ -6,5 +6,5 @@
|
|
|
6
6
|
* @returns Returns `true` if `value` is a plain object, else `false`.
|
|
7
7
|
* @internal
|
|
8
8
|
*/
|
|
9
|
-
export declare function _isPlainObject(value
|
|
9
|
+
export declare function _isPlainObject(value?: unknown): boolean;
|
|
10
10
|
//# sourceMappingURL=isPlainObject.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isPlainObject.d.ts","sourceRoot":"","sources":["../../src/_/isPlainObject.ts"],"names":[],"mappings":"AA0CA;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,
|
|
1
|
+
{"version":3,"file":"isPlainObject.d.ts","sourceRoot":"","sources":["../../src/_/isPlainObject.ts"],"names":[],"mappings":"AA0CA;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,OAAO,CAmBvD"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts `string` to kebab case: the words of the string, lower-cased and joined with hyphens.
|
|
3
|
+
*
|
|
4
|
+
* @param string - The string to convert.
|
|
5
|
+
* @returns Returns the kebab cased string.
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export declare const _kebabCase: (string?: string) => string;
|
|
9
|
+
//# sourceMappingURL=kebabCase.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kebabCase.d.ts","sourceRoot":"","sources":["../../src/_/kebabCase.ts"],"names":[],"mappings":"AAmCA;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,KAAK,MAE7C,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// (C) 2026 GoodData Corporation
|
|
2
|
+
/*!
|
|
3
|
+
* Portions of this file are derived from Lodash.
|
|
4
|
+
* https://github.com/lodash/lodash
|
|
5
|
+
*
|
|
6
|
+
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
7
|
+
*
|
|
8
|
+
* Based on Underscore.js, copyright Jeremy Ashkenas,
|
|
9
|
+
* DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
|
|
10
|
+
*
|
|
11
|
+
* Modifications Copyright (c) 2026 GoodData Corporation
|
|
12
|
+
*
|
|
13
|
+
* Permission is hereby granted, free of charge, to any person obtaining
|
|
14
|
+
* a copy of this software and associated documentation files (the
|
|
15
|
+
* "Software"), to deal in the Software without restriction, including
|
|
16
|
+
* without limitation the rights to use, copy, modify, merge, publish,
|
|
17
|
+
* distribute, sublicense, and/or sell copies of the Software, and to
|
|
18
|
+
* permit persons to whom the Software is furnished to do so, subject to
|
|
19
|
+
* the following conditions:
|
|
20
|
+
*
|
|
21
|
+
* The above copyright notice and this permission notice shall be
|
|
22
|
+
* included in all copies or substantial portions of the Software.
|
|
23
|
+
*
|
|
24
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
25
|
+
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
26
|
+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
27
|
+
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
28
|
+
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
29
|
+
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
30
|
+
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
31
|
+
*/
|
|
32
|
+
import { _createCompounder } from "./_createCompounder.js";
|
|
33
|
+
/**
|
|
34
|
+
* Converts `string` to kebab case: the words of the string, lower-cased and joined with hyphens.
|
|
35
|
+
*
|
|
36
|
+
* @param string - The string to convert.
|
|
37
|
+
* @returns Returns the kebab cased string.
|
|
38
|
+
* @internal
|
|
39
|
+
*/
|
|
40
|
+
export const _kebabCase = _createCompounder((result, word, index) => result + (index ? "-" : "") + word.toLowerCase());
|
package/esm/_/keyBy.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { _Dictionary, _List, _PropertyName, _ValueIterateeCustom } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Creates an object composed of keys generated from the results of running each element of `collection`
|
|
4
|
+
* thru `iteratee`. The corresponding value of each key is the last element responsible for generating the
|
|
5
|
+
* key. The iteratee is invoked with one argument: (value).
|
|
6
|
+
*
|
|
7
|
+
* @param collection - The collection to iterate over.
|
|
8
|
+
* @param iteratee - The iteratee to transform keys.
|
|
9
|
+
* @returns Returns the composed aggregate object.
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
export declare function _keyBy<T>(collection: _List<T> | null | undefined, iteratee?: _ValueIterateeCustom<T, _PropertyName>): _Dictionary<T>;
|
|
13
|
+
/**
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
export declare function _keyBy<T extends object>(collection: T | null | undefined, iteratee?: _ValueIterateeCustom<T[keyof T], _PropertyName>): _Dictionary<T[keyof T]>;
|
|
17
|
+
//# sourceMappingURL=keyBy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keyBy.d.ts","sourceRoot":"","sources":["../../src/_/keyBy.ts"],"names":[],"mappings":"AAoCA,OAAO,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAE1F;;;;;;;;;GASG;AACH,wBAAgB,MAAM,CAAC,CAAC,EACpB,UAAU,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,SAAS,EACvC,QAAQ,CAAC,EAAE,oBAAoB,CAAC,CAAC,EAAE,aAAa,CAAC,GAClD,WAAW,CAAC,CAAC,CAAC,CAAC;AAClB;;GAEG;AACH,wBAAgB,MAAM,CAAC,CAAC,SAAS,MAAM,EACnC,UAAU,EAAE,CAAC,GAAG,IAAI,GAAG,SAAS,EAChC,QAAQ,CAAC,EAAE,oBAAoB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,aAAa,CAAC,GAC3D,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
// (C) 2026 GoodData Corporation
|
|
2
|
-
/* eslint-disable */
|
|
3
2
|
/*!
|
|
4
3
|
* Portions of this file are derived from Lodash.
|
|
5
4
|
* https://github.com/lodash/lodash
|
|
@@ -30,21 +29,15 @@
|
|
|
30
29
|
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
31
30
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
32
31
|
*/
|
|
32
|
+
import { _baseAssignValue } from "./_baseAssignValue.js";
|
|
33
33
|
import { _baseEach } from "./_baseEach.js";
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
* @param {Function} iteratee The iteratee to transform keys.
|
|
42
|
-
* @param {Object} accumulator The initial aggregated object.
|
|
43
|
-
* @returns {Function} Returns `accumulator`.
|
|
44
|
-
*/
|
|
45
|
-
export function _baseAggregator(collection, setter, iteratee, accumulator) {
|
|
46
|
-
_baseEach(collection, function (value, _key, collection) {
|
|
47
|
-
setter(accumulator, value, iteratee(value), collection);
|
|
34
|
+
import { _baseIteratee } from "./_baseIteratee.js";
|
|
35
|
+
export function _keyBy(collection, iteratee) {
|
|
36
|
+
const result = {};
|
|
37
|
+
const toKey = _baseIteratee(iteratee);
|
|
38
|
+
_baseEach(collection, (value) => {
|
|
39
|
+
// defines a `__proto__` key as an own property instead of changing the prototype
|
|
40
|
+
_baseAssignValue(result, toKey(value), value);
|
|
48
41
|
});
|
|
49
|
-
return
|
|
42
|
+
return result;
|
|
50
43
|
}
|