@gooddata/util 11.68.0-alpha.4 → 11.68.0-alpha.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/NOTICE +177 -0
  2. package/esm/_/_arrayAggregator.d.ts +42 -0
  3. package/esm/_/_arrayAggregator.d.ts.map +1 -0
  4. package/esm/_/_arrayAggregator.js +51 -0
  5. package/esm/_/_assignValue.d.ts.map +1 -1
  6. package/esm/_/_assignValue.js +2 -6
  7. package/esm/_/_baseAggregator.d.ts +13 -0
  8. package/esm/_/_baseAggregator.d.ts.map +1 -0
  9. package/esm/_/_baseAggregator.js +50 -0
  10. package/esm/_/_baseAssignValue.d.ts +41 -0
  11. package/esm/_/_baseAssignValue.d.ts.map +1 -0
  12. package/esm/_/_baseAssignValue.js +48 -0
  13. package/esm/_/_baseClone.d.ts.map +1 -1
  14. package/esm/_/_baseClone.js +3 -30
  15. package/esm/_/_baseMerge.d.ts +15 -0
  16. package/esm/_/_baseMerge.d.ts.map +1 -0
  17. package/esm/_/_baseMerge.js +137 -0
  18. package/esm/_/_baseOrderBy.d.ts +11 -0
  19. package/esm/_/_baseOrderBy.d.ts.map +1 -0
  20. package/esm/_/_baseOrderBy.js +70 -0
  21. package/esm/_/_cloneArrayBuffer.d.ts +39 -0
  22. package/esm/_/_cloneArrayBuffer.d.ts.map +1 -0
  23. package/esm/_/_cloneArrayBuffer.js +45 -0
  24. package/esm/_/_cloneTypedArray.d.ts +10 -0
  25. package/esm/_/_cloneTypedArray.d.ts.map +1 -0
  26. package/esm/_/_cloneTypedArray.js +49 -0
  27. package/esm/_/_compareAscending.d.ts +12 -0
  28. package/esm/_/_compareAscending.d.ts.map +1 -0
  29. package/esm/_/_compareAscending.js +78 -0
  30. package/esm/_/_createAggregator.d.ts +10 -0
  31. package/esm/_/_createAggregator.d.ts.map +1 -0
  32. package/esm/_/_createAggregator.js +50 -0
  33. package/esm/_/_initCloneObject.d.ts +10 -0
  34. package/esm/_/_initCloneObject.d.ts.map +1 -0
  35. package/esm/_/_initCloneObject.js +48 -0
  36. package/esm/_/_unicode.d.ts +27 -0
  37. package/esm/_/_unicode.d.ts.map +1 -0
  38. package/esm/_/_unicode.js +120 -0
  39. package/esm/_/camelCase.d.ts +11 -0
  40. package/esm/_/camelCase.d.ts.map +1 -0
  41. package/esm/_/camelCase.js +56 -0
  42. package/esm/_/deburr.d.ts +10 -0
  43. package/esm/_/deburr.d.ts.map +1 -0
  44. package/esm/_/deburr.js +242 -0
  45. package/esm/_/isArray.d.ts +61 -0
  46. package/esm/_/isArray.d.ts.map +1 -0
  47. package/esm/_/isArray.js +62 -0
  48. package/esm/_/keysIn.d.ts +10 -0
  49. package/esm/_/keysIn.d.ts.map +1 -0
  50. package/esm/_/keysIn.js +54 -0
  51. package/esm/_/memoize.d.ts +89 -0
  52. package/esm/_/memoize.d.ts.map +1 -0
  53. package/esm/_/memoize.js +36 -0
  54. package/esm/_/merge.d.ts +32 -0
  55. package/esm/_/merge.d.ts.map +1 -0
  56. package/esm/_/merge.js +45 -0
  57. package/esm/_/omit.d.ts +1 -5
  58. package/esm/_/omit.d.ts.map +1 -1
  59. package/esm/_/partition.d.ts +23 -0
  60. package/esm/_/partition.d.ts.map +1 -0
  61. package/esm/_/partition.js +42 -0
  62. package/esm/_/pick.d.ts +18 -0
  63. package/esm/_/pick.d.ts.map +1 -0
  64. package/esm/_/pick.js +48 -0
  65. package/esm/_/sortBy.d.ts +17 -0
  66. package/esm/_/sortBy.d.ts.map +1 -0
  67. package/esm/_/sortBy.js +46 -0
  68. package/esm/_/throttle.d.ts +76 -0
  69. package/esm/_/throttle.d.ts.map +1 -0
  70. package/esm/_/throttle.js +45 -0
  71. package/esm/_/types.d.ts +26 -0
  72. package/esm/_/types.d.ts.map +1 -1
  73. package/esm/_/uniq.d.ts +12 -0
  74. package/esm/_/uniq.d.ts.map +1 -0
  75. package/esm/_/uniq.js +47 -0
  76. package/esm/_/words.d.ts +9 -0
  77. package/esm/_/words.d.ts.map +1 -0
  78. package/esm/_/words.js +50 -0
  79. package/esm/index.d.ts +10 -2
  80. package/esm/index.d.ts.map +1 -1
  81. package/esm/index.js +8 -0
  82. package/esm/util.d.ts +254 -0
  83. package/package.json +5 -4
package/esm/_/uniq.js ADDED
@@ -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 { _baseUniq } from "./_baseUniq.js";
33
+ /**
34
+ * Creates a duplicate-free version of an array, using SameValueZero for equality comparisons, in which
35
+ * only the first occurrence of each element is kept. The order of result values is determined by the
36
+ * order they occur in the array.
37
+ *
38
+ * @param array - The array to inspect.
39
+ * @returns Returns the new duplicate free array.
40
+ * @internal
41
+ */
42
+ export function _uniq(array) {
43
+ if (!array?.length) {
44
+ return [];
45
+ }
46
+ return _baseUniq(array);
47
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Splits `string` into an array of its words.
3
+ *
4
+ * @param string - The string to inspect.
5
+ * @returns Returns the words of `string`.
6
+ * @internal
7
+ */
8
+ export declare function _words(string: string): string[];
9
+ //# sourceMappingURL=words.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"words.d.ts","sourceRoot":"","sources":["../../src/_/words.ts"],"names":[],"mappings":"AA0CA;;;;;;GAMG;AACH,wBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAM/C"}
package/esm/_/words.js ADDED
@@ -0,0 +1,50 @@
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 { _unicodeWords } from "./_unicode.js";
33
+ /** Used to match words composed of alphanumeric characters. */
34
+ // oxlint-disable-next-line no-control-regex -- the word class deliberately excludes the control characters
35
+ const RE_ASCII_WORD = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
36
+ /** Used to detect strings that need a more robust regexp to match words. */
37
+ const RE_HAS_UNICODE_WORD = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
38
+ /**
39
+ * Splits `string` into an array of its words.
40
+ *
41
+ * @param string - The string to inspect.
42
+ * @returns Returns the words of `string`.
43
+ * @internal
44
+ */
45
+ export function _words(string) {
46
+ if (RE_HAS_UNICODE_WORD.test(string)) {
47
+ return _unicodeWords(string);
48
+ }
49
+ return string.match(RE_ASCII_WORD) ?? [];
50
+ }
package/esm/index.d.ts CHANGED
@@ -12,15 +12,23 @@ export { type IShortenTextOptions, hashCodeString, randomString, shortenText, es
12
12
  export { removeMetadata, sanitizeLocaleForMoment } from "./translationUtils.js";
13
13
  export { type GuardType, type EmptyObject, combineGuards } from "./typesUtils.js";
14
14
  export { type MatcherFunction, type ConsoleFunction, type Matcher, type SpecificMatcherFunction, type ConsoleType, type WaitForFn, delay, strictBarrel, suppressConsole, createTightWaitFor, } from "./testUtils.js";
15
+ export { _camelCase } from "./_/camelCase.js";
15
16
  export { _cloneDeep } from "./_/cloneDeep.js";
16
17
  export { type _Falsey, _compact } from "./_/compact.js";
17
18
  export { type _DebouncedFunc, type _DebouncedFuncLeading, type _DebounceSettings, type _DebounceSettingsLeading, _debounce, } from "./_/debounce.js";
18
19
  export { _groupBy } from "./_/groupBy.js";
19
20
  export { _isEqual } from "./_/isEqual.js";
20
21
  export { type _EmptyObject, type _EmptyObjectOf, _isEmpty } from "./_/isEmpty.js";
21
- export { type _PartialObject, _omit } from "./_/omit.js";
22
+ export { type _MapCache, type _MapCacheConstructor, type _Memoize, type _MemoizedFunction, _memoize, } from "./_/memoize.js";
23
+ export { _merge } from "./_/merge.js";
24
+ export { _omit } from "./_/omit.js";
25
+ export { _partition } from "./_/partition.js";
26
+ export { _pick } from "./_/pick.js";
22
27
  export { _range } from "./_/range.js";
23
28
  export { type _PropertyPath, _set } from "./_/set.js";
29
+ export { _sortBy } from "./_/sortBy.js";
30
+ export { type _ThrottleSettings, type _ThrottleSettingsLeading, _throttle } from "./_/throttle.js";
31
+ export { _uniq } from "./_/uniq.js";
24
32
  export { _uniqBy } from "./_/uniqBy.js";
25
- export type { _Dictionary, _IterateeShorthand, _List, _Many, _NotVoid, _PartialShallow, _PropertyName, _ValueIteratee, } from "./_/types.js";
33
+ export type { _Dictionary, _IterateeShorthand, _List, _ListIteratee, _ListIterator, _Many, _NotVoid, _ObjectIteratee, _ObjectIterator, _PartialObject, _PartialShallow, _PropertyName, _ValueIteratee, _ValueIteratorTypeGuard, } from "./_/types.js";
26
34
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EACH,KAAK,mBAAmB,EACxB,cAAc,EACd,YAAY,EACZ,WAAW,E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AAiB,EACtB,QAAQ,GACX,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,KAAK,aAAa,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,wBAAwB,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACnG,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,YAAY,EACR,WAAW,EACX,kBAAkB,EAClB,KAAK,EACL,aAAa,EACb,aAAa,EACb,KAAK,EACL,QAAQ,EACR,eAAe,EACf,eAAe,EACf,cAAc,EACd,eAAe,EACf,aAAa,EACb,cAAc,EACd,uBAAuB,GAC1B,MAAM,cAAc,CAAC"}
package/esm/index.js CHANGED
@@ -15,13 +15,21 @@ export { removeMetadata, sanitizeLocaleForMoment } from "./translationUtils.js";
15
15
  export { combineGuards } from "./typesUtils.js";
16
16
  export { delay, strictBarrel, suppressConsole, createTightWaitFor, } from "./testUtils.js";
17
17
  // local functions from lodash-es
18
+ export { _camelCase } from "./_/camelCase.js";
18
19
  export { _cloneDeep } from "./_/cloneDeep.js";
19
20
  export { _compact } from "./_/compact.js";
20
21
  export { _debounce, } from "./_/debounce.js";
21
22
  export { _groupBy } from "./_/groupBy.js";
22
23
  export { _isEqual } from "./_/isEqual.js";
23
24
  export { _isEmpty } from "./_/isEmpty.js";
25
+ export { _memoize, } from "./_/memoize.js";
26
+ export { _merge } from "./_/merge.js";
24
27
  export { _omit } from "./_/omit.js";
28
+ export { _partition } from "./_/partition.js";
29
+ export { _pick } from "./_/pick.js";
25
30
  export { _range } from "./_/range.js";
26
31
  export { _set } from "./_/set.js";
32
+ export { _sortBy } from "./_/sortBy.js";
33
+ export { _throttle } from "./_/throttle.js";
34
+ export { _uniq } from "./_/uniq.js";
27
35
  export { _uniqBy } from "./_/uniqBy.js";
package/esm/util.d.ts CHANGED
@@ -7,6 +7,17 @@
7
7
  * @packageDocumentation
8
8
  */
9
9
 
10
+ /**
11
+ * Converts `string` to camel case: the string is deburred, split into words (on separators, case changes,
12
+ * digits and Unicode boundaries, as lodash does), each word is lower-cased and every word but the first is
13
+ * capitalised.
14
+ *
15
+ * @param string - The string to convert.
16
+ * @returns Returns the camel cased string.
17
+ * @internal
18
+ */
19
+ export declare function _camelCase(string?: string): string;
20
+
10
21
  /**
11
22
  * Recursively clones `value`.
12
23
  *
@@ -304,11 +315,45 @@ export declare type _IterateeShorthand<T> = _PropertyName | [_PropertyName, any]
304
315
  */
305
316
  export declare type _List<T> = ArrayLike<T>;
306
317
 
318
+ /**
319
+ * @internal
320
+ */
321
+ export declare type _ListIteratee<T> = _ListIterator<T, _NotVoid> | _IterateeShorthand<T>;
322
+
323
+ /**
324
+ * @internal
325
+ */
326
+ export declare type _ListIterator<T, TResult> = (value: T, index: number, collection: _List<T>) => TResult;
327
+
307
328
  /**
308
329
  * @internal
309
330
  */
310
331
  export declare type _Many<T> = T | readonly T[];
311
332
 
333
+ /**
334
+ * The cache a memoized function keeps its results in. Keys are compared by SameValueZero, as a `Map`
335
+ * does, so `NaN` equals `NaN` and objects compare by reference.
336
+ *
337
+ * @internal
338
+ */
339
+ export declare type _MapCache = {
340
+ /** Removes `key` and its value from the cache; returns whether the entry was removed. */
341
+ delete(key: unknown): boolean;
342
+ /** Gets the cached value for `key`. */
343
+ get(key: unknown): unknown;
344
+ /** Checks if a cached value for `key` exists. */
345
+ has(key: unknown): boolean;
346
+ /** Sets `value` to `key` of the cache; a cache that returns itself here lets `set` be chained. */
347
+ set(key: unknown, value: unknown): unknown;
348
+ /** Removes all entries from the cache. */
349
+ clear?: (() => void) | undefined;
350
+ };
351
+
352
+ /**
353
+ * @internal
354
+ */
355
+ export declare type _MapCacheConstructor = new () => _MapCache;
356
+
312
357
  /**
313
358
  * A matcher for suppressConsole
314
359
  *
@@ -329,11 +374,96 @@ export declare type Matcher = {
329
374
  */
330
375
  export declare type MatcherFunction = (console: Record<ConsoleType, ConsoleFunction>, type: ConsoleType, message: string) => boolean;
331
376
 
377
+ /**
378
+ * The shape of `_memoize`: the memoizing function itself plus the `Cache` constructor every memoized
379
+ * function starts with.
380
+ *
381
+ * @internal
382
+ */
383
+ export declare type _Memoize = {
384
+ <T extends (...args: any) => any>(func: T, resolver?: (this: ThisParameterType<T>, ...args: Parameters<T>) => unknown): T & _MemoizedFunction;
385
+ /** The constructor of the cache every memoized function starts with; a native `Map` unless replaced. */
386
+ Cache: _MapCacheConstructor;
387
+ };
388
+
389
+ /**
390
+ * Creates a function that memoizes the result of `func`. If `resolver` is provided, it determines the
391
+ * cache key for storing the result based on the arguments provided to the memoized function. By
392
+ * default, the first argument provided to the memoized function is used as the map cache key. The
393
+ * `func` is invoked with the `this` binding of the memoized function.
394
+ *
395
+ * **Note:** The cache is exposed as the `cache` property on the memoized function. Its creation may be
396
+ * customized by replacing the `_memoize.Cache` constructor with one whose instances implement the
397
+ * `Map` method interface of `clear`, `delete`, `get`, `has`, and `set`.
398
+ *
399
+ * @param func - The function to have its output memoized.
400
+ * @param resolver - The function to resolve the cache key.
401
+ * @returns Returns the new memoized function.
402
+ * @internal
403
+ */
404
+ export declare const _memoize: _Memoize;
405
+
406
+ /**
407
+ * What `_memoize` adds to the function it returns.
408
+ *
409
+ * @internal
410
+ */
411
+ export declare type _MemoizedFunction = {
412
+ /** The cache of results, exposed so callers can inspect or edit it. */
413
+ cache: _MapCache;
414
+ };
415
+
416
+ /**
417
+ * Recursively merges own and inherited enumerable string keyed properties of source objects into the
418
+ * destination object. Source properties that resolve to `undefined` are skipped if a destination value
419
+ * exists. Array and plain object properties are merged recursively. Other objects and value types are
420
+ * overridden by assignment. Source objects are applied from left to right. Subsequent sources overwrite
421
+ * property assignments of previous sources.
422
+ *
423
+ * **Note:** This method mutates `object`.
424
+ *
425
+ * @param object - The destination object.
426
+ * @param sources - The source objects.
427
+ * @returns Returns `object`.
428
+ * @internal
429
+ */
430
+ export declare function _merge<TObject, TSource>(object: TObject, source: TSource): TObject & TSource;
431
+
432
+ /**
433
+ * @internal
434
+ */
435
+ export declare function _merge<TObject, TSource1, TSource2>(object: TObject, source1: TSource1, source2: TSource2): TObject & TSource1 & TSource2;
436
+
437
+ /**
438
+ * @internal
439
+ */
440
+ export declare function _merge<TObject, TSource1, TSource2, TSource3>(object: TObject, source1: TSource1, source2: TSource2, source3: TSource3): TObject & TSource1 & TSource2 & TSource3;
441
+
442
+ /**
443
+ * @internal
444
+ */
445
+ export declare function _merge<TObject, TSource1, TSource2, TSource3, TSource4>(object: TObject, source1: TSource1, source2: TSource2, source3: TSource3, source4: TSource4): TObject & TSource1 & TSource2 & TSource3 & TSource4;
446
+
447
+ /**
448
+ * @internal
449
+ */
450
+ export declare function _merge(object: any, ...otherArgs: any[]): any;
451
+
332
452
  /**
333
453
  * @internal
334
454
  */
335
455
  export declare type _NotVoid = unknown;
336
456
 
457
+ /**
458
+ * @internal
459
+ */
460
+ export declare type _ObjectIteratee<TObject> = _ObjectIterator<TObject, _NotVoid> | _IterateeShorthand<TObject[keyof TObject]>;
461
+
462
+ /**
463
+ * @internal
464
+ */
465
+ export declare type _ObjectIterator<TObject, TResult> = (value: TObject[keyof TObject], key: string, collection: TObject) => TResult;
466
+
337
467
  /**
338
468
  * The opposite of `pick`; this method creates an object composed of the own and inherited enumerable
339
469
  * property paths of `object` that are not omitted.
@@ -384,6 +514,47 @@ export declare type _PartialShallow<T> = {
384
514
  [P in keyof T]?: T[P] extends object ? object : T[P];
385
515
  };
386
516
 
517
+ /**
518
+ * Creates an array of elements split into two groups, the first of which contains elements `predicate`
519
+ * returns truthy for, the second of which contains elements `predicate` returns falsey for. The
520
+ * predicate is invoked with one argument: (value).
521
+ *
522
+ * @param collection - The collection to iterate over.
523
+ * @param predicate - The function invoked per iteration.
524
+ * @returns Returns the array of grouped elements.
525
+ * @internal
526
+ */
527
+ export declare function _partition<T, U extends T>(collection: _List<T> | null | undefined, predicate: _ValueIteratorTypeGuard<T, U>): [U[], Array<Exclude<T, U>>];
528
+
529
+ /**
530
+ * @see _partition
531
+ * @internal
532
+ */
533
+ export declare function _partition<T>(collection: _List<T> | null | undefined, predicate: _ValueIteratee<T>): [T[], T[]];
534
+
535
+ /**
536
+ * @see _partition
537
+ * @internal
538
+ */
539
+ export declare function _partition<T extends object>(collection: T | null | undefined, predicate: _ValueIteratee<T[keyof T]>): [Array<T[keyof T]>, Array<T[keyof T]>];
540
+
541
+ /**
542
+ * Creates an object composed of the picked `object` properties, own or inherited. Paths may be given
543
+ * individually or in arrays and may be deep; a deep path recreates the containers along it in the result,
544
+ * while the picked value itself is kept by reference.
545
+ *
546
+ * @param object - The source object.
547
+ * @param props - The property paths to pick, given individually or in arrays.
548
+ * @returns Returns the new object.
549
+ * @internal
550
+ */
551
+ export declare function _pick<T extends object, U extends keyof T>(object: T, ...props: _Many<U>[]): Pick<T, U>;
552
+
553
+ /**
554
+ * @internal
555
+ */
556
+ export declare function _pick<T>(object: T | null | undefined, ...props: _Many<_PropertyPath>[]): _PartialObject<T>;
557
+
387
558
  /**
388
559
  * @internal
389
560
  */
@@ -502,6 +673,23 @@ export declare function shortenText(value: string, options?: IShortenTextOptions
502
673
  */
503
674
  export declare function simplifyText(value: string | number | null): string;
504
675
 
676
+ /**
677
+ * Creates an array of elements, sorted in ascending order by the results of running each element in a
678
+ * collection through each iteratee. This method performs a stable sort, that is, it preserves the original
679
+ * sort order of equal elements. The iteratees are invoked with one argument: (value).
680
+ *
681
+ * @param collection - The collection to iterate over.
682
+ * @param iteratees - The iteratees to sort by, specified individually or in arrays.
683
+ * @returns Returns the new sorted array.
684
+ * @internal
685
+ */
686
+ export declare function _sortBy<T>(collection: _List<T> | null | undefined, ...iteratees: _Many<_ListIteratee<T>>[]): T[];
687
+
688
+ /**
689
+ * @internal
690
+ */
691
+ export declare function _sortBy<T extends object>(collection: T | null | undefined, ...iteratees: _Many<_ObjectIteratee<T>>[]): T[keyof T][];
692
+
505
693
  /**
506
694
  * A specific matcher function
507
695
  *
@@ -547,6 +735,65 @@ export declare function suppressConsole<T>(fn: () => T | Promise<T>, type?: Cons
547
735
  */
548
736
  export declare function suppressConsole<T>(fn: () => T | Promise<T>, matcherFn: MatcherFunction): T | Promise<T>;
549
737
 
738
+ /**
739
+ * Creates a throttled function that only invokes `func` at most once per every `wait` milliseconds. The
740
+ * throttled function comes with a `cancel` method to cancel delayed `func` invocations and a `flush` method
741
+ * to immediately invoke them. Provide `options` to indicate whether `func` should be invoked on the leading
742
+ * and/or trailing edge of the `wait` timeout. The `func` is invoked with the last arguments provided to the
743
+ * throttled function. Subsequent calls to the throttled function return the result of the last `func`
744
+ * invocation.
745
+ *
746
+ * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked on the trailing edge of the
747
+ * timeout only if the throttled function is invoked more than once during the `wait` timeout.
748
+ *
749
+ * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred until the next tick, similar to
750
+ * `setTimeout` with a timeout of `0`.
751
+ *
752
+ * @param func - The function to throttle.
753
+ * @param wait - The number of milliseconds to throttle invocations to. Defaults to `0`.
754
+ * @param options - The options object.
755
+ * @returns Returns the new throttled function.
756
+ * @internal
757
+ */
758
+ export declare function _throttle<T extends (...args: any) => any>(func: T, wait?: number, options?: _ThrottleSettingsLeading): _DebouncedFuncLeading<T>;
759
+
760
+ /**
761
+ * @internal
762
+ */
763
+ export declare function _throttle<T extends (...args: any) => any>(func: T, wait?: number, options?: _ThrottleSettings): _DebouncedFunc<T>;
764
+
765
+ /**
766
+ * Options of `_throttle`.
767
+ *
768
+ * @internal
769
+ */
770
+ export declare type _ThrottleSettings = {
771
+ /** Invoke on the leading edge of the timeout. Defaults to `true`. */
772
+ leading?: boolean | undefined;
773
+ /** Invoke on the trailing edge of the timeout. Defaults to `true`. */
774
+ trailing?: boolean | undefined;
775
+ };
776
+
777
+ /**
778
+ * {@link _ThrottleSettings} that keep `leading` switched on, which guarantees a result on every call.
779
+ *
780
+ * @internal
781
+ */
782
+ export declare type _ThrottleSettingsLeading = (_ThrottleSettings & {
783
+ leading: true;
784
+ }) | Omit<_ThrottleSettings, "leading">;
785
+
786
+ /**
787
+ * Creates a duplicate-free version of an array, using SameValueZero for equality comparisons, in which
788
+ * only the first occurrence of each element is kept. The order of result values is determined by the
789
+ * order they occur in the array.
790
+ *
791
+ * @param array - The array to inspect.
792
+ * @returns Returns the new duplicate free array.
793
+ * @internal
794
+ */
795
+ export declare function _uniq<T>(array: _List<T> | null | undefined): T[];
796
+
550
797
  /**
551
798
  * This method is like `uniq` except that it accepts `iteratee` which is invoked for each element in
552
799
  * `array` to generate the criterion by which uniqueness is computed. The order of result values is
@@ -567,6 +814,13 @@ export declare function _uniqBy<T>(array: _List<T> | null | undefined, iteratee:
567
814
  */
568
815
  export declare type _ValueIteratee<T> = ((value: T) => _NotVoid) | _IterateeShorthand<T>;
569
816
 
817
+ /**
818
+ * A predicate that narrows the element type, so functions like `_partition` can type their result.
819
+ *
820
+ * @internal
821
+ */
822
+ export declare type _ValueIteratorTypeGuard<T, S extends T> = (value: T) => value is S;
823
+
570
824
  /**
571
825
  * A waitFor-compatible polling function, structurally matching testing-library's waitFor.
572
826
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gooddata/util",
3
- "version": "11.68.0-alpha.4",
3
+ "version": "11.68.0-alpha.6",
4
4
  "description": "GoodData Utility Functions",
5
5
  "license": "MIT",
6
6
  "author": "GoodData",
@@ -13,7 +13,8 @@
13
13
  "esm/**/*.js",
14
14
  "esm/**/*.json",
15
15
  "esm/**/*.d.ts",
16
- "esm/**/*.map"
16
+ "esm/**/*.map",
17
+ "NOTICE"
17
18
  ],
18
19
  "type": "module",
19
20
  "sideEffects": false,
@@ -46,8 +47,8 @@
46
47
  "oxlint-tsgolint": "7.0.2001",
47
48
  "typescript": "7.0.2",
48
49
  "vitest": "5.0.4",
49
- "@gooddata/eslint-config": "11.68.0-alpha.4",
50
- "@gooddata/oxlint-config": "11.68.0-alpha.4"
50
+ "@gooddata/oxlint-config": "11.68.0-alpha.6",
51
+ "@gooddata/eslint-config": "11.68.0-alpha.6"
51
52
  },
52
53
  "scripts": {
53
54
  "_phase:build": "npm run build",