@gooddata/util 11.68.0-alpha.7 → 11.68.0-alpha.8
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/NOTICE +4 -2
- package/esm/_/_baseDifference.d.ts +15 -0
- package/esm/_/_baseDifference.d.ts.map +1 -0
- package/esm/_/_baseDifference.js +68 -0
- package/esm/_/clamp.d.ts +17 -0
- package/esm/_/clamp.d.ts.map +1 -0
- package/esm/_/clamp.js +56 -0
- package/esm/_/difference.d.ts.map +1 -1
- package/esm/_/difference.js +2 -23
- package/esm/_/differenceBy.d.ts +39 -0
- package/esm/_/differenceBy.d.ts.map +1 -0
- package/esm/_/differenceBy.js +40 -0
- package/esm/_/toNumber.d.ts +11 -0
- package/esm/_/toNumber.d.ts.map +1 -0
- package/esm/_/toNumber.js +69 -0
- package/esm/_/update.d.ts +17 -0
- package/esm/_/update.d.ts.map +1 -0
- package/esm/_/update.js +55 -0
- package/esm/index.d.ts +3 -0
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +3 -0
- package/esm/util.d.ts +78 -0
- package/package.json +3 -3
package/NOTICE
CHANGED
|
@@ -3,9 +3,11 @@ 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.8)
|
|
7
7
|
Package License: MIT
|
|
8
8
|
Own License File: LICENSE
|
|
9
|
+
Date generated: 2026-11-10
|
|
10
|
+
Revision ID: dde1512be72244df8ad5c996c9bce5ff623b3b50
|
|
9
11
|
|
|
10
12
|
This notice lists the components that @gooddata/util depends on, directly or through other
|
|
11
13
|
packages, with the license and copyright information reported for each of them.
|
|
@@ -115,7 +117,7 @@ terms above.
|
|
|
115
117
|
|
|
116
118
|
* Copyrights *
|
|
117
119
|
MIT
|
|
118
|
-
- Copyright (c)
|
|
120
|
+
- Copyright (c) OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
119
121
|
|
|
120
122
|
--------------------------------------------------------------------------------
|
|
121
123
|
Package Title: ts-invariant (0.10.3)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { _List } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* The base implementation of `_difference` and `_differenceBy`: creates an array of the `array` values whose
|
|
4
|
+
* criteria are not among the criteria of the `values` lists, compared with SameValueZero. The order and
|
|
5
|
+
* references of result values are determined by the first array, with `-0` normalised to `0`. Only array-like
|
|
6
|
+
* objects are inspected: any other `array` yields an empty array and any other entry of `values` is skipped.
|
|
7
|
+
*
|
|
8
|
+
* @param array - The array to inspect.
|
|
9
|
+
* @param values - The lists of values to exclude.
|
|
10
|
+
* @param iteratee - The iteratee invoked per element to produce its criterion. Defaults to identity.
|
|
11
|
+
* @returns Returns the new array of filtered values.
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
export declare function _baseDifference<T>(array: _List<T> | null | undefined, values: unknown[], iteratee?: (value: unknown) => unknown): T[];
|
|
15
|
+
//# sourceMappingURL=_baseDifference.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_baseDifference.d.ts","sourceRoot":"","sources":["../../src/_/_baseDifference.ts"],"names":[],"mappings":"AAmCA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAExC;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAC7B,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,SAAS,EAClC,MAAM,EAAE,OAAO,EAAE,EACjB,QAAQ,GAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAA0B,GACzD,CAAC,EAAE,CA6BL"}
|
|
@@ -0,0 +1,68 @@
|
|
|
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
|
+
* The base implementation of `_difference` and `_differenceBy`: creates an array of the `array` values whose
|
|
36
|
+
* criteria are not among the criteria of the `values` lists, compared with SameValueZero. The order and
|
|
37
|
+
* references of result values are determined by the first array, with `-0` normalised to `0`. Only array-like
|
|
38
|
+
* objects are inspected: any other `array` yields an empty array and any other entry of `values` is skipped.
|
|
39
|
+
*
|
|
40
|
+
* @param array - The array to inspect.
|
|
41
|
+
* @param values - The lists of values to exclude.
|
|
42
|
+
* @param iteratee - The iteratee invoked per element to produce its criterion. Defaults to identity.
|
|
43
|
+
* @returns Returns the new array of filtered values.
|
|
44
|
+
* @internal
|
|
45
|
+
*/
|
|
46
|
+
export function _baseDifference(array, values, iteratee = (value) => value) {
|
|
47
|
+
if (!_isObjectLike(array) || !_isArrayLike(array)) {
|
|
48
|
+
return [];
|
|
49
|
+
}
|
|
50
|
+
const excluded = new Set();
|
|
51
|
+
for (const list of values) {
|
|
52
|
+
if (!_isObjectLike(list) || !_isArrayLike(list)) {
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
for (let index = 0; index < list.length; index++) {
|
|
56
|
+
excluded.add(iteratee(list[index]));
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
const result = [];
|
|
60
|
+
for (let index = 0; index < array.length; index++) {
|
|
61
|
+
const value = array[index];
|
|
62
|
+
if (!excluded.has(iteratee(value))) {
|
|
63
|
+
// lodash normalises `-0` to `+0` in the result
|
|
64
|
+
result.push(value === 0 ? 0 : value);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return result;
|
|
68
|
+
}
|
package/esm/_/clamp.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Clamps `number` within the inclusive `lower` and `upper` bounds. With two arguments the second one is the
|
|
3
|
+
* upper bound. The upper bound is applied first, bounds that convert to `NaN` count as `0`, an `undefined`
|
|
4
|
+
* bound is skipped, and a `NaN` number is returned as is.
|
|
5
|
+
*
|
|
6
|
+
* @param number - The number to clamp.
|
|
7
|
+
* @param lower - The lower bound.
|
|
8
|
+
* @param upper - The upper bound.
|
|
9
|
+
* @returns Returns the clamped number.
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
export declare function _clamp(number: number, lower: number, upper: number): number;
|
|
13
|
+
/**
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
export declare function _clamp(number: number, upper: number): number;
|
|
17
|
+
//# sourceMappingURL=clamp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clamp.d.ts","sourceRoot":"","sources":["../../src/_/clamp.ts"],"names":[],"mappings":"AAmCA;;;;;;;;;;GAUG;AACH,wBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;AAC7E;;GAEG;AACH,wBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC"}
|
package/esm/_/clamp.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 { _toNumber } from "./toNumber.js";
|
|
33
|
+
export function _clamp(number, lower, upper) {
|
|
34
|
+
if (upper === undefined) {
|
|
35
|
+
upper = lower;
|
|
36
|
+
lower = undefined;
|
|
37
|
+
}
|
|
38
|
+
const max = upper === undefined ? undefined : _toBound(upper);
|
|
39
|
+
const min = lower === undefined ? undefined : _toBound(lower);
|
|
40
|
+
let result = _toNumber(number);
|
|
41
|
+
if (result !== result) {
|
|
42
|
+
return result;
|
|
43
|
+
}
|
|
44
|
+
if (max !== undefined) {
|
|
45
|
+
result = result <= max ? result : max;
|
|
46
|
+
}
|
|
47
|
+
if (min !== undefined) {
|
|
48
|
+
result = result >= min ? result : min;
|
|
49
|
+
}
|
|
50
|
+
return result;
|
|
51
|
+
}
|
|
52
|
+
/** Converts a bound to a number, `NaN` counting as `0`. */
|
|
53
|
+
function _toBound(bound) {
|
|
54
|
+
const converted = _toNumber(bound);
|
|
55
|
+
return converted === converted ? converted : 0;
|
|
56
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"difference.d.ts","sourceRoot":"","sources":["../../src/_/difference.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"difference.d.ts","sourceRoot":"","sources":["../../src/_/difference.ts"],"names":[],"mappings":"AAkCA,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,CAE7F"}
|
package/esm/_/difference.js
CHANGED
|
@@ -29,8 +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 {
|
|
33
|
-
import { _isObjectLike } from "./isObjectLike.js";
|
|
32
|
+
import { _baseDifference } from "./_baseDifference.js";
|
|
34
33
|
/**
|
|
35
34
|
* Creates an array of `array` values not included in the other given arrays using SameValueZero for equality
|
|
36
35
|
* comparisons. The order and references of result values are determined by the first array. Only array-like
|
|
@@ -43,25 +42,5 @@ import { _isObjectLike } from "./isObjectLike.js";
|
|
|
43
42
|
* @internal
|
|
44
43
|
*/
|
|
45
44
|
export function _difference(array, ...values) {
|
|
46
|
-
|
|
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;
|
|
45
|
+
return _baseDifference(array, values);
|
|
67
46
|
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { _List, _ValueIteratee } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* This method is like `_difference` except that it accepts `iteratee` which is invoked for each element of
|
|
4
|
+
* `array` and `values` to generate the criterion by which they're compared. The order and references of
|
|
5
|
+
* result values are determined by the first array. The iteratee is invoked with one argument: (value).
|
|
6
|
+
* The iteratee is the last argument unless that argument is array-like, in which case it is one more list of
|
|
7
|
+
* values and the elements are compared as they are.
|
|
8
|
+
*
|
|
9
|
+
* @param array - The array to inspect.
|
|
10
|
+
* @param values - The values to exclude, followed by the iteratee.
|
|
11
|
+
* @returns Returns the new array of filtered values.
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
export declare function _differenceBy<T1, T2>(array: _List<T1> | null | undefined, values: _List<T2>, iteratee: _ValueIteratee<T1 | T2>): T1[];
|
|
15
|
+
/**
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
18
|
+
export declare function _differenceBy<T1, T2, T3>(array: _List<T1> | null | undefined, values1: _List<T2>, values2: _List<T3>, iteratee: _ValueIteratee<T1 | T2 | T3>): T1[];
|
|
19
|
+
/**
|
|
20
|
+
* @internal
|
|
21
|
+
*/
|
|
22
|
+
export declare function _differenceBy<T1, T2, T3, T4>(array: _List<T1> | null | undefined, values1: _List<T2>, values2: _List<T3>, values3: _List<T4>, iteratee: _ValueIteratee<T1 | T2 | T3 | T4>): T1[];
|
|
23
|
+
/**
|
|
24
|
+
* @internal
|
|
25
|
+
*/
|
|
26
|
+
export declare function _differenceBy<T1, T2, T3, T4, T5>(array: _List<T1> | null | undefined, values1: _List<T2>, values2: _List<T3>, values3: _List<T4>, values4: _List<T5>, iteratee: _ValueIteratee<T1 | T2 | T3 | T4 | T5>): T1[];
|
|
27
|
+
/**
|
|
28
|
+
* @internal
|
|
29
|
+
*/
|
|
30
|
+
export declare function _differenceBy<T1, T2, T3, T4, T5, T6>(array: _List<T1> | null | undefined, values1: _List<T2>, values2: _List<T3>, values3: _List<T4>, values4: _List<T5>, values5: _List<T6>, iteratee: _ValueIteratee<T1 | T2 | T3 | T4 | T5 | T6>): T1[];
|
|
31
|
+
/**
|
|
32
|
+
* @internal
|
|
33
|
+
*/
|
|
34
|
+
export declare function _differenceBy<T1, T2, T3, T4, T5, T6, T7>(array: _List<T1> | null | undefined, values1: _List<T2>, values2: _List<T3>, values3: _List<T4>, values4: _List<T5>, values5: _List<T6>, ...values: (_List<T7> | _ValueIteratee<T1 | T2 | T3 | T4 | T5 | T6 | T7>)[]): T1[];
|
|
35
|
+
/**
|
|
36
|
+
* @internal
|
|
37
|
+
*/
|
|
38
|
+
export declare function _differenceBy<T>(array: _List<T> | null | undefined, ...values: _List<T>[]): T[];
|
|
39
|
+
//# sourceMappingURL=differenceBy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"differenceBy.d.ts","sourceRoot":"","sources":["../../src/_/differenceBy.ts"],"names":[],"mappings":"AAqCA,OAA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E,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,GAC5E,EAAE,EAAE,CAAC;AACR;;GAEG;AACH,wBAAgB,aAAa,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,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 { _baseDifference } from "./_baseDifference.js";
|
|
33
|
+
import { _baseIteratee } from "./_baseIteratee.js";
|
|
34
|
+
import { _isArrayLike } from "./isArrayLike.js";
|
|
35
|
+
import { _isObjectLike } from "./isObjectLike.js";
|
|
36
|
+
export function _differenceBy(array, ...values) {
|
|
37
|
+
const last = values[values.length - 1];
|
|
38
|
+
const iteratee = _isObjectLike(last) && _isArrayLike(last) ? undefined : last;
|
|
39
|
+
return _baseDifference(array, values, _baseIteratee(iteratee));
|
|
40
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts `value` to a number. Symbols become `NaN`, objects are converted through `valueOf`, and strings
|
|
3
|
+
* are trimmed and may use the `0b`, `0o` and `0x` prefixes; a signed hexadecimal string becomes `NaN`.
|
|
4
|
+
* A bigint throws, as the numeric coercion does.
|
|
5
|
+
*
|
|
6
|
+
* @param value - The value to process.
|
|
7
|
+
* @returns Returns the number.
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export declare function _toNumber(value: unknown): number;
|
|
11
|
+
//# sourceMappingURL=toNumber.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toNumber.d.ts","sourceRoot":"","sources":["../../src/_/toNumber.ts"],"names":[],"mappings":"AA6CA;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CA2BhD"}
|
|
@@ -0,0 +1,69 @@
|
|
|
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
|
+
import { _isSymbol } from "./isSymbol.js";
|
|
34
|
+
/** Used to detect bad signed hexadecimal string values. */
|
|
35
|
+
const RE_IS_BAD_HEX = /^[-+]0x[0-9a-f]+$/i;
|
|
36
|
+
/** Used to detect binary string values. */
|
|
37
|
+
const RE_IS_BINARY = /^0b[01]+$/i;
|
|
38
|
+
/** Used to detect octal string values. */
|
|
39
|
+
const RE_IS_OCTAL = /^0o[0-7]+$/i;
|
|
40
|
+
/**
|
|
41
|
+
* Converts `value` to a number. Symbols become `NaN`, objects are converted through `valueOf`, and strings
|
|
42
|
+
* are trimmed and may use the `0b`, `0o` and `0x` prefixes; a signed hexadecimal string becomes `NaN`.
|
|
43
|
+
* A bigint throws, as the numeric coercion does.
|
|
44
|
+
*
|
|
45
|
+
* @param value - The value to process.
|
|
46
|
+
* @returns Returns the number.
|
|
47
|
+
* @internal
|
|
48
|
+
*/
|
|
49
|
+
export function _toNumber(value) {
|
|
50
|
+
if (typeof value === "number") {
|
|
51
|
+
return value;
|
|
52
|
+
}
|
|
53
|
+
if (_isSymbol(value)) {
|
|
54
|
+
return NaN;
|
|
55
|
+
}
|
|
56
|
+
if (_isObject(value)) {
|
|
57
|
+
const other = typeof value.valueOf === "function" ? value.valueOf() : value;
|
|
58
|
+
value = _isObject(other) ? String(other) : other;
|
|
59
|
+
}
|
|
60
|
+
if (typeof value !== "string") {
|
|
61
|
+
return value === 0 ? value : +value;
|
|
62
|
+
}
|
|
63
|
+
const trimmed = value.trim();
|
|
64
|
+
const isBinary = RE_IS_BINARY.test(trimmed);
|
|
65
|
+
if (isBinary || RE_IS_OCTAL.test(trimmed)) {
|
|
66
|
+
return parseInt(trimmed.slice(2), isBinary ? 2 : 8);
|
|
67
|
+
}
|
|
68
|
+
return RE_IS_BAD_HEX.test(trimmed) ? NaN : +trimmed;
|
|
69
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { _PropertyPath } from "./set.js";
|
|
2
|
+
/**
|
|
3
|
+
* This method is like `_set` except that it accepts `updater` to produce the value to set. The updater is
|
|
4
|
+
* invoked with one argument, the current value at `path`, which is `undefined` when the path does not exist;
|
|
5
|
+
* a non-function updater keeps the current value. Missing segments of the path are created as lodash does,
|
|
6
|
+
* arrays for index segments and plain objects otherwise.
|
|
7
|
+
*
|
|
8
|
+
* **Note:** This method mutates `object`.
|
|
9
|
+
*
|
|
10
|
+
* @param object - The object to modify.
|
|
11
|
+
* @param path - The path of the property to set.
|
|
12
|
+
* @param updater - The function to produce the updated value.
|
|
13
|
+
* @returns Returns `object`.
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
export declare function _update(object: object, path: _PropertyPath, updater: (value: any) => any): any;
|
|
17
|
+
//# sourceMappingURL=update.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/_/update.ts"],"names":[],"mappings":"AAmCA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C;;;;;;;;;;;;;GAaG;AAEH,wBAAgB,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,GAAG,GAAG,GAAG,CAQ9F"}
|
package/esm/_/update.js
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
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 { _baseGet } from "./_baseGet.js";
|
|
33
|
+
import { _baseSet } from "./_baseSet.js";
|
|
34
|
+
/**
|
|
35
|
+
* This method is like `_set` except that it accepts `updater` to produce the value to set. The updater is
|
|
36
|
+
* invoked with one argument, the current value at `path`, which is `undefined` when the path does not exist;
|
|
37
|
+
* a non-function updater keeps the current value. Missing segments of the path are created as lodash does,
|
|
38
|
+
* arrays for index segments and plain objects otherwise.
|
|
39
|
+
*
|
|
40
|
+
* **Note:** This method mutates `object`.
|
|
41
|
+
*
|
|
42
|
+
* @param object - The object to modify.
|
|
43
|
+
* @param path - The path of the property to set.
|
|
44
|
+
* @param updater - The function to produce the updated value.
|
|
45
|
+
* @returns Returns `object`.
|
|
46
|
+
* @internal
|
|
47
|
+
*/
|
|
48
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any -- matches the lodash signature
|
|
49
|
+
export function _update(object, path, updater) {
|
|
50
|
+
if (object == null) {
|
|
51
|
+
return object;
|
|
52
|
+
}
|
|
53
|
+
const produce = typeof updater === "function" ? updater : (value) => value;
|
|
54
|
+
return _baseSet(object, path, produce(_baseGet(object, path)));
|
|
55
|
+
}
|
package/esm/index.d.ts
CHANGED
|
@@ -14,10 +14,12 @@ 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
15
|
export { _camelCase } from "./_/camelCase.js";
|
|
16
16
|
export { _capitalize } from "./_/capitalize.js";
|
|
17
|
+
export { _clamp } from "./_/clamp.js";
|
|
17
18
|
export { _cloneDeep } from "./_/cloneDeep.js";
|
|
18
19
|
export { type _Falsey, _compact } from "./_/compact.js";
|
|
19
20
|
export { type _DebouncedFunc, type _DebouncedFuncLeading, type _DebounceSettings, type _DebounceSettingsLeading, _debounce, } from "./_/debounce.js";
|
|
20
21
|
export { _difference } from "./_/difference.js";
|
|
22
|
+
export { _differenceBy } from "./_/differenceBy.js";
|
|
21
23
|
export { _escape } from "./_/escape.js";
|
|
22
24
|
export { _groupBy } from "./_/groupBy.js";
|
|
23
25
|
export { _has } from "./_/has.js";
|
|
@@ -42,6 +44,7 @@ export { _union } from "./_/union.js";
|
|
|
42
44
|
export { _uniq } from "./_/uniq.js";
|
|
43
45
|
export { _uniqBy } from "./_/uniqBy.js";
|
|
44
46
|
export { _uniqWith } from "./_/uniqWith.js";
|
|
47
|
+
export { _update } from "./_/update.js";
|
|
45
48
|
export { _zip } from "./_/zip.js";
|
|
46
49
|
export type { _Comparator, _Dictionary, _Function0, _Function1, _Function2, _Function3, _Function4, _IterateeShorthand, _List, _ListIteratee, _ListIterator, _Many, _NotVoid, _NumericDictionary, _ObjectIteratee, _ObjectIterator, _PartialObject, _PartialShallow, _PropertyName, _ValueIteratee, _ValueIterateeCustom, _ValueIteratorTypeGuard, _ValueKeyIteratee, } from "./_/types.js";
|
|
47
50
|
//# sourceMappingURL=index.d.ts.map
|
package/esm/index.d.ts.map
CHANGED
|
@@ -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,EACX,YAAY,EACZ,YAAY,EACZ,kBAAkB,GACrB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAChF,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,WAAW,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAClF,OAAO,EACH,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,OAAO,EACZ,KAAK,uBAAuB,EAC5B,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,EACL,YAAY,EACZ,eAAe,EACf,kBAAkB,GACrB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,KAAK,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EACH,KAAK,cAAc,EACnB,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,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AAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,YAAY,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,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,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,YAAY,EACR,WAAW,EACX,WAAW,EACX,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,kBAAkB,EAClB,KAAK,EACL,aAAa,EACb,aAAa,EACb,KAAK,EACL,QAAQ,EACR,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,cAAc,EACd,eAAe,EACf,aAAa,EACb,cAAc,EACd,oBAAoB,EACpB,uBAAuB,EACvB,iBAAiB,GACpB,MAAM,cAAc,CAAC"}
|
package/esm/index.js
CHANGED
|
@@ -17,10 +17,12 @@ export { delay, strictBarrel, suppressConsole, createTightWaitFor, } from "./tes
|
|
|
17
17
|
// local functions from lodash-es
|
|
18
18
|
export { _camelCase } from "./_/camelCase.js";
|
|
19
19
|
export { _capitalize } from "./_/capitalize.js";
|
|
20
|
+
export { _clamp } from "./_/clamp.js";
|
|
20
21
|
export { _cloneDeep } from "./_/cloneDeep.js";
|
|
21
22
|
export { _compact } from "./_/compact.js";
|
|
22
23
|
export { _debounce, } from "./_/debounce.js";
|
|
23
24
|
export { _difference } from "./_/difference.js";
|
|
25
|
+
export { _differenceBy } from "./_/differenceBy.js";
|
|
24
26
|
export { _escape } from "./_/escape.js";
|
|
25
27
|
export { _groupBy } from "./_/groupBy.js";
|
|
26
28
|
export { _has } from "./_/has.js";
|
|
@@ -45,4 +47,5 @@ export { _union } from "./_/union.js";
|
|
|
45
47
|
export { _uniq } from "./_/uniq.js";
|
|
46
48
|
export { _uniqBy } from "./_/uniqBy.js";
|
|
47
49
|
export { _uniqWith } from "./_/uniqWith.js";
|
|
50
|
+
export { _update } from "./_/update.js";
|
|
48
51
|
export { _zip } from "./_/zip.js";
|
package/esm/util.d.ts
CHANGED
|
@@ -26,6 +26,24 @@ export declare const _camelCase: (string?: string) => string;
|
|
|
26
26
|
*/
|
|
27
27
|
export declare function _capitalize(string?: string): string;
|
|
28
28
|
|
|
29
|
+
/**
|
|
30
|
+
* Clamps `number` within the inclusive `lower` and `upper` bounds. With two arguments the second one is the
|
|
31
|
+
* upper bound. The upper bound is applied first, bounds that convert to `NaN` count as `0`, an `undefined`
|
|
32
|
+
* bound is skipped, and a `NaN` number is returned as is.
|
|
33
|
+
*
|
|
34
|
+
* @param number - The number to clamp.
|
|
35
|
+
* @param lower - The lower bound.
|
|
36
|
+
* @param upper - The upper bound.
|
|
37
|
+
* @returns Returns the clamped number.
|
|
38
|
+
* @internal
|
|
39
|
+
*/
|
|
40
|
+
export declare function _clamp(number: number, lower: number, upper: number): number;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* @internal
|
|
44
|
+
*/
|
|
45
|
+
export declare function _clamp(number: number, upper: number): number;
|
|
46
|
+
|
|
29
47
|
/**
|
|
30
48
|
* Recursively clones `value`.
|
|
31
49
|
*
|
|
@@ -193,6 +211,50 @@ export declare type _Dictionary<T> = {
|
|
|
193
211
|
*/
|
|
194
212
|
export declare function _difference<T>(array: _List<T> | null | undefined, ...values: _List<T>[]): T[];
|
|
195
213
|
|
|
214
|
+
/**
|
|
215
|
+
* This method is like `_difference` except that it accepts `iteratee` which is invoked for each element of
|
|
216
|
+
* `array` and `values` to generate the criterion by which they're compared. The order and references of
|
|
217
|
+
* result values are determined by the first array. The iteratee is invoked with one argument: (value).
|
|
218
|
+
* The iteratee is the last argument unless that argument is array-like, in which case it is one more list of
|
|
219
|
+
* values and the elements are compared as they are.
|
|
220
|
+
*
|
|
221
|
+
* @param array - The array to inspect.
|
|
222
|
+
* @param values - The values to exclude, followed by the iteratee.
|
|
223
|
+
* @returns Returns the new array of filtered values.
|
|
224
|
+
* @internal
|
|
225
|
+
*/
|
|
226
|
+
export declare function _differenceBy<T1, T2>(array: _List<T1> | null | undefined, values: _List<T2>, iteratee: _ValueIteratee<T1 | T2>): T1[];
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* @internal
|
|
230
|
+
*/
|
|
231
|
+
export declare function _differenceBy<T1, T2, T3>(array: _List<T1> | null | undefined, values1: _List<T2>, values2: _List<T3>, iteratee: _ValueIteratee<T1 | T2 | T3>): T1[];
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* @internal
|
|
235
|
+
*/
|
|
236
|
+
export declare function _differenceBy<T1, T2, T3, T4>(array: _List<T1> | null | undefined, values1: _List<T2>, values2: _List<T3>, values3: _List<T4>, iteratee: _ValueIteratee<T1 | T2 | T3 | T4>): T1[];
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* @internal
|
|
240
|
+
*/
|
|
241
|
+
export declare function _differenceBy<T1, T2, T3, T4, T5>(array: _List<T1> | null | undefined, values1: _List<T2>, values2: _List<T3>, values3: _List<T4>, values4: _List<T5>, iteratee: _ValueIteratee<T1 | T2 | T3 | T4 | T5>): T1[];
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* @internal
|
|
245
|
+
*/
|
|
246
|
+
export declare function _differenceBy<T1, T2, T3, T4, T5, T6>(array: _List<T1> | null | undefined, values1: _List<T2>, values2: _List<T3>, values3: _List<T4>, values4: _List<T5>, values5: _List<T6>, iteratee: _ValueIteratee<T1 | T2 | T3 | T4 | T5 | T6>): T1[];
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* @internal
|
|
250
|
+
*/
|
|
251
|
+
export declare function _differenceBy<T1, T2, T3, T4, T5, T6, T7>(array: _List<T1> | null | undefined, values1: _List<T2>, values2: _List<T3>, values3: _List<T4>, values4: _List<T5>, values5: _List<T6>, ...values: (_List<T7> | _ValueIteratee<T1 | T2 | T3 | T4 | T5 | T6 | T7>)[]): T1[];
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* @internal
|
|
255
|
+
*/
|
|
256
|
+
export declare function _differenceBy<T>(array: _List<T> | null | undefined, ...values: _List<T>[]): T[];
|
|
257
|
+
|
|
196
258
|
/**
|
|
197
259
|
* @internal
|
|
198
260
|
*/
|
|
@@ -1060,6 +1122,22 @@ declare const uniqueSymbol: unique symbol;
|
|
|
1060
1122
|
*/
|
|
1061
1123
|
export declare function _uniqWith<T>(array: _List<T> | null | undefined, comparator?: _Comparator<T>): T[];
|
|
1062
1124
|
|
|
1125
|
+
/**
|
|
1126
|
+
* This method is like `_set` except that it accepts `updater` to produce the value to set. The updater is
|
|
1127
|
+
* invoked with one argument, the current value at `path`, which is `undefined` when the path does not exist;
|
|
1128
|
+
* a non-function updater keeps the current value. Missing segments of the path are created as lodash does,
|
|
1129
|
+
* arrays for index segments and plain objects otherwise.
|
|
1130
|
+
*
|
|
1131
|
+
* **Note:** This method mutates `object`.
|
|
1132
|
+
*
|
|
1133
|
+
* @param object - The object to modify.
|
|
1134
|
+
* @param path - The path of the property to set.
|
|
1135
|
+
* @param updater - The function to produce the updated value.
|
|
1136
|
+
* @returns Returns `object`.
|
|
1137
|
+
* @internal
|
|
1138
|
+
*/
|
|
1139
|
+
export declare function _update(object: object, path: _PropertyPath, updater: (value: any) => any): any;
|
|
1140
|
+
|
|
1063
1141
|
/**
|
|
1064
1142
|
* An iteratee as lodash accepts it: a function, a property name or path, a `[path, value]` pair, or a
|
|
1065
1143
|
* partial object to match.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gooddata/util",
|
|
3
|
-
"version": "11.68.0-alpha.
|
|
3
|
+
"version": "11.68.0-alpha.8",
|
|
4
4
|
"description": "GoodData Utility Functions",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "GoodData",
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"oxlint-tsgolint": "7.0.2001",
|
|
48
48
|
"typescript": "7.0.2",
|
|
49
49
|
"vitest": "5.0.4",
|
|
50
|
-
"@gooddata/eslint-config": "11.68.0-alpha.
|
|
51
|
-
"@gooddata/oxlint-config": "11.68.0-alpha.
|
|
50
|
+
"@gooddata/eslint-config": "11.68.0-alpha.8",
|
|
51
|
+
"@gooddata/oxlint-config": "11.68.0-alpha.8"
|
|
52
52
|
},
|
|
53
53
|
"scripts": {
|
|
54
54
|
"_phase:build": "npm run build",
|