@gooddata/util 11.68.0-alpha.2 → 11.68.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/_/_assignValue.d.ts +12 -0
- package/esm/_/_assignValue.d.ts.map +1 -0
- package/esm/_/_assignValue.js +53 -0
- package/esm/_/_baseClone.d.ts +15 -0
- package/esm/_/_baseClone.d.ts.map +1 -0
- package/esm/_/_baseClone.js +224 -0
- package/esm/_/_baseEach.d.ts +11 -0
- package/esm/_/_baseEach.d.ts.map +1 -0
- package/esm/_/_baseEach.js +62 -0
- package/esm/_/_baseGet.d.ts +10 -0
- package/esm/_/_baseGet.d.ts.map +1 -0
- package/esm/_/_baseGet.js +50 -0
- package/esm/_/_baseGetTag.d.ts +9 -0
- package/esm/_/_baseGetTag.d.ts.map +1 -0
- package/esm/_/_baseGetTag.js +48 -0
- package/esm/_/_baseIsEqual.d.ts +34 -0
- package/esm/_/_baseIsEqual.d.ts.map +1 -0
- package/esm/_/_baseIsEqual.js +278 -0
- package/esm/_/_baseIsMatch.d.ts +13 -0
- package/esm/_/_baseIsMatch.d.ts.map +1 -0
- package/esm/_/_baseIsMatch.js +67 -0
- package/esm/_/_baseIteratee.d.ts +15 -0
- package/esm/_/_baseIteratee.d.ts.map +1 -0
- package/esm/_/_baseIteratee.js +65 -0
- package/esm/_/_baseKeys.d.ts +12 -0
- package/esm/_/_baseKeys.d.ts.map +1 -0
- package/esm/_/_baseKeys.js +46 -0
- package/esm/_/_baseMatches.d.ts +10 -0
- package/esm/_/_baseMatches.d.ts.map +1 -0
- package/esm/_/_baseMatches.js +50 -0
- package/esm/_/_baseMatchesProperty.d.ts +11 -0
- package/esm/_/_baseMatchesProperty.d.ts.map +1 -0
- package/esm/_/_baseMatchesProperty.js +59 -0
- package/esm/_/_baseSet.d.ts +11 -0
- package/esm/_/_baseSet.d.ts.map +1 -0
- package/esm/_/_baseSet.js +68 -0
- package/esm/_/_baseUniq.d.ts +43 -0
- package/esm/_/_baseUniq.d.ts.map +1 -0
- package/esm/_/_baseUniq.js +57 -0
- package/esm/_/_baseUnset.d.ts +13 -0
- package/esm/_/_baseUnset.d.ts.map +1 -0
- package/esm/_/_baseUnset.js +62 -0
- package/esm/_/_castPath.d.ts +10 -0
- package/esm/_/_castPath.d.ts.map +1 -0
- package/esm/_/_castPath.js +48 -0
- package/esm/_/_getAllKeys.d.ts +9 -0
- package/esm/_/_getAllKeys.d.ts.map +1 -0
- package/esm/_/_getAllKeys.js +43 -0
- package/esm/_/_getAllKeysIn.d.ts +12 -0
- package/esm/_/_getAllKeysIn.d.ts.map +1 -0
- package/esm/_/_getAllKeysIn.js +59 -0
- package/esm/_/_getMatchData.d.ts +16 -0
- package/esm/_/_getMatchData.d.ts.map +1 -0
- package/esm/_/_getMatchData.js +46 -0
- package/esm/_/_getRawTag.d.ts +43 -0
- package/esm/_/_getRawTag.d.ts.map +1 -0
- package/esm/_/_getRawTag.js +65 -0
- package/esm/_/_hasPath.d.ts +13 -0
- package/esm/_/_hasPath.d.ts.map +1 -0
- package/esm/_/_hasPath.js +70 -0
- package/esm/_/_isIndex.d.ts +11 -0
- package/esm/_/_isIndex.d.ts.map +1 -0
- package/esm/_/_isIndex.js +51 -0
- package/esm/_/_isIterateeCall.d.ts +13 -0
- package/esm/_/_isIterateeCall.d.ts.map +1 -0
- package/esm/_/_isIterateeCall.js +55 -0
- package/esm/_/_isKey.d.ts +12 -0
- package/esm/_/_isKey.d.ts.map +1 -0
- package/esm/_/_isKey.js +58 -0
- package/esm/_/_isPrototype.d.ts +39 -0
- package/esm/_/_isPrototype.d.ts.map +1 -0
- package/esm/_/_isPrototype.js +43 -0
- package/esm/_/_isStrictComparable.d.ts +9 -0
- package/esm/_/_isStrictComparable.d.ts.map +1 -0
- package/esm/_/_isStrictComparable.js +42 -0
- package/esm/_/_matchesStrictComparable.d.ts +41 -0
- package/esm/_/_matchesStrictComparable.d.ts.map +1 -0
- package/esm/_/_matchesStrictComparable.js +50 -0
- package/esm/_/_stringToPath.d.ts +10 -0
- package/esm/_/_stringToPath.d.ts.map +1 -0
- package/esm/_/_stringToPath.js +64 -0
- package/esm/_/_toKey.d.ts +9 -0
- package/esm/_/_toKey.d.ts.map +1 -0
- package/esm/_/_toKey.js +46 -0
- package/esm/_/cloneDeep.d.ts +14 -0
- package/esm/_/cloneDeep.d.ts.map +1 -0
- package/esm/_/cloneDeep.js +47 -0
- package/esm/_/compact.d.ts +46 -0
- package/esm/_/compact.d.ts.map +1 -0
- package/esm/_/compact.js +23 -0
- package/esm/_/debounce.d.ts +70 -0
- package/esm/_/debounce.d.ts.map +1 -0
- package/esm/_/debounce.js +136 -0
- package/esm/_/eq.d.ts +41 -0
- package/esm/_/eq.d.ts.map +1 -0
- package/esm/_/eq.js +43 -0
- package/esm/_/groupBy.d.ts +19 -0
- package/esm/_/groupBy.d.ts.map +1 -0
- package/esm/_/groupBy.js +49 -0
- package/esm/_/isArguments.d.ts +9 -0
- package/esm/_/isArguments.d.ts.map +1 -0
- package/esm/_/isArguments.js +45 -0
- package/esm/_/isArrayLike.d.ts +25 -0
- package/esm/_/isArrayLike.d.ts.map +1 -0
- package/esm/_/isArrayLike.js +35 -0
- package/esm/_/isEmpty.d.ts +49 -0
- package/esm/_/isEmpty.d.ts.map +1 -0
- package/esm/_/isEmpty.js +57 -0
- package/esm/_/isEqual.d.ts +15 -0
- package/esm/_/isEqual.d.ts.map +1 -0
- package/esm/_/isEqual.js +48 -0
- package/esm/_/isLength.d.ts +41 -0
- package/esm/_/isLength.d.ts.map +1 -0
- package/esm/_/isLength.js +43 -0
- package/esm/_/isObject.d.ts +40 -0
- package/esm/_/isObject.d.ts.map +1 -0
- package/esm/_/isObject.js +42 -0
- package/esm/_/isObjectLike.d.ts +40 -0
- package/esm/_/isObjectLike.d.ts.map +1 -0
- package/esm/_/isObjectLike.js +42 -0
- package/esm/_/isPlainObject.d.ts +10 -0
- package/esm/_/isPlainObject.d.ts.map +1 -0
- package/esm/_/isPlainObject.js +58 -0
- package/esm/_/isSymbol.d.ts +9 -0
- package/esm/_/isSymbol.d.ts.map +1 -0
- package/esm/_/isSymbol.js +45 -0
- package/esm/_/isTypedArray.d.ts +43 -0
- package/esm/_/isTypedArray.d.ts.map +1 -0
- package/esm/_/isTypedArray.js +45 -0
- package/esm/_/omit.d.ts +31 -0
- package/esm/_/omit.d.ts.map +1 -0
- package/esm/_/omit.js +76 -0
- package/esm/_/range.d.ts +24 -0
- package/esm/_/range.d.ts.map +1 -0
- package/esm/_/range.js +56 -0
- package/esm/_/set.d.ts +25 -0
- package/esm/_/set.d.ts.map +1 -0
- package/esm/_/set.js +35 -0
- package/esm/_/toFinite.d.ts +40 -0
- package/esm/_/toFinite.d.ts.map +1 -0
- package/esm/_/toFinite.js +50 -0
- package/esm/_/types.d.ts +70 -0
- package/esm/_/types.d.ts.map +1 -0
- package/esm/_/types.js +2 -0
- package/esm/_/uniqBy.d.ts +13 -0
- package/esm/_/uniqBy.d.ts.map +1 -0
- package/esm/_/uniqBy.js +49 -0
- package/esm/index.d.ts +11 -0
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +11 -0
- package/esm/util.d.ts +337 -0
- package/package.json +3 -3
package/esm/_/_toKey.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
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 { _isSymbol } from "./isSymbol.js";
|
|
33
|
+
/**
|
|
34
|
+
* Converts `value` to a string key if it's not a string or symbol. The sign of `-0` is preserved.
|
|
35
|
+
*
|
|
36
|
+
* @param value - The value to inspect.
|
|
37
|
+
* @returns Returns the key.
|
|
38
|
+
* @internal
|
|
39
|
+
*/
|
|
40
|
+
export function _toKey(value) {
|
|
41
|
+
if (typeof value === "string" || _isSymbol(value)) {
|
|
42
|
+
return value;
|
|
43
|
+
}
|
|
44
|
+
const result = String(value);
|
|
45
|
+
return result === "0" && 1 / value === -Infinity ? "-0" : result;
|
|
46
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Recursively clones `value`.
|
|
3
|
+
*
|
|
4
|
+
* Supports cloning arrays, array buffers, booleans, date objects, maps, numbers, `Object` objects, regexes,
|
|
5
|
+
* sets, strings, symbols, and typed arrays. The own enumerable properties of arguments objects are cloned
|
|
6
|
+
* as plain objects. An empty object is returned for uncloneable values such as error objects, functions,
|
|
7
|
+
* DOM nodes, and WeakMaps; nested uncloneable values are kept by reference.
|
|
8
|
+
*
|
|
9
|
+
* @param value - The value to recursively clone.
|
|
10
|
+
* @returns Returns the deep cloned value.
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
export declare function _cloneDeep<T>(value: T): T;
|
|
14
|
+
//# sourceMappingURL=cloneDeep.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cloneDeep.d.ts","sourceRoot":"","sources":["../../src/_/cloneDeep.ts"],"names":[],"mappings":"AAmCA;;;;;;;;;;;GAWG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAEzC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
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 { _baseClone } from "./_baseClone.js";
|
|
33
|
+
/**
|
|
34
|
+
* Recursively clones `value`.
|
|
35
|
+
*
|
|
36
|
+
* Supports cloning arrays, array buffers, booleans, date objects, maps, numbers, `Object` objects, regexes,
|
|
37
|
+
* sets, strings, symbols, and typed arrays. The own enumerable properties of arguments objects are cloned
|
|
38
|
+
* as plain objects. An empty object is returned for uncloneable values such as error objects, functions,
|
|
39
|
+
* DOM nodes, and WeakMaps; nested uncloneable values are kept by reference.
|
|
40
|
+
*
|
|
41
|
+
* @param value - The value to recursively clone.
|
|
42
|
+
* @returns Returns the deep cloned value.
|
|
43
|
+
* @internal
|
|
44
|
+
*/
|
|
45
|
+
export function _cloneDeep(value) {
|
|
46
|
+
return _baseClone(value);
|
|
47
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Portions of this file are derived from Lodash.
|
|
3
|
+
* https://github.com/lodash/lodash
|
|
4
|
+
*
|
|
5
|
+
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
6
|
+
*
|
|
7
|
+
* Based on Underscore.js, copyright Jeremy Ashkenas,
|
|
8
|
+
* DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
|
|
9
|
+
*
|
|
10
|
+
* Modifications Copyright (c) 2026 GoodData Corporation
|
|
11
|
+
*
|
|
12
|
+
* Permission is hereby granted, free of charge, to any person obtaining
|
|
13
|
+
* a copy of this software and associated documentation files (the
|
|
14
|
+
* "Software"), to deal in the Software without restriction, including
|
|
15
|
+
* without limitation the rights to use, copy, modify, merge, publish,
|
|
16
|
+
* distribute, sublicense, and/or sell copies of the Software, and to
|
|
17
|
+
* permit persons to whom the Software is furnished to do so, subject to
|
|
18
|
+
* the following conditions:
|
|
19
|
+
*
|
|
20
|
+
* The above copyright notice and this permission notice shall be
|
|
21
|
+
* included in all copies or substantial portions of the Software.
|
|
22
|
+
*
|
|
23
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
24
|
+
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
25
|
+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
26
|
+
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
27
|
+
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
28
|
+
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
29
|
+
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
30
|
+
*/
|
|
31
|
+
import type { _List } from "./types.js";
|
|
32
|
+
/** Common interface between Arrays and jQuery objects */
|
|
33
|
+
/**
|
|
34
|
+
* @internal
|
|
35
|
+
*/
|
|
36
|
+
export type _Falsey = null | undefined | false | "" | 0 | 0n;
|
|
37
|
+
/**
|
|
38
|
+
* Creates an array with all falsey values removed. The values `false`, `null`, `0`, `-0`, `0n`, `""`,
|
|
39
|
+
* `undefined`, and `NaN` are falsey. Holes in sparse arrays are skipped as well.
|
|
40
|
+
*
|
|
41
|
+
* @param array - The array or array-like to _compact.
|
|
42
|
+
* @returns Returns the new array of filtered values.
|
|
43
|
+
* @internal
|
|
44
|
+
*/
|
|
45
|
+
export declare function _compact<T>(array: _List<T | _Falsey> | null | undefined): T[];
|
|
46
|
+
//# sourceMappingURL=compact.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compact.d.ts","sourceRoot":"","sources":["../../src/_/compact.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAExC,yDAAyD;AAEzD;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,IAAI,GAAG,SAAS,GAAG,KAAK,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE,CAAC;AAE7D;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,GAAG,OAAO,CAAC,GAAG,IAAI,GAAG,SAAS,GAAG,CAAC,EAAE,CAiB7E"}
|
package/esm/_/compact.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// (C) 2026 GoodData Corporation
|
|
2
|
+
/**
|
|
3
|
+
* Creates an array with all falsey values removed. The values `false`, `null`, `0`, `-0`, `0n`, `""`,
|
|
4
|
+
* `undefined`, and `NaN` are falsey. Holes in sparse arrays are skipped as well.
|
|
5
|
+
*
|
|
6
|
+
* @param array - The array or array-like to _compact.
|
|
7
|
+
* @returns Returns the new array of filtered values.
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export function _compact(array) {
|
|
11
|
+
const result = [];
|
|
12
|
+
if (array == null) {
|
|
13
|
+
return result;
|
|
14
|
+
}
|
|
15
|
+
// a plain index loop, not `filter`, so a non-integer `length` is honoured the way lodash does
|
|
16
|
+
for (let index = 0; index < array.length; index++) {
|
|
17
|
+
const value = array[index];
|
|
18
|
+
if (value) {
|
|
19
|
+
result.push(value);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return result;
|
|
23
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Options for `_debounce`.
|
|
3
|
+
*
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
export type _DebounceSettings = {
|
|
7
|
+
/** Invoke on the leading edge of the timeout. */
|
|
8
|
+
leading?: boolean | undefined;
|
|
9
|
+
/** The maximum time the function is allowed to be delayed before it is invoked. */
|
|
10
|
+
maxWait?: number | undefined;
|
|
11
|
+
/** Invoke on the trailing edge of the timeout. Defaults to `true`. */
|
|
12
|
+
trailing?: boolean | undefined;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* {@link _DebounceSettings} with `leading` switched on, which guarantees a result on every call.
|
|
16
|
+
*
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
export type _DebounceSettingsLeading = _DebounceSettings & {
|
|
20
|
+
leading: true;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* A debounced function: calling it applies the debounce rules and returns the result of the last
|
|
24
|
+
* invocation, or `undefined` before the first one.
|
|
25
|
+
*
|
|
26
|
+
* @internal
|
|
27
|
+
*/
|
|
28
|
+
export type _DebouncedFunc<T extends (...args: any[]) => any> = {
|
|
29
|
+
(...args: Parameters<T>): ReturnType<T> | undefined;
|
|
30
|
+
/** Throws away any pending invocation. */
|
|
31
|
+
cancel(): void;
|
|
32
|
+
/** Invokes a pending invocation immediately and returns its result, else returns the last result. */
|
|
33
|
+
flush(): ReturnType<T> | undefined;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* A debounced function created with `leading: true`, so a call always has a result.
|
|
37
|
+
*
|
|
38
|
+
* @internal
|
|
39
|
+
*/
|
|
40
|
+
export type _DebouncedFuncLeading<T extends (...args: any[]) => any> = {
|
|
41
|
+
(...args: Parameters<T>): ReturnType<T>;
|
|
42
|
+
flush(): ReturnType<T>;
|
|
43
|
+
} & _DebouncedFunc<T>;
|
|
44
|
+
/**
|
|
45
|
+
* Creates a debounced function that delays invoking `func` until after `wait` milliseconds have elapsed
|
|
46
|
+
* since the last time the debounced function was invoked. The debounced function comes with a `cancel`
|
|
47
|
+
* method to cancel delayed `func` invocations and a `flush` method to immediately invoke them. Provide
|
|
48
|
+
* `options` to indicate whether `func` should be invoked on the leading and/or trailing edge of the
|
|
49
|
+
* `wait` timeout. The `func` is invoked with the last arguments provided to the debounced function.
|
|
50
|
+
* Subsequent calls to the debounced function return the result of the last `func` invocation.
|
|
51
|
+
*
|
|
52
|
+
* **Note:** If `leading` and `trailing` options are `true`, `func` is invoked on the trailing edge of
|
|
53
|
+
* the timeout only if the debounced function is invoked more than once during the `wait` timeout.
|
|
54
|
+
*
|
|
55
|
+
* If `wait` is `0` and `leading` is `false`, `func` invocation is deferred until the next tick, similar
|
|
56
|
+
* to `setTimeout` with a timeout of `0`.
|
|
57
|
+
*
|
|
58
|
+
* @param func - The function to debounce.
|
|
59
|
+
* @param wait - The number of milliseconds to delay.
|
|
60
|
+
* @param options - The options object.
|
|
61
|
+
* @returns Returns the new debounced function.
|
|
62
|
+
* @internal
|
|
63
|
+
*/
|
|
64
|
+
export declare function _debounce<T extends (...args: any) => any>(func: T, wait: number | undefined, options: _DebounceSettingsLeading): _DebouncedFuncLeading<T>;
|
|
65
|
+
/**
|
|
66
|
+
* @see _debounce
|
|
67
|
+
* @internal
|
|
68
|
+
*/
|
|
69
|
+
export declare function _debounce<T extends (...args: any) => any>(func: T, wait?: number, options?: _DebounceSettings): _DebouncedFunc<T>;
|
|
70
|
+
//# sourceMappingURL=debounce.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debounce.d.ts","sourceRoot":"","sources":["../../src/_/debounce.ts"],"names":[],"mappings":"AAmCA;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC5B,iDAAiD;IACjD,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,mFAAmF;IACnF,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,sEAAsE;IACtE,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAClC,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,wBAAwB,GAAG,iBAAiB,GAAG;IACvD,OAAO,EAAE,IAAI,CAAC;CACjB,CAAC;AAEF;;;;;GAKG;AAEH,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,IAAI;IAC5D,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;IACpD,0CAA0C;IAC1C,MAAM,IAAI,IAAI,CAAC;IACf,qGAAqG;IACrG,KAAK,IAAI,UAAU,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;CACtC,CAAC;AAEF;;;;GAIG;AAGH,MAAM,MAAM,qBAAqB,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,IAAI;IACnE,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;IACxC,KAAK,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC;CAC1B,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC;AAEtB;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,wBAAgB,SAAS,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,KAAK,GAAG,EACrD,IAAI,EAAE,CAAC,EACP,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,OAAO,EAAE,wBAAwB,GAClC,qBAAqB,CAAC,CAAC,CAAC,CAAC;AAC5B;;;GAGG;AAEH,wBAAgB,SAAS,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,KAAK,GAAG,EACrD,IAAI,EAAE,CAAC,EACP,IAAI,CAAC,EAAE,MAAM,EACb,OAAO,CAAC,EAAE,iBAAiB,GAC5B,cAAc,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,136 @@
|
|
|
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 { _isObject } from "./isObject.js";
|
|
33
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
|
|
34
|
+
export function _debounce(func, wait, options) {
|
|
35
|
+
if (typeof func !== "function") {
|
|
36
|
+
throw new TypeError("Expected a function");
|
|
37
|
+
}
|
|
38
|
+
const delay = Number(wait) || 0;
|
|
39
|
+
const settings = _isObject(options) ? options : {};
|
|
40
|
+
const leading = !!settings.leading;
|
|
41
|
+
const maxing = "maxWait" in settings;
|
|
42
|
+
const maxWait = maxing ? Math.max(Number(settings.maxWait) || 0, delay) : 0;
|
|
43
|
+
const trailing = "trailing" in settings ? !!settings.trailing : true;
|
|
44
|
+
let lastArgs;
|
|
45
|
+
let lastThis;
|
|
46
|
+
let lastCallTime;
|
|
47
|
+
let lastInvokeTime = 0;
|
|
48
|
+
let timerId;
|
|
49
|
+
let result;
|
|
50
|
+
function invokeFunc(time) {
|
|
51
|
+
const args = lastArgs;
|
|
52
|
+
const thisArg = lastThis;
|
|
53
|
+
lastArgs = lastThis = undefined;
|
|
54
|
+
lastInvokeTime = time;
|
|
55
|
+
const value = func.apply(thisArg, args);
|
|
56
|
+
result = value;
|
|
57
|
+
return value;
|
|
58
|
+
}
|
|
59
|
+
function leadingEdge(time) {
|
|
60
|
+
// reset any `maxWait` timer and start the timer for the trailing edge
|
|
61
|
+
lastInvokeTime = time;
|
|
62
|
+
timerId = setTimeout(timerExpired, delay);
|
|
63
|
+
return leading ? invokeFunc(time) : result;
|
|
64
|
+
}
|
|
65
|
+
function remainingWait(time) {
|
|
66
|
+
const timeSinceLastCall = time - lastCallTime;
|
|
67
|
+
const timeSinceLastInvoke = time - lastInvokeTime;
|
|
68
|
+
const timeWaiting = delay - timeSinceLastCall;
|
|
69
|
+
return maxing ? Math.min(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
|
|
70
|
+
}
|
|
71
|
+
function shouldInvoke(time) {
|
|
72
|
+
if (lastCallTime === undefined) {
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
75
|
+
const timeSinceLastCall = time - lastCallTime;
|
|
76
|
+
const timeSinceLastInvoke = time - lastInvokeTime;
|
|
77
|
+
// activity has stopped and this is the trailing edge, the system clock went backwards, or the
|
|
78
|
+
// `maxWait` limit was hit
|
|
79
|
+
return (timeSinceLastCall >= delay || timeSinceLastCall < 0 || (maxing && timeSinceLastInvoke >= maxWait));
|
|
80
|
+
}
|
|
81
|
+
function timerExpired() {
|
|
82
|
+
const time = Date.now();
|
|
83
|
+
if (shouldInvoke(time)) {
|
|
84
|
+
trailingEdge(time);
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
// restart the timer for what is left of the wait
|
|
88
|
+
timerId = setTimeout(timerExpired, remainingWait(time));
|
|
89
|
+
}
|
|
90
|
+
function trailingEdge(time) {
|
|
91
|
+
timerId = undefined;
|
|
92
|
+
// only invoke if there are `lastArgs`, which means `func` has been debounced at least once
|
|
93
|
+
if (trailing && lastArgs) {
|
|
94
|
+
return invokeFunc(time);
|
|
95
|
+
}
|
|
96
|
+
lastArgs = lastThis = undefined;
|
|
97
|
+
return result;
|
|
98
|
+
}
|
|
99
|
+
function cancel() {
|
|
100
|
+
if (timerId !== undefined) {
|
|
101
|
+
clearTimeout(timerId);
|
|
102
|
+
}
|
|
103
|
+
lastInvokeTime = 0;
|
|
104
|
+
lastArgs = lastCallTime = lastThis = timerId = undefined;
|
|
105
|
+
}
|
|
106
|
+
function flush() {
|
|
107
|
+
return timerId === undefined ? result : trailingEdge(Date.now());
|
|
108
|
+
}
|
|
109
|
+
function debounced(...args) {
|
|
110
|
+
const time = Date.now();
|
|
111
|
+
const isInvoking = shouldInvoke(time);
|
|
112
|
+
lastArgs = args;
|
|
113
|
+
// the `this` of the latest call has to be kept for the deferred invocation
|
|
114
|
+
// oxlint-disable-next-line @typescript-eslint/no-this-alias
|
|
115
|
+
lastThis = this;
|
|
116
|
+
lastCallTime = time;
|
|
117
|
+
if (isInvoking) {
|
|
118
|
+
if (timerId === undefined) {
|
|
119
|
+
return leadingEdge(lastCallTime);
|
|
120
|
+
}
|
|
121
|
+
if (maxing) {
|
|
122
|
+
// handle invocations in a tight loop
|
|
123
|
+
clearTimeout(timerId);
|
|
124
|
+
timerId = setTimeout(timerExpired, delay);
|
|
125
|
+
return invokeFunc(lastCallTime);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
if (timerId === undefined) {
|
|
129
|
+
timerId = setTimeout(timerExpired, delay);
|
|
130
|
+
}
|
|
131
|
+
return result;
|
|
132
|
+
}
|
|
133
|
+
debounced.cancel = cancel;
|
|
134
|
+
debounced.flush = flush;
|
|
135
|
+
return debounced;
|
|
136
|
+
}
|
package/esm/_/eq.d.ts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Portions of this file are derived from Lodash.
|
|
3
|
+
* https://github.com/lodash/lodash
|
|
4
|
+
*
|
|
5
|
+
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
6
|
+
*
|
|
7
|
+
* Based on Underscore.js, copyright Jeremy Ashkenas,
|
|
8
|
+
* DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
|
|
9
|
+
*
|
|
10
|
+
* Modifications Copyright (c) 2026 GoodData Corporation
|
|
11
|
+
*
|
|
12
|
+
* Permission is hereby granted, free of charge, to any person obtaining
|
|
13
|
+
* a copy of this software and associated documentation files (the
|
|
14
|
+
* "Software"), to deal in the Software without restriction, including
|
|
15
|
+
* without limitation the rights to use, copy, modify, merge, publish,
|
|
16
|
+
* distribute, sublicense, and/or sell copies of the Software, and to
|
|
17
|
+
* permit persons to whom the Software is furnished to do so, subject to
|
|
18
|
+
* the following conditions:
|
|
19
|
+
*
|
|
20
|
+
* The above copyright notice and this permission notice shall be
|
|
21
|
+
* included in all copies or substantial portions of the Software.
|
|
22
|
+
*
|
|
23
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
24
|
+
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
25
|
+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
26
|
+
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
27
|
+
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
28
|
+
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
29
|
+
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
30
|
+
*/
|
|
31
|
+
/**
|
|
32
|
+
* Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) comparison
|
|
33
|
+
* between two values to determine if they are equivalent: like `===`, except that `NaN` equals `NaN`.
|
|
34
|
+
*
|
|
35
|
+
* @param value - The value to compare.
|
|
36
|
+
* @param other - The other value to compare.
|
|
37
|
+
* @returns Returns `true` if the values are equivalent, else `false`.
|
|
38
|
+
* @internal
|
|
39
|
+
*/
|
|
40
|
+
export declare function _eq(value: unknown, other: unknown): boolean;
|
|
41
|
+
//# sourceMappingURL=eq.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eq.d.ts","sourceRoot":"","sources":["../../src/_/eq.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH;;;;;;;;GAQG;AACH,wBAAgB,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAE3D"}
|
package/esm/_/eq.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
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
|
+
/**
|
|
33
|
+
* Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) comparison
|
|
34
|
+
* between two values to determine if they are equivalent: like `===`, except that `NaN` equals `NaN`.
|
|
35
|
+
*
|
|
36
|
+
* @param value - The value to compare.
|
|
37
|
+
* @param other - The other value to compare.
|
|
38
|
+
* @returns Returns `true` if the values are equivalent, else `false`.
|
|
39
|
+
* @internal
|
|
40
|
+
*/
|
|
41
|
+
export function _eq(value, other) {
|
|
42
|
+
return value === other || (value !== value && other !== other);
|
|
43
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { _Dictionary, _List, _ValueIteratee } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Creates an object composed of keys generated from the results of running each element of
|
|
4
|
+
* `collection` thru `iteratee`. The order of grouped values is determined by the order they occur in
|
|
5
|
+
* `collection`. The corresponding value of each key is an array of elements responsible for generating
|
|
6
|
+
* the key. The iteratee is invoked with one argument: (value).
|
|
7
|
+
*
|
|
8
|
+
* @param collection - The collection to iterate over.
|
|
9
|
+
* @param iteratee - The iteratee to transform keys.
|
|
10
|
+
* @returns Returns the composed aggregate object.
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
export declare function _groupBy<T>(collection: _List<T> | null | undefined, iteratee?: _ValueIteratee<T>): _Dictionary<T[]>;
|
|
14
|
+
/**
|
|
15
|
+
* @see _groupBy
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
18
|
+
export declare function _groupBy<T extends object>(collection: T | null | undefined, iteratee?: _ValueIteratee<T[keyof T]>): _Dictionary<Array<T[keyof T]>>;
|
|
19
|
+
//# sourceMappingURL=groupBy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"groupBy.d.ts","sourceRoot":"","sources":["../../src/_/groupBy.ts"],"names":[],"mappings":"AAoCA,OAAO,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAErE;;;;;;;;;;GAUG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EACtB,UAAU,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,SAAS,EACvC,QAAQ,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC,GAC7B,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC;AACpB;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,MAAM,EACrC,UAAU,EAAE,CAAC,GAAG,IAAI,GAAG,SAAS,EAChC,QAAQ,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GACtC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC"}
|
package/esm/_/groupBy.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
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 { _assignValue } from "./_assignValue.js";
|
|
33
|
+
import { _baseEach } from "./_baseEach.js";
|
|
34
|
+
import { _baseIteratee } from "./_baseIteratee.js";
|
|
35
|
+
export function _groupBy(collection, iteratee) {
|
|
36
|
+
const result = {};
|
|
37
|
+
const toKey = _baseIteratee(iteratee);
|
|
38
|
+
_baseEach(collection, (value) => {
|
|
39
|
+
const key = toKey(value);
|
|
40
|
+
if (Object.hasOwn(result, key)) {
|
|
41
|
+
result[key].push(value);
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
// defines a `__proto__` key as an own property instead of changing the prototype
|
|
45
|
+
_assignValue(result, key, [value]);
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
return result;
|
|
49
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks if value is classified as an arguments object.
|
|
3
|
+
*
|
|
4
|
+
* @param value - The value to check.
|
|
5
|
+
* @returns Returns true if value is correctly classified, else false.
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export declare function _isArguments(value?: unknown): value is IArguments;
|
|
9
|
+
//# sourceMappingURL=isArguments.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isArguments.d.ts","sourceRoot":"","sources":["../../src/_/isArguments.ts"],"names":[],"mappings":"AAuCA;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,KAAK,IAAI,UAAU,CAEjE"}
|
|
@@ -0,0 +1,45 @@
|
|
|
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 { _baseGetTag } from "./_baseGetTag.js";
|
|
33
|
+
import { _isObjectLike } from "./isObjectLike.js";
|
|
34
|
+
/** `Object#toString` result references. */
|
|
35
|
+
const ARGS_TAG = "[object Arguments]";
|
|
36
|
+
/**
|
|
37
|
+
* Checks if value is classified as an arguments object.
|
|
38
|
+
*
|
|
39
|
+
* @param value - The value to check.
|
|
40
|
+
* @returns Returns true if value is correctly classified, else false.
|
|
41
|
+
* @internal
|
|
42
|
+
*/
|
|
43
|
+
export function _isArguments(value) {
|
|
44
|
+
return _isObjectLike(value) && _baseGetTag(value) === ARGS_TAG;
|
|
45
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks if `value` is array-like. A value is considered array-like if it's
|
|
3
|
+
* not a function and has a `value.length` that's an integer greater than or
|
|
4
|
+
* equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
|
|
5
|
+
*
|
|
6
|
+
* @param value - The value to check.
|
|
7
|
+
* @returns Returns `true` if `value` is array-like, else `false`.
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export declare function _isArrayLike<T extends {
|
|
11
|
+
__lodashAnyHack: any;
|
|
12
|
+
}>(t: T): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* @see _isArrayLike
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
17
|
+
export declare function _isArrayLike(value: ((...args: any[]) => any) | null | undefined): value is never;
|
|
18
|
+
/**
|
|
19
|
+
* @see _isArrayLike
|
|
20
|
+
* @internal
|
|
21
|
+
*/
|
|
22
|
+
export declare function _isArrayLike(value: any): value is {
|
|
23
|
+
length: number;
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=isArrayLike.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isArrayLike.d.ts","sourceRoot":"","sources":["../../src/_/isArrayLike.ts"],"names":[],"mappings":"AAmCA;;;;;;;;GAQG;AAEH,wBAAgB,YAAY,CAAC,CAAC,SAAS;IAAE,eAAe,EAAE,GAAG,CAAA;CAAE,EAAE,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC;AAChF;;;GAGG;AAEH,wBAAgB,YAAY,CAAC,KAAK,EAAE,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC,GAAG,IAAI,GAAG,SAAS,GAAG,KAAK,IAAI,KAAK,CAAC;AAClG;;;GAGG;AAEH,wBAAgB,YAAY,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC"}
|