@gooddata/util 11.68.0-alpha.1 → 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/util.d.ts
CHANGED
|
@@ -7,6 +7,20 @@
|
|
|
7
7
|
* @packageDocumentation
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* Recursively clones `value`.
|
|
12
|
+
*
|
|
13
|
+
* Supports cloning arrays, array buffers, booleans, date objects, maps, numbers, `Object` objects, regexes,
|
|
14
|
+
* sets, strings, symbols, and typed arrays. The own enumerable properties of arguments objects are cloned
|
|
15
|
+
* as plain objects. An empty object is returned for uncloneable values such as error objects, functions,
|
|
16
|
+
* DOM nodes, and WeakMaps; nested uncloneable values are kept by reference.
|
|
17
|
+
*
|
|
18
|
+
* @param value - The value to recursively clone.
|
|
19
|
+
* @returns Returns the deep cloned value.
|
|
20
|
+
* @internal
|
|
21
|
+
*/
|
|
22
|
+
export declare function _cloneDeep<T>(value: T): T;
|
|
23
|
+
|
|
10
24
|
/**
|
|
11
25
|
* Returns combine guard from input guards as a result type is union type of guarded types
|
|
12
26
|
* Its good for array filtering base on multiple guards and its return correct result union type
|
|
@@ -15,6 +29,16 @@
|
|
|
15
29
|
*/
|
|
16
30
|
export declare function combineGuards<T extends ((x: unknown) => x is unknown)[]>(...guards: T): (x: unknown) => x is GuardType<T[number]>;
|
|
17
31
|
|
|
32
|
+
/**
|
|
33
|
+
* Creates an array with all falsey values removed. The values `false`, `null`, `0`, `-0`, `0n`, `""`,
|
|
34
|
+
* `undefined`, and `NaN` are falsey. Holes in sparse arrays are skipped as well.
|
|
35
|
+
*
|
|
36
|
+
* @param array - The array or array-like to _compact.
|
|
37
|
+
* @returns Returns the new array of filtered values.
|
|
38
|
+
* @internal
|
|
39
|
+
*/
|
|
40
|
+
export declare function _compact<T>(array: _List<T | _Falsey> | null | undefined): T[];
|
|
41
|
+
|
|
18
42
|
/**
|
|
19
43
|
* A console function, like log, warn or error
|
|
20
44
|
*
|
|
@@ -42,6 +66,81 @@ export declare type ConsoleType = "error" | "warn" | "log" | "debug" | "info";
|
|
|
42
66
|
*/
|
|
43
67
|
export declare function createTightWaitFor(waitFor: WaitForFn, interval?: number): <T>(callback: () => T | Promise<T>) => Promise<T>;
|
|
44
68
|
|
|
69
|
+
/**
|
|
70
|
+
* Creates a debounced function that delays invoking `func` until after `wait` milliseconds have elapsed
|
|
71
|
+
* since the last time the debounced function was invoked. The debounced function comes with a `cancel`
|
|
72
|
+
* method to cancel delayed `func` invocations and a `flush` method to immediately invoke them. Provide
|
|
73
|
+
* `options` to indicate whether `func` should be invoked on the leading and/or trailing edge of the
|
|
74
|
+
* `wait` timeout. The `func` is invoked with the last arguments provided to the debounced function.
|
|
75
|
+
* Subsequent calls to the debounced function return the result of the last `func` invocation.
|
|
76
|
+
*
|
|
77
|
+
* **Note:** If `leading` and `trailing` options are `true`, `func` is invoked on the trailing edge of
|
|
78
|
+
* the timeout only if the debounced function is invoked more than once during the `wait` timeout.
|
|
79
|
+
*
|
|
80
|
+
* If `wait` is `0` and `leading` is `false`, `func` invocation is deferred until the next tick, similar
|
|
81
|
+
* to `setTimeout` with a timeout of `0`.
|
|
82
|
+
*
|
|
83
|
+
* @param func - The function to debounce.
|
|
84
|
+
* @param wait - The number of milliseconds to delay.
|
|
85
|
+
* @param options - The options object.
|
|
86
|
+
* @returns Returns the new debounced function.
|
|
87
|
+
* @internal
|
|
88
|
+
*/
|
|
89
|
+
export declare function _debounce<T extends (...args: any) => any>(func: T, wait: number | undefined, options: _DebounceSettingsLeading): _DebouncedFuncLeading<T>;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* @see _debounce
|
|
93
|
+
* @internal
|
|
94
|
+
*/
|
|
95
|
+
export declare function _debounce<T extends (...args: any) => any>(func: T, wait?: number, options?: _DebounceSettings): _DebouncedFunc<T>;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* A debounced function: calling it applies the debounce rules and returns the result of the last
|
|
99
|
+
* invocation, or `undefined` before the first one.
|
|
100
|
+
*
|
|
101
|
+
* @internal
|
|
102
|
+
*/
|
|
103
|
+
export declare type _DebouncedFunc<T extends (...args: any[]) => any> = {
|
|
104
|
+
(...args: Parameters<T>): ReturnType<T> | undefined;
|
|
105
|
+
/** Throws away any pending invocation. */
|
|
106
|
+
cancel(): void;
|
|
107
|
+
/** Invokes a pending invocation immediately and returns its result, else returns the last result. */
|
|
108
|
+
flush(): ReturnType<T> | undefined;
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* A debounced function created with `leading: true`, so a call always has a result.
|
|
113
|
+
*
|
|
114
|
+
* @internal
|
|
115
|
+
*/
|
|
116
|
+
export declare type _DebouncedFuncLeading<T extends (...args: any[]) => any> = {
|
|
117
|
+
(...args: Parameters<T>): ReturnType<T>;
|
|
118
|
+
flush(): ReturnType<T>;
|
|
119
|
+
} & _DebouncedFunc<T>;
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Options for `_debounce`.
|
|
123
|
+
*
|
|
124
|
+
* @internal
|
|
125
|
+
*/
|
|
126
|
+
export declare type _DebounceSettings = {
|
|
127
|
+
/** Invoke on the leading edge of the timeout. */
|
|
128
|
+
leading?: boolean | undefined;
|
|
129
|
+
/** The maximum time the function is allowed to be delayed before it is invoked. */
|
|
130
|
+
maxWait?: number | undefined;
|
|
131
|
+
/** Invoke on the trailing edge of the timeout. Defaults to `true`. */
|
|
132
|
+
trailing?: boolean | undefined;
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* {@link _DebounceSettings} with `leading` switched on, which guarantees a result on every call.
|
|
137
|
+
*
|
|
138
|
+
* @internal
|
|
139
|
+
*/
|
|
140
|
+
export declare type _DebounceSettingsLeading = _DebounceSettings & {
|
|
141
|
+
leading: true;
|
|
142
|
+
};
|
|
143
|
+
|
|
45
144
|
/**
|
|
46
145
|
* Returns a promise which will resolve after the provided number of milliseconds.
|
|
47
146
|
*
|
|
@@ -50,11 +149,31 @@ export declare function createTightWaitFor(waitFor: WaitForFn, interval?: number
|
|
|
50
149
|
*/
|
|
51
150
|
export declare function delay(timeout?: number): Promise<void>;
|
|
52
151
|
|
|
152
|
+
/**
|
|
153
|
+
* @internal
|
|
154
|
+
*/
|
|
155
|
+
export declare type _Dictionary<T> = {
|
|
156
|
+
[index: string]: T;
|
|
157
|
+
};
|
|
158
|
+
|
|
53
159
|
/**
|
|
54
160
|
* @internal
|
|
55
161
|
*/
|
|
56
162
|
export declare type EmptyObject = Record<never, never>;
|
|
57
163
|
|
|
164
|
+
/** Common interface between Arrays and jQuery objects */
|
|
165
|
+
/**
|
|
166
|
+
* @internal
|
|
167
|
+
*/
|
|
168
|
+
export declare type _EmptyObject<T> = {
|
|
169
|
+
[K in keyof T]?: never;
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* @internal
|
|
174
|
+
*/
|
|
175
|
+
export declare type _EmptyObjectOf<T> = _EmptyObject<T> extends T ? _EmptyObject<T> : never;
|
|
176
|
+
|
|
58
177
|
/**
|
|
59
178
|
* Escapes special characters used in regular expressions.
|
|
60
179
|
* @param value - string to be escaped
|
|
@@ -64,6 +183,31 @@ export declare type EmptyObject = Record<never, never>;
|
|
|
64
183
|
*/
|
|
65
184
|
export declare function escapeRegExp(value: string): string;
|
|
66
185
|
|
|
186
|
+
/** Common interface between Arrays and jQuery objects */
|
|
187
|
+
/**
|
|
188
|
+
* @internal
|
|
189
|
+
*/
|
|
190
|
+
export declare type _Falsey = null | undefined | false | "" | 0 | 0n;
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Creates an object composed of keys generated from the results of running each element of
|
|
194
|
+
* `collection` thru `iteratee`. The order of grouped values is determined by the order they occur in
|
|
195
|
+
* `collection`. The corresponding value of each key is an array of elements responsible for generating
|
|
196
|
+
* the key. The iteratee is invoked with one argument: (value).
|
|
197
|
+
*
|
|
198
|
+
* @param collection - The collection to iterate over.
|
|
199
|
+
* @param iteratee - The iteratee to transform keys.
|
|
200
|
+
* @returns Returns the composed aggregate object.
|
|
201
|
+
* @internal
|
|
202
|
+
*/
|
|
203
|
+
export declare function _groupBy<T>(collection: _List<T> | null | undefined, iteratee?: _ValueIteratee<T>): _Dictionary<T[]>;
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* @see _groupBy
|
|
207
|
+
* @internal
|
|
208
|
+
*/
|
|
209
|
+
export declare function _groupBy<T extends object>(collection: T | null | undefined, iteratee?: _ValueIteratee<T[keyof T]>): _Dictionary<Array<T[keyof T]>>;
|
|
210
|
+
|
|
67
211
|
/**
|
|
68
212
|
* @internal
|
|
69
213
|
*/
|
|
@@ -86,6 +230,63 @@ export declare type GuardType<T> = T extends ((o: unknown) => o is infer U) ? U
|
|
|
86
230
|
*/
|
|
87
231
|
export declare function hashCodeString(value: string): number;
|
|
88
232
|
|
|
233
|
+
/**
|
|
234
|
+
* Checks if value is empty. A value is considered empty unless it’s an arguments object, array, string, or
|
|
235
|
+
* jQuery-like collection with a length greater than 0 or an object with own enumerable properties.
|
|
236
|
+
*
|
|
237
|
+
* @param value - The value to inspect.
|
|
238
|
+
* @returns Returns true if value is empty, else false.
|
|
239
|
+
* @internal
|
|
240
|
+
*/
|
|
241
|
+
export declare function _isEmpty<T extends {
|
|
242
|
+
__trapAny: any;
|
|
243
|
+
}>(value?: T): boolean;
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* @see _isEmpty
|
|
247
|
+
* @internal
|
|
248
|
+
*/
|
|
249
|
+
export declare function _isEmpty(value: string): value is "";
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* @see _isEmpty
|
|
253
|
+
* @internal
|
|
254
|
+
*/
|
|
255
|
+
export declare function _isEmpty(value: Map<any, any> | Set<any> | _List<any> | null | undefined): boolean;
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* @see _isEmpty
|
|
259
|
+
* @internal
|
|
260
|
+
*/
|
|
261
|
+
export declare function _isEmpty(value: object): boolean;
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* @see _isEmpty
|
|
265
|
+
* @internal
|
|
266
|
+
*/
|
|
267
|
+
export declare function _isEmpty<T extends object>(value: T | null | undefined): value is _EmptyObjectOf<T> | null | undefined;
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* @see _isEmpty
|
|
271
|
+
* @internal
|
|
272
|
+
*/
|
|
273
|
+
export declare function _isEmpty(value?: any): boolean;
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* Performs a deep comparison between two values to determine if they are equivalent.
|
|
277
|
+
*
|
|
278
|
+
* Supports comparing arrays, array buffers, booleans, date objects, error objects, maps, numbers,
|
|
279
|
+
* `Object` objects, regexes, sets, strings, symbols, and typed arrays. `Object` objects are compared
|
|
280
|
+
* by their own, not inherited, enumerable properties. Functions and DOM nodes are compared by strict
|
|
281
|
+
* equality, i.e. `===`.
|
|
282
|
+
*
|
|
283
|
+
* @param value - The value to compare.
|
|
284
|
+
* @param other - The other value to compare.
|
|
285
|
+
* @returns Returns `true` if the values are equivalent, else `false`.
|
|
286
|
+
* @internal
|
|
287
|
+
*/
|
|
288
|
+
export declare function _isEqual(value: unknown, other: unknown): boolean;
|
|
289
|
+
|
|
89
290
|
/**
|
|
90
291
|
* @internal
|
|
91
292
|
*/
|
|
@@ -93,6 +294,21 @@ export declare interface IShortenTextOptions {
|
|
|
93
294
|
maxLength?: number;
|
|
94
295
|
}
|
|
95
296
|
|
|
297
|
+
/**
|
|
298
|
+
* @internal
|
|
299
|
+
*/
|
|
300
|
+
export declare type _IterateeShorthand<T> = _PropertyName | [_PropertyName, any] | _PartialShallow<T>;
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* @internal
|
|
304
|
+
*/
|
|
305
|
+
export declare type _List<T> = ArrayLike<T>;
|
|
306
|
+
|
|
307
|
+
/**
|
|
308
|
+
* @internal
|
|
309
|
+
*/
|
|
310
|
+
export declare type _Many<T> = T | readonly T[];
|
|
311
|
+
|
|
96
312
|
/**
|
|
97
313
|
* A matcher for suppressConsole
|
|
98
314
|
*
|
|
@@ -113,6 +329,39 @@ export declare type Matcher = {
|
|
|
113
329
|
*/
|
|
114
330
|
export declare type MatcherFunction = (console: Record<ConsoleType, ConsoleFunction>, type: ConsoleType, message: string) => boolean;
|
|
115
331
|
|
|
332
|
+
/**
|
|
333
|
+
* @internal
|
|
334
|
+
*/
|
|
335
|
+
export declare type _NotVoid = unknown;
|
|
336
|
+
|
|
337
|
+
/**
|
|
338
|
+
* The opposite of `pick`; this method creates an object composed of the own and inherited enumerable
|
|
339
|
+
* property paths of `object` that are not omitted.
|
|
340
|
+
*
|
|
341
|
+
* The result is always a new plain object. When any path is deep, every plain object reachable from
|
|
342
|
+
* the result is copied first so the source is left untouched; non-plain values such as arrays, class
|
|
343
|
+
* instances and dates are kept by reference and are therefore mutated by a deep path through them,
|
|
344
|
+
* exactly as lodash does.
|
|
345
|
+
*
|
|
346
|
+
* @param object - The source object.
|
|
347
|
+
* @param paths - The property paths to omit, given individually or in arrays.
|
|
348
|
+
* @returns Returns the new object.
|
|
349
|
+
* @internal
|
|
350
|
+
*/
|
|
351
|
+
export declare function _omit<T extends object, K extends _PropertyName[]>(object: T | null | undefined, ...paths: K): Pick<T, Exclude<keyof T, K[number]>>;
|
|
352
|
+
|
|
353
|
+
/**
|
|
354
|
+
* @see _omit
|
|
355
|
+
* @internal
|
|
356
|
+
*/
|
|
357
|
+
export declare function _omit<T extends object, K extends keyof T>(object: T | null | undefined, ...paths: Array<_Many<K>>): Omit<T, K>;
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
* @see _omit
|
|
361
|
+
* @internal
|
|
362
|
+
*/
|
|
363
|
+
export declare function _omit<T extends object>(object: T | null | undefined, ...paths: Array<_Many<_PropertyName>>): _PartialObject<T>;
|
|
364
|
+
|
|
116
365
|
/**
|
|
117
366
|
* Parse string in a form of [foo, bar] to an array of objects.
|
|
118
367
|
* Assume alphanumeric strings in the array and spaces; if some is not alphanumeric , return null
|
|
@@ -123,6 +372,28 @@ export declare type MatcherFunction = (console: Record<ConsoleType, ConsoleFunct
|
|
|
123
372
|
*/
|
|
124
373
|
export declare function parseStringToArray(str: string): string[] | null;
|
|
125
374
|
|
|
375
|
+
/**
|
|
376
|
+
* @internal
|
|
377
|
+
*/
|
|
378
|
+
export declare type _PartialObject<T> = Partial<T>;
|
|
379
|
+
|
|
380
|
+
/**
|
|
381
|
+
* @internal
|
|
382
|
+
*/
|
|
383
|
+
export declare type _PartialShallow<T> = {
|
|
384
|
+
[P in keyof T]?: T[P] extends object ? object : T[P];
|
|
385
|
+
};
|
|
386
|
+
|
|
387
|
+
/**
|
|
388
|
+
* @internal
|
|
389
|
+
*/
|
|
390
|
+
export declare type _PropertyName = string | number | symbol;
|
|
391
|
+
|
|
392
|
+
/**
|
|
393
|
+
* @internal
|
|
394
|
+
*/
|
|
395
|
+
export declare type _PropertyPath = _Many<_PropertyName>;
|
|
396
|
+
|
|
126
397
|
/**
|
|
127
398
|
* Generates pseudo-random string.
|
|
128
399
|
*
|
|
@@ -133,6 +404,31 @@ export declare function parseStringToArray(str: string): string[] | null;
|
|
|
133
404
|
*/
|
|
134
405
|
export declare function randomString(len: number): string;
|
|
135
406
|
|
|
407
|
+
/**
|
|
408
|
+
* Creates an array of numbers (positive and/or negative) progressing from `start` up to, but not
|
|
409
|
+
* including, `end`. A step of `-1` is used if a negative `start` is specified without an `end` or
|
|
410
|
+
* `step`. If `end` is not specified, it's set to `start` with `start` then set to `0`.
|
|
411
|
+
*
|
|
412
|
+
* **Note:** JavaScript follows the IEEE-754 standard for resolving floating-point values which can
|
|
413
|
+
* produce unexpected results.
|
|
414
|
+
*
|
|
415
|
+
* @param start - The start of the range.
|
|
416
|
+
* @param end - The end of the range.
|
|
417
|
+
* @param step - The value to increment or decrement by.
|
|
418
|
+
* @returns Returns the range of numbers.
|
|
419
|
+
* @internal
|
|
420
|
+
*/
|
|
421
|
+
export declare function _range(start: number, end?: number, step?: number): number[];
|
|
422
|
+
|
|
423
|
+
/**
|
|
424
|
+
* The iteratee form, so that `_range` can be passed straight to `map` and the like: the index and the
|
|
425
|
+
* collection are ignored and `end` alone defines the range.
|
|
426
|
+
*
|
|
427
|
+
* @see _range
|
|
428
|
+
* @internal
|
|
429
|
+
*/
|
|
430
|
+
export declare function _range(end: number, index: string | number, guard: object): number[];
|
|
431
|
+
|
|
136
432
|
/**
|
|
137
433
|
* Given an object containing the parsed translation bundle, this function creates a new object which contains
|
|
138
434
|
* only key → value mapping between translation key and the actual value.
|
|
@@ -150,6 +446,27 @@ export declare function removeMetadata(translationsWithMetadata: Record<string,
|
|
|
150
446
|
*/
|
|
151
447
|
export declare const sanitizeLocaleForMoment: (intlLocale: string) => string;
|
|
152
448
|
|
|
449
|
+
/**
|
|
450
|
+
* Sets the value at `path` of `object`. If a portion of `path` doesn't exist, it's created. Arrays are
|
|
451
|
+
* created for missing index properties while objects are created for all other missing properties.
|
|
452
|
+
* The segments `__proto__`, `constructor` and `prototype` are refused, which prevents prototype pollution.
|
|
453
|
+
*
|
|
454
|
+
* **Note:** This method mutates `object`.
|
|
455
|
+
*
|
|
456
|
+
* @param object - The object to modify.
|
|
457
|
+
* @param path - The path of the property to set.
|
|
458
|
+
* @param value - The value to set.
|
|
459
|
+
* @returns Returns `object`.
|
|
460
|
+
* @internal
|
|
461
|
+
*/
|
|
462
|
+
export declare function _set<T extends object>(object: T, path: _PropertyPath, value: unknown): T;
|
|
463
|
+
|
|
464
|
+
/**
|
|
465
|
+
* @see _set
|
|
466
|
+
* @internal
|
|
467
|
+
*/
|
|
468
|
+
export declare function _set<TResult>(object: object, path: _PropertyPath, value: unknown): TResult;
|
|
469
|
+
|
|
153
470
|
/**
|
|
154
471
|
* @internal
|
|
155
472
|
*/
|
|
@@ -230,6 +547,26 @@ export declare function suppressConsole<T>(fn: () => T | Promise<T>, type?: Cons
|
|
|
230
547
|
*/
|
|
231
548
|
export declare function suppressConsole<T>(fn: () => T | Promise<T>, matcherFn: MatcherFunction): T | Promise<T>;
|
|
232
549
|
|
|
550
|
+
/**
|
|
551
|
+
* This method is like `uniq` except that it accepts `iteratee` which is invoked for each element in
|
|
552
|
+
* `array` to generate the criterion by which uniqueness is computed. The order of result values is
|
|
553
|
+
* determined by the order they occur in the array. The iteratee is invoked with one argument: (value).
|
|
554
|
+
*
|
|
555
|
+
* @param array - The array to inspect.
|
|
556
|
+
* @param iteratee - The iteratee invoked per element.
|
|
557
|
+
* @returns Returns the new duplicate free array.
|
|
558
|
+
* @internal
|
|
559
|
+
*/
|
|
560
|
+
export declare function _uniqBy<T>(array: _List<T> | null | undefined, iteratee: _ValueIteratee<T>): T[];
|
|
561
|
+
|
|
562
|
+
/**
|
|
563
|
+
* An iteratee as lodash accepts it: a function, a property name or path, a `[path, value]` pair, or a
|
|
564
|
+
* partial object to match.
|
|
565
|
+
*
|
|
566
|
+
* @internal
|
|
567
|
+
*/
|
|
568
|
+
export declare type _ValueIteratee<T> = ((value: T) => _NotVoid) | _IterateeShorthand<T>;
|
|
569
|
+
|
|
233
570
|
/**
|
|
234
571
|
* A waitFor-compatible polling function, structurally matching testing-library's waitFor.
|
|
235
572
|
*
|
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.3",
|
|
4
4
|
"description": "GoodData Utility Functions",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "GoodData",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"oxlint-tsgolint": "7.0.2001",
|
|
47
47
|
"typescript": "7.0.2",
|
|
48
48
|
"vitest": "5.0.4",
|
|
49
|
-
"@gooddata/eslint-config": "11.68.0-alpha.
|
|
50
|
-
"@gooddata/oxlint-config": "11.68.0-alpha.
|
|
49
|
+
"@gooddata/eslint-config": "11.68.0-alpha.3",
|
|
50
|
+
"@gooddata/oxlint-config": "11.68.0-alpha.3"
|
|
51
51
|
},
|
|
52
52
|
"scripts": {
|
|
53
53
|
"_phase:build": "npm run build",
|