@gooddata/util 11.68.0-alpha.2 → 11.68.0-alpha.4
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
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Assigns `value` to `key` of `object` unless an own property with an equivalent value already exists.
|
|
3
|
+
* Boxed strings expose non-writable index properties, so skipping those is what keeps them assignable.
|
|
4
|
+
* A `__proto__` key is defined as an own property so it cannot change the prototype.
|
|
5
|
+
*
|
|
6
|
+
* @param object - The object to modify.
|
|
7
|
+
* @param key - The key of the property to assign.
|
|
8
|
+
* @param value - The value to assign.
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
export declare function _assignValue(object: Record<PropertyKey, unknown>, key: PropertyKey, value: unknown): void;
|
|
12
|
+
//# sourceMappingURL=_assignValue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_assignValue.d.ts","sourceRoot":"","sources":["../../src/_/_assignValue.ts"],"names":[],"mappings":"AAmCA;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,EAAE,GAAG,EAAE,WAAW,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAUzG"}
|
|
@@ -0,0 +1,53 @@
|
|
|
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 { _eq } from "./eq.js";
|
|
33
|
+
/**
|
|
34
|
+
* Assigns `value` to `key` of `object` unless an own property with an equivalent value already exists.
|
|
35
|
+
* Boxed strings expose non-writable index properties, so skipping those is what keeps them assignable.
|
|
36
|
+
* A `__proto__` key is defined as an own property so it cannot change the prototype.
|
|
37
|
+
*
|
|
38
|
+
* @param object - The object to modify.
|
|
39
|
+
* @param key - The key of the property to assign.
|
|
40
|
+
* @param value - The value to assign.
|
|
41
|
+
* @internal
|
|
42
|
+
*/
|
|
43
|
+
export function _assignValue(object, key, value) {
|
|
44
|
+
if (Object.hasOwn(object, key) && _eq(object[key], value) && !(value === undefined && !(key in object))) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
if (key === "__proto__") {
|
|
48
|
+
Object.defineProperty(object, key, { configurable: true, enumerable: true, value, writable: true });
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
object[key] = value;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** Tracks each traversed object and its clone, so cycles and shared references are reproduced. */
|
|
2
|
+
type _Stack = Map<object, unknown>;
|
|
3
|
+
/**
|
|
4
|
+
* The base implementation of `_cloneDeep` which tracks traversed objects.
|
|
5
|
+
*
|
|
6
|
+
* @param value - The value to clone.
|
|
7
|
+
* @param stack - Tracks traversed objects and their clone counterparts.
|
|
8
|
+
* @param nested - Whether `value` sits inside another value being cloned; uncloneable nested values are
|
|
9
|
+
* kept by reference while an uncloneable top-level value becomes an empty object.
|
|
10
|
+
* @returns Returns the cloned value.
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
export declare function _baseClone(value: unknown, stack?: _Stack, nested?: boolean): unknown;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=_baseClone.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_baseClone.d.ts","sourceRoot":"","sources":["../../src/_/_baseClone.ts"],"names":[],"mappings":"AA0EA,kGAAkG;AAClG,KAAK,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAWnC;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,GAAE,MAAkB,EAAE,MAAM,UAAQ,GAAG,OAAO,CAiE7F"}
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
// (C) 2026 GoodData Corporation
|
|
2
|
+
/*!
|
|
3
|
+
* Portions of this file are derived from Lodash.
|
|
4
|
+
* https://github.com/lodash/lodash
|
|
5
|
+
*
|
|
6
|
+
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
7
|
+
*
|
|
8
|
+
* Based on Underscore.js, copyright Jeremy Ashkenas,
|
|
9
|
+
* DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
|
|
10
|
+
*
|
|
11
|
+
* Modifications Copyright (c) 2026 GoodData Corporation
|
|
12
|
+
*
|
|
13
|
+
* Permission is hereby granted, free of charge, to any person obtaining
|
|
14
|
+
* a copy of this software and associated documentation files (the
|
|
15
|
+
* "Software"), to deal in the Software without restriction, including
|
|
16
|
+
* without limitation the rights to use, copy, modify, merge, publish,
|
|
17
|
+
* distribute, sublicense, and/or sell copies of the Software, and to
|
|
18
|
+
* permit persons to whom the Software is furnished to do so, subject to
|
|
19
|
+
* the following conditions:
|
|
20
|
+
*
|
|
21
|
+
* The above copyright notice and this permission notice shall be
|
|
22
|
+
* included in all copies or substantial portions of the Software.
|
|
23
|
+
*
|
|
24
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
25
|
+
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
26
|
+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
27
|
+
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
28
|
+
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
29
|
+
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
30
|
+
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
31
|
+
*/
|
|
32
|
+
import { _assignValue } from "./_assignValue.js";
|
|
33
|
+
import { _baseGetTag } from "./_baseGetTag.js";
|
|
34
|
+
import { _getAllKeys } from "./_getAllKeys.js";
|
|
35
|
+
import { _isIndex } from "./_isIndex.js";
|
|
36
|
+
import { _isPrototype } from "./_isPrototype.js";
|
|
37
|
+
import { _isObject } from "./isObject.js";
|
|
38
|
+
import { _isTypedArray } from "./isTypedArray.js";
|
|
39
|
+
/** `Object#toString` result references. */
|
|
40
|
+
const ARGS_TAG = "[object Arguments]";
|
|
41
|
+
const ARRAY_BUFFER_TAG = "[object ArrayBuffer]";
|
|
42
|
+
const BOOL_TAG = "[object Boolean]";
|
|
43
|
+
const DATA_VIEW_TAG = "[object DataView]";
|
|
44
|
+
const DATE_TAG = "[object Date]";
|
|
45
|
+
const FUNC_TAG = "[object Function]";
|
|
46
|
+
const GEN_TAG = "[object GeneratorFunction]";
|
|
47
|
+
const MAP_TAG = "[object Map]";
|
|
48
|
+
const NUMBER_TAG = "[object Number]";
|
|
49
|
+
const OBJECT_TAG = "[object Object]";
|
|
50
|
+
const REGEXP_TAG = "[object RegExp]";
|
|
51
|
+
const SET_TAG = "[object Set]";
|
|
52
|
+
const STRING_TAG = "[object String]";
|
|
53
|
+
const SYMBOL_TAG = "[object Symbol]";
|
|
54
|
+
/** Tags of the non-plain, non-array values that `_initCloneByTag` knows how to clone. */
|
|
55
|
+
const CLONEABLE_TAGS = new Set([
|
|
56
|
+
ARRAY_BUFFER_TAG,
|
|
57
|
+
BOOL_TAG,
|
|
58
|
+
DATA_VIEW_TAG,
|
|
59
|
+
DATE_TAG,
|
|
60
|
+
MAP_TAG,
|
|
61
|
+
NUMBER_TAG,
|
|
62
|
+
REGEXP_TAG,
|
|
63
|
+
SET_TAG,
|
|
64
|
+
STRING_TAG,
|
|
65
|
+
SYMBOL_TAG,
|
|
66
|
+
]);
|
|
67
|
+
/** Used to match `RegExp` flags from their coerced string values. */
|
|
68
|
+
const RE_FLAGS = /\w*$/;
|
|
69
|
+
/** Node's `Buffer`, when present; typed structurally because this package has no Node typings. */
|
|
70
|
+
const NodeBuffer = globalThis.Buffer;
|
|
71
|
+
/**
|
|
72
|
+
* The base implementation of `_cloneDeep` which tracks traversed objects.
|
|
73
|
+
*
|
|
74
|
+
* @param value - The value to clone.
|
|
75
|
+
* @param stack - Tracks traversed objects and their clone counterparts.
|
|
76
|
+
* @param nested - Whether `value` sits inside another value being cloned; uncloneable nested values are
|
|
77
|
+
* kept by reference while an uncloneable top-level value becomes an empty object.
|
|
78
|
+
* @returns Returns the cloned value.
|
|
79
|
+
* @internal
|
|
80
|
+
*/
|
|
81
|
+
export function _baseClone(value, stack = new Map(), nested = false) {
|
|
82
|
+
if (!_isObject(value)) {
|
|
83
|
+
return value;
|
|
84
|
+
}
|
|
85
|
+
const isArr = Array.isArray(value);
|
|
86
|
+
let result;
|
|
87
|
+
if (isArr) {
|
|
88
|
+
result = _initCloneArray(value);
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
const tag = _baseGetTag(value);
|
|
92
|
+
if (tag === OBJECT_TAG || tag === ARGS_TAG) {
|
|
93
|
+
result = _initCloneObject(value);
|
|
94
|
+
}
|
|
95
|
+
else if (tag === FUNC_TAG || tag === GEN_TAG) {
|
|
96
|
+
if (nested) {
|
|
97
|
+
return value;
|
|
98
|
+
}
|
|
99
|
+
result = {};
|
|
100
|
+
}
|
|
101
|
+
else if (_isTypedArray(value) || CLONEABLE_TAGS.has(tag)) {
|
|
102
|
+
result = _initCloneByTag(value, tag);
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
return nested ? value : {};
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
const stacked = stack.get(value);
|
|
109
|
+
if (stacked) {
|
|
110
|
+
return stacked;
|
|
111
|
+
}
|
|
112
|
+
stack.set(value, result);
|
|
113
|
+
if (value instanceof Set) {
|
|
114
|
+
const target = result;
|
|
115
|
+
value.forEach((subValue) => {
|
|
116
|
+
target.add(_baseClone(subValue, stack, true));
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
else if (value instanceof Map) {
|
|
120
|
+
const target = result;
|
|
121
|
+
// keys are kept by reference, only values are cloned
|
|
122
|
+
value.forEach((subValue, key) => {
|
|
123
|
+
target.set(key, _baseClone(subValue, stack, true));
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
const source = value;
|
|
127
|
+
if (isArr) {
|
|
128
|
+
// holes are visited too and become explicit `undefined` entries in the clone
|
|
129
|
+
for (let index = 0; index < value.length; index++) {
|
|
130
|
+
_assignValue(result, index, _baseClone(source[index], stack, true));
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
for (const key of _ownKeys(value)) {
|
|
135
|
+
_assignValue(result, key, _baseClone(source[key], stack, true));
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
return result;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Own enumerable string and symbol keys to copy. Typed arrays skip their index keys, which the clone
|
|
142
|
+
* already holds, so only extra properties set on them are visited.
|
|
143
|
+
*/
|
|
144
|
+
function _ownKeys(value) {
|
|
145
|
+
const keys = _getAllKeys(value);
|
|
146
|
+
if (!_isTypedArray(value)) {
|
|
147
|
+
return keys;
|
|
148
|
+
}
|
|
149
|
+
const length = value.length;
|
|
150
|
+
return keys.filter((key) => typeof key === "symbol" || !_isIndex(key, length));
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Initializes an array clone of the same class and length, copying the properties `RegExp#exec` adds.
|
|
154
|
+
*/
|
|
155
|
+
function _initCloneArray(array) {
|
|
156
|
+
const length = array.length;
|
|
157
|
+
const result = new array.constructor(length);
|
|
158
|
+
if (length && typeof array[0] === "string" && Object.hasOwn(array, "index")) {
|
|
159
|
+
const execResult = array;
|
|
160
|
+
result["index"] = execResult["index"];
|
|
161
|
+
result["input"] = execResult["input"];
|
|
162
|
+
}
|
|
163
|
+
return result;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Initializes a plain-object clone with the same prototype. Prototype objects and objects without a
|
|
167
|
+
* constructor function, such as null-prototype objects, clone into ordinary `Object` instances.
|
|
168
|
+
*/
|
|
169
|
+
function _initCloneObject(object) {
|
|
170
|
+
if (typeof object.constructor !== "function" || _isPrototype(object)) {
|
|
171
|
+
return {};
|
|
172
|
+
}
|
|
173
|
+
const proto = Object.getPrototypeOf(object);
|
|
174
|
+
return _isObject(proto) ? Object.create(proto) : {};
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Initializes a clone of a value by its `toStringTag`. Collections come back empty and are filled by
|
|
178
|
+
* the caller; everything else is complete on return.
|
|
179
|
+
*/
|
|
180
|
+
function _initCloneByTag(object, tag) {
|
|
181
|
+
const Ctor = object.constructor;
|
|
182
|
+
switch (tag) {
|
|
183
|
+
case ARRAY_BUFFER_TAG:
|
|
184
|
+
return _cloneArrayBuffer(object);
|
|
185
|
+
case BOOL_TAG:
|
|
186
|
+
case DATE_TAG:
|
|
187
|
+
return new Ctor(Number(object));
|
|
188
|
+
case DATA_VIEW_TAG: {
|
|
189
|
+
const view = object;
|
|
190
|
+
return new Ctor(_cloneArrayBuffer(view.buffer), view.byteOffset, view.byteLength);
|
|
191
|
+
}
|
|
192
|
+
case MAP_TAG:
|
|
193
|
+
case SET_TAG:
|
|
194
|
+
return new Ctor();
|
|
195
|
+
case NUMBER_TAG:
|
|
196
|
+
case STRING_TAG:
|
|
197
|
+
return new Ctor(object);
|
|
198
|
+
case REGEXP_TAG: {
|
|
199
|
+
const regexp = object;
|
|
200
|
+
const result = new Ctor(regexp.source, RE_FLAGS.exec(String(regexp))?.[0]);
|
|
201
|
+
result.lastIndex = regexp.lastIndex;
|
|
202
|
+
return result;
|
|
203
|
+
}
|
|
204
|
+
case SYMBOL_TAG:
|
|
205
|
+
return Object(object.valueOf());
|
|
206
|
+
}
|
|
207
|
+
return _cloneTypedArray(object);
|
|
208
|
+
}
|
|
209
|
+
function _cloneArrayBuffer(arrayBuffer) {
|
|
210
|
+
const result = new arrayBuffer.constructor(arrayBuffer.byteLength);
|
|
211
|
+
new Uint8Array(result).set(new Uint8Array(arrayBuffer));
|
|
212
|
+
return result;
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Clones a typed array of any class, keeping its view offset and length over a copy of the whole buffer.
|
|
216
|
+
* A Node `Buffer` is copied through `Buffer.from`, since constructing one directly is deprecated.
|
|
217
|
+
*/
|
|
218
|
+
function _cloneTypedArray(typedArray) {
|
|
219
|
+
if (NodeBuffer?.isBuffer(typedArray)) {
|
|
220
|
+
return NodeBuffer.from(typedArray);
|
|
221
|
+
}
|
|
222
|
+
const Ctor = typedArray.constructor;
|
|
223
|
+
return new Ctor(_cloneArrayBuffer(typedArray.buffer), typedArray.byteOffset, typedArray.length);
|
|
224
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The base implementation of `forEach` without support for iteratee shorthands: visits every element
|
|
3
|
+
* of an array-like by index, holes included, or every own enumerable value of an object by key. The
|
|
4
|
+
* iteratee may stop the iteration early by returning `false`.
|
|
5
|
+
*
|
|
6
|
+
* @param collection - The collection to iterate over.
|
|
7
|
+
* @param iteratee - The function invoked per iteration with the value, its index or key, and the collection.
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export declare function _baseEach(collection: unknown, iteratee: (value: unknown, key: string | number, collection: object) => unknown): void;
|
|
11
|
+
//# sourceMappingURL=_baseEach.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_baseEach.d.ts","sourceRoot":"","sources":["../../src/_/_baseEach.ts"],"names":[],"mappings":"AAoCA;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CACrB,UAAU,EAAE,OAAO,EACnB,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,UAAU,EAAE,MAAM,KAAK,OAAO,GAChF,IAAI,CAwBN"}
|
|
@@ -0,0 +1,62 @@
|
|
|
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 { _baseKeys } from "./_baseKeys.js";
|
|
33
|
+
import { _isArrayLike } from "./isArrayLike.js";
|
|
34
|
+
/**
|
|
35
|
+
* The base implementation of `forEach` without support for iteratee shorthands: visits every element
|
|
36
|
+
* of an array-like by index, holes included, or every own enumerable value of an object by key. The
|
|
37
|
+
* iteratee may stop the iteration early by returning `false`.
|
|
38
|
+
*
|
|
39
|
+
* @param collection - The collection to iterate over.
|
|
40
|
+
* @param iteratee - The function invoked per iteration with the value, its index or key, and the collection.
|
|
41
|
+
* @internal
|
|
42
|
+
*/
|
|
43
|
+
export function _baseEach(collection, iteratee) {
|
|
44
|
+
if (collection == null) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
const iterable = Object(collection);
|
|
48
|
+
if (_isArrayLike(collection)) {
|
|
49
|
+
const length = collection.length;
|
|
50
|
+
for (let index = 0; index < length; index++) {
|
|
51
|
+
if (iteratee(iterable[index], index, iterable) === false) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
for (const key of _baseKeys(iterable)) {
|
|
58
|
+
if (iteratee(iterable[key], key, iterable) === false) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The base implementation of `get` without support for default values.
|
|
3
|
+
*
|
|
4
|
+
* @param object - The object to query.
|
|
5
|
+
* @param path - The path of the property to get.
|
|
6
|
+
* @returns Returns the resolved value, or `undefined` when the path is empty or cannot be followed.
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
export declare function _baseGet(object: unknown, path: unknown): unknown;
|
|
10
|
+
//# sourceMappingURL=_baseGet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_baseGet.d.ts","sourceRoot":"","sources":["../../src/_/_baseGet.ts"],"names":[],"mappings":"AAoCA;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAUhE"}
|
|
@@ -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 { _castPath } from "./_castPath.js";
|
|
33
|
+
import { _toKey } from "./_toKey.js";
|
|
34
|
+
/**
|
|
35
|
+
* The base implementation of `get` without support for default values.
|
|
36
|
+
*
|
|
37
|
+
* @param object - The object to query.
|
|
38
|
+
* @param path - The path of the property to get.
|
|
39
|
+
* @returns Returns the resolved value, or `undefined` when the path is empty or cannot be followed.
|
|
40
|
+
* @internal
|
|
41
|
+
*/
|
|
42
|
+
export function _baseGet(object, path) {
|
|
43
|
+
const keys = _castPath(path, object);
|
|
44
|
+
let current = object;
|
|
45
|
+
let index = 0;
|
|
46
|
+
while (current != null && index < keys.length) {
|
|
47
|
+
current = current[_toKey(keys[index++])];
|
|
48
|
+
}
|
|
49
|
+
return index && index === keys.length ? current : undefined;
|
|
50
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The base implementation of `getTag` without fallbacks for buggy environments.
|
|
3
|
+
*
|
|
4
|
+
* @param value - The value to query.
|
|
5
|
+
* @returns Returns the `toStringTag`.
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export declare function _baseGetTag(value: unknown): string;
|
|
9
|
+
//# sourceMappingURL=_baseGetTag.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_baseGetTag.d.ts","sourceRoot":"","sources":["../../src/_/_baseGetTag.ts"],"names":[],"mappings":"AAuCA;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAMlD"}
|
|
@@ -0,0 +1,48 @@
|
|
|
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 { _getRawTag } from "./_getRawTag.js";
|
|
33
|
+
/** `Object#toString` result references. */
|
|
34
|
+
const NULL_TAG = "[object Null]";
|
|
35
|
+
const UNDEFINED_TAG = "[object Undefined]";
|
|
36
|
+
/**
|
|
37
|
+
* The base implementation of `getTag` without fallbacks for buggy environments.
|
|
38
|
+
*
|
|
39
|
+
* @param value - The value to query.
|
|
40
|
+
* @returns Returns the `toStringTag`.
|
|
41
|
+
* @internal
|
|
42
|
+
*/
|
|
43
|
+
export function _baseGetTag(value) {
|
|
44
|
+
if (value == null) {
|
|
45
|
+
return value === undefined ? UNDEFINED_TAG : NULL_TAG;
|
|
46
|
+
}
|
|
47
|
+
return Symbol.toStringTag in Object(value) ? _getRawTag(value) : Object.prototype.toString.call(value);
|
|
48
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tracks objects currently being compared, each mapped to its counterpart on the other side, so that
|
|
3
|
+
* cyclic structures terminate: meeting an already-tracked pair again counts as equal.
|
|
4
|
+
*/
|
|
5
|
+
type _Stack = Map<object, object>;
|
|
6
|
+
/**
|
|
7
|
+
* How two values are compared.
|
|
8
|
+
*
|
|
9
|
+
* `unordered` makes array elements match in any order; it is switched on for the contents of maps
|
|
10
|
+
* and sets and, as in lodash, stays on for everything nested inside them.
|
|
11
|
+
*
|
|
12
|
+
* `partial` makes `value` a pattern that `other` only has to contain: arrays may be longer, objects
|
|
13
|
+
* may have extra keys, inherited keys count, and constructors are not compared. It is what the
|
|
14
|
+
* object and `[path, value]` iteratee shorthands use.
|
|
15
|
+
*
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
18
|
+
export type _CompareOptions = {
|
|
19
|
+
unordered: boolean;
|
|
20
|
+
partial: boolean;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* The base implementation of `_isEqual` which tracks traversed objects.
|
|
24
|
+
*
|
|
25
|
+
* @param value - The value to compare.
|
|
26
|
+
* @param other - The other value to compare.
|
|
27
|
+
* @param options - See {@link _CompareOptions}; both flags default to `false`.
|
|
28
|
+
* @param stack - Tracks traversed `value` and `other` objects.
|
|
29
|
+
* @returns Returns `true` if the values are equivalent, else `false`.
|
|
30
|
+
* @internal
|
|
31
|
+
*/
|
|
32
|
+
export declare function _baseIsEqual(value: unknown, other: unknown, options?: Partial<_CompareOptions>, stack?: _Stack): boolean;
|
|
33
|
+
export {};
|
|
34
|
+
//# sourceMappingURL=_baseIsEqual.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_baseIsEqual.d.ts","sourceRoot":"","sources":["../../src/_/_baseIsEqual.ts"],"names":[],"mappings":"AAuDA;;;GAGG;AACH,KAAK,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAElC;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,eAAe,GAAG;IAC1B,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;CACpB,CAAC;AAIF;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CACxB,KAAK,EAAE,OAAO,EACd,KAAK,EAAE,OAAO,EACd,OAAO,GAAE,OAAO,CAAC,eAAe,CAAmB,EACnD,KAAK,GAAE,MAAkB,GAC1B,OAAO,CAaT"}
|