@gooddata/util 11.68.0-alpha.4 → 11.68.0-alpha.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +177 -0
- package/esm/_/_arrayAggregator.d.ts +42 -0
- package/esm/_/_arrayAggregator.d.ts.map +1 -0
- package/esm/_/_arrayAggregator.js +51 -0
- package/esm/_/_assignValue.d.ts.map +1 -1
- package/esm/_/_assignValue.js +2 -6
- package/esm/_/_baseAggregator.d.ts +13 -0
- package/esm/_/_baseAggregator.d.ts.map +1 -0
- package/esm/_/_baseAggregator.js +50 -0
- package/esm/_/_baseAssignValue.d.ts +41 -0
- package/esm/_/_baseAssignValue.d.ts.map +1 -0
- package/esm/_/_baseAssignValue.js +48 -0
- package/esm/_/_baseClone.d.ts.map +1 -1
- package/esm/_/_baseClone.js +3 -30
- package/esm/_/_baseMerge.d.ts +15 -0
- package/esm/_/_baseMerge.d.ts.map +1 -0
- package/esm/_/_baseMerge.js +137 -0
- package/esm/_/_baseOrderBy.d.ts +11 -0
- package/esm/_/_baseOrderBy.d.ts.map +1 -0
- package/esm/_/_baseOrderBy.js +70 -0
- package/esm/_/_cloneArrayBuffer.d.ts +39 -0
- package/esm/_/_cloneArrayBuffer.d.ts.map +1 -0
- package/esm/_/_cloneArrayBuffer.js +45 -0
- package/esm/_/_cloneTypedArray.d.ts +10 -0
- package/esm/_/_cloneTypedArray.d.ts.map +1 -0
- package/esm/_/_cloneTypedArray.js +49 -0
- package/esm/_/_compareAscending.d.ts +12 -0
- package/esm/_/_compareAscending.d.ts.map +1 -0
- package/esm/_/_compareAscending.js +78 -0
- package/esm/_/_createAggregator.d.ts +10 -0
- package/esm/_/_createAggregator.d.ts.map +1 -0
- package/esm/_/_createAggregator.js +50 -0
- package/esm/_/_initCloneObject.d.ts +10 -0
- package/esm/_/_initCloneObject.d.ts.map +1 -0
- package/esm/_/_initCloneObject.js +48 -0
- package/esm/_/_unicode.d.ts +27 -0
- package/esm/_/_unicode.d.ts.map +1 -0
- package/esm/_/_unicode.js +120 -0
- package/esm/_/camelCase.d.ts +11 -0
- package/esm/_/camelCase.d.ts.map +1 -0
- package/esm/_/camelCase.js +56 -0
- package/esm/_/deburr.d.ts +10 -0
- package/esm/_/deburr.d.ts.map +1 -0
- package/esm/_/deburr.js +242 -0
- package/esm/_/isArray.d.ts +61 -0
- package/esm/_/isArray.d.ts.map +1 -0
- package/esm/_/isArray.js +62 -0
- package/esm/_/keysIn.d.ts +10 -0
- package/esm/_/keysIn.d.ts.map +1 -0
- package/esm/_/keysIn.js +54 -0
- package/esm/_/memoize.d.ts +89 -0
- package/esm/_/memoize.d.ts.map +1 -0
- package/esm/_/memoize.js +36 -0
- package/esm/_/merge.d.ts +32 -0
- package/esm/_/merge.d.ts.map +1 -0
- package/esm/_/merge.js +45 -0
- package/esm/_/omit.d.ts +1 -5
- package/esm/_/omit.d.ts.map +1 -1
- package/esm/_/partition.d.ts +23 -0
- package/esm/_/partition.d.ts.map +1 -0
- package/esm/_/partition.js +42 -0
- package/esm/_/pick.d.ts +18 -0
- package/esm/_/pick.d.ts.map +1 -0
- package/esm/_/pick.js +48 -0
- package/esm/_/sortBy.d.ts +17 -0
- package/esm/_/sortBy.d.ts.map +1 -0
- package/esm/_/sortBy.js +46 -0
- package/esm/_/throttle.d.ts +76 -0
- package/esm/_/throttle.d.ts.map +1 -0
- package/esm/_/throttle.js +45 -0
- package/esm/_/types.d.ts +26 -0
- package/esm/_/types.d.ts.map +1 -1
- package/esm/_/uniq.d.ts +12 -0
- package/esm/_/uniq.d.ts.map +1 -0
- package/esm/_/uniq.js +47 -0
- package/esm/_/words.d.ts +9 -0
- package/esm/_/words.d.ts.map +1 -0
- package/esm/_/words.js +50 -0
- package/esm/index.d.ts +10 -2
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +8 -0
- package/esm/util.d.ts +254 -0
- package/package.json +5 -4
|
@@ -0,0 +1,137 @@
|
|
|
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 { _baseAssignValue } from "./_baseAssignValue.js";
|
|
33
|
+
import { _cloneTypedArray } from "./_cloneTypedArray.js";
|
|
34
|
+
import { _initCloneObject } from "./_initCloneObject.js";
|
|
35
|
+
import { _eq } from "./eq.js";
|
|
36
|
+
import { _isArguments } from "./isArguments.js";
|
|
37
|
+
import { _isArrayLike } from "./isArrayLike.js";
|
|
38
|
+
import { _isObject } from "./isObject.js";
|
|
39
|
+
import { _isObjectLike } from "./isObjectLike.js";
|
|
40
|
+
import { _isPlainObject } from "./isPlainObject.js";
|
|
41
|
+
import { _isTypedArray } from "./isTypedArray.js";
|
|
42
|
+
import { _keysIn } from "./keysIn.js";
|
|
43
|
+
/**
|
|
44
|
+
* The base implementation of `_merge` for a single source: merges the own and inherited enumerable string
|
|
45
|
+
* keyed properties of `source` into `object`.
|
|
46
|
+
*
|
|
47
|
+
* @param object - The destination object.
|
|
48
|
+
* @param source - The source object.
|
|
49
|
+
* @param stack - Tracks traversed source values and their merged counterparts.
|
|
50
|
+
* @internal
|
|
51
|
+
*/
|
|
52
|
+
export function _baseMerge(object, source, stack) {
|
|
53
|
+
if (object === source) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
for (const key of _keysIn(source)) {
|
|
57
|
+
const srcValue = source[key];
|
|
58
|
+
if (_isObject(srcValue)) {
|
|
59
|
+
_mergeDeep(object, source, key, stack);
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
_assignMergeValue(object, key, srcValue);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Merges the object value at `key`: arrays and plain objects are merged recursively into the destination
|
|
68
|
+
* value, typed arrays are copied, and any other object is assigned by reference.
|
|
69
|
+
*/
|
|
70
|
+
function _mergeDeep(object, source, key, stack) {
|
|
71
|
+
const objValue = _safeGet(object, key);
|
|
72
|
+
const srcValue = _safeGet(source, key);
|
|
73
|
+
const stacked = stack.get(srcValue);
|
|
74
|
+
if (stacked) {
|
|
75
|
+
_assignMergeValue(object, key, stacked);
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
let newValue = srcValue;
|
|
79
|
+
// whether `srcValue` still has to be merged into `newValue`
|
|
80
|
+
let isCommon = true;
|
|
81
|
+
const isArr = Array.isArray(srcValue);
|
|
82
|
+
const isTyped = !isArr && _isTypedArray(srcValue);
|
|
83
|
+
if (isArr || isTyped) {
|
|
84
|
+
if (Array.isArray(objValue)) {
|
|
85
|
+
newValue = objValue;
|
|
86
|
+
}
|
|
87
|
+
else if (_isObjectLike(objValue) && _isArrayLike(objValue)) {
|
|
88
|
+
newValue = Array.from(objValue);
|
|
89
|
+
}
|
|
90
|
+
else if (isTyped) {
|
|
91
|
+
isCommon = false;
|
|
92
|
+
newValue = _cloneTypedArray(srcValue);
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
newValue = [];
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
else if (_isPlainObject(srcValue) || _isArguments(srcValue)) {
|
|
99
|
+
newValue = objValue;
|
|
100
|
+
if (_isArguments(objValue)) {
|
|
101
|
+
newValue = _toPlainObject(objValue);
|
|
102
|
+
}
|
|
103
|
+
else if (!_isObject(objValue) || typeof objValue === "function") {
|
|
104
|
+
newValue = _initCloneObject(srcValue);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
isCommon = false;
|
|
109
|
+
}
|
|
110
|
+
if (isCommon) {
|
|
111
|
+
stack.set(srcValue, newValue);
|
|
112
|
+
_baseMerge(newValue, srcValue, stack);
|
|
113
|
+
stack.delete(srcValue);
|
|
114
|
+
}
|
|
115
|
+
_assignMergeValue(object, key, newValue);
|
|
116
|
+
}
|
|
117
|
+
/** Assigns `value` unless it equals the current value, or is `undefined` while the key already exists. */
|
|
118
|
+
function _assignMergeValue(object, key, value) {
|
|
119
|
+
if ((value !== undefined && !_eq(object[key], value)) || (value === undefined && !(key in object))) {
|
|
120
|
+
_baseAssignValue(object, key, value);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
/** Reads `object[key]`, except for `__proto__` and a `constructor` function, which are never merged. */
|
|
124
|
+
function _safeGet(object, key) {
|
|
125
|
+
if (key === "__proto__" || (key === "constructor" && typeof object[key] === "function")) {
|
|
126
|
+
return undefined;
|
|
127
|
+
}
|
|
128
|
+
return object[key];
|
|
129
|
+
}
|
|
130
|
+
/** Copies the own and inherited enumerable string keyed properties of `value` into a new plain object. */
|
|
131
|
+
function _toPlainObject(value) {
|
|
132
|
+
const result = {};
|
|
133
|
+
for (const key of _keysIn(value)) {
|
|
134
|
+
_baseAssignValue(result, key, value[key]);
|
|
135
|
+
}
|
|
136
|
+
return result;
|
|
137
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The base implementation of `_sortBy` without param guards: sorts the values of `collection` in ascending
|
|
3
|
+
* order by the results of each iteratee, comparing the results of the first iteratee first.
|
|
4
|
+
*
|
|
5
|
+
* @param collection - The collection to iterate over.
|
|
6
|
+
* @param iteratees - The iteratees to sort by; an array iteratee is a property path.
|
|
7
|
+
* @returns Returns the new sorted array.
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export declare function _baseOrderBy(collection: unknown, iteratees: unknown[]): unknown[];
|
|
11
|
+
//# sourceMappingURL=_baseOrderBy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_baseOrderBy.d.ts","sourceRoot":"","sources":["../../src/_/_baseOrderBy.ts"],"names":[],"mappings":"AA2CA;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,OAAO,EAAE,CAYjF"}
|
|
@@ -0,0 +1,70 @@
|
|
|
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 { _baseEach } from "./_baseEach.js";
|
|
33
|
+
import { _baseGet } from "./_baseGet.js";
|
|
34
|
+
import { _baseIteratee } from "./_baseIteratee.js";
|
|
35
|
+
import { _compareAscending } from "./_compareAscending.js";
|
|
36
|
+
/**
|
|
37
|
+
* The base implementation of `_sortBy` without param guards: sorts the values of `collection` in ascending
|
|
38
|
+
* order by the results of each iteratee, comparing the results of the first iteratee first.
|
|
39
|
+
*
|
|
40
|
+
* @param collection - The collection to iterate over.
|
|
41
|
+
* @param iteratees - The iteratees to sort by; an array iteratee is a property path.
|
|
42
|
+
* @returns Returns the new sorted array.
|
|
43
|
+
* @internal
|
|
44
|
+
*/
|
|
45
|
+
export function _baseOrderBy(collection, iteratees) {
|
|
46
|
+
const getters = iteratees.length ? iteratees.map(_toGetter) : [(value) => value];
|
|
47
|
+
const entries = [];
|
|
48
|
+
_baseEach(collection, (value) => {
|
|
49
|
+
entries.push({ criteria: getters.map((getter) => getter(value)), value });
|
|
50
|
+
});
|
|
51
|
+
// `Array#sort` is stable, so elements with equal criteria keep their input order
|
|
52
|
+
entries.sort(_compareEntries);
|
|
53
|
+
return entries.map((entry) => entry.value);
|
|
54
|
+
}
|
|
55
|
+
/** An array iteratee is a property path; a one-element path is read as its single key. */
|
|
56
|
+
function _toGetter(iteratee) {
|
|
57
|
+
if (Array.isArray(iteratee)) {
|
|
58
|
+
return (value) => _baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
|
|
59
|
+
}
|
|
60
|
+
return _baseIteratee(iteratee);
|
|
61
|
+
}
|
|
62
|
+
function _compareEntries(entry, other) {
|
|
63
|
+
for (let index = 0; index < entry.criteria.length; index++) {
|
|
64
|
+
const result = _compareAscending(entry.criteria[index], other.criteria[index]);
|
|
65
|
+
if (result) {
|
|
66
|
+
return result;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return 0;
|
|
70
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Portions of this file are derived from Lodash.
|
|
3
|
+
* https://github.com/lodash/lodash
|
|
4
|
+
*
|
|
5
|
+
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
6
|
+
*
|
|
7
|
+
* Based on Underscore.js, copyright Jeremy Ashkenas,
|
|
8
|
+
* DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
|
|
9
|
+
*
|
|
10
|
+
* Modifications Copyright (c) 2026 GoodData Corporation
|
|
11
|
+
*
|
|
12
|
+
* Permission is hereby granted, free of charge, to any person obtaining
|
|
13
|
+
* a copy of this software and associated documentation files (the
|
|
14
|
+
* "Software"), to deal in the Software without restriction, including
|
|
15
|
+
* without limitation the rights to use, copy, modify, merge, publish,
|
|
16
|
+
* distribute, sublicense, and/or sell copies of the Software, and to
|
|
17
|
+
* permit persons to whom the Software is furnished to do so, subject to
|
|
18
|
+
* the following conditions:
|
|
19
|
+
*
|
|
20
|
+
* The above copyright notice and this permission notice shall be
|
|
21
|
+
* included in all copies or substantial portions of the Software.
|
|
22
|
+
*
|
|
23
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
24
|
+
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
25
|
+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
26
|
+
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
27
|
+
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
28
|
+
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
29
|
+
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
30
|
+
*/
|
|
31
|
+
/**
|
|
32
|
+
* Creates a clone of `arrayBuffer` of the same class and byte length.
|
|
33
|
+
*
|
|
34
|
+
* @param arrayBuffer - The array buffer to clone.
|
|
35
|
+
* @returns Returns the cloned array buffer.
|
|
36
|
+
* @internal
|
|
37
|
+
*/
|
|
38
|
+
export declare function _cloneArrayBuffer(arrayBuffer: ArrayBufferLike): ArrayBufferLike;
|
|
39
|
+
//# sourceMappingURL=_cloneArrayBuffer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_cloneArrayBuffer.d.ts","sourceRoot":"","sources":["../../src/_/_cloneArrayBuffer.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,eAAe,GAAG,eAAe,CAQ/E"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// (C) 2026 GoodData Corporation
|
|
2
|
+
/*!
|
|
3
|
+
* Portions of this file are derived from Lodash.
|
|
4
|
+
* https://github.com/lodash/lodash
|
|
5
|
+
*
|
|
6
|
+
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
7
|
+
*
|
|
8
|
+
* Based on Underscore.js, copyright Jeremy Ashkenas,
|
|
9
|
+
* DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
|
|
10
|
+
*
|
|
11
|
+
* Modifications Copyright (c) 2026 GoodData Corporation
|
|
12
|
+
*
|
|
13
|
+
* Permission is hereby granted, free of charge, to any person obtaining
|
|
14
|
+
* a copy of this software and associated documentation files (the
|
|
15
|
+
* "Software"), to deal in the Software without restriction, including
|
|
16
|
+
* without limitation the rights to use, copy, modify, merge, publish,
|
|
17
|
+
* distribute, sublicense, and/or sell copies of the Software, and to
|
|
18
|
+
* permit persons to whom the Software is furnished to do so, subject to
|
|
19
|
+
* the following conditions:
|
|
20
|
+
*
|
|
21
|
+
* The above copyright notice and this permission notice shall be
|
|
22
|
+
* included in all copies or substantial portions of the Software.
|
|
23
|
+
*
|
|
24
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
25
|
+
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
26
|
+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
27
|
+
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
28
|
+
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
29
|
+
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
30
|
+
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
31
|
+
*/
|
|
32
|
+
/**
|
|
33
|
+
* Creates a clone of `arrayBuffer` of the same class and byte length.
|
|
34
|
+
*
|
|
35
|
+
* @param arrayBuffer - The array buffer to clone.
|
|
36
|
+
* @returns Returns the cloned array buffer.
|
|
37
|
+
* @internal
|
|
38
|
+
*/
|
|
39
|
+
export function _cloneArrayBuffer(arrayBuffer) {
|
|
40
|
+
const Ctor = arrayBuffer
|
|
41
|
+
.constructor;
|
|
42
|
+
const result = new Ctor(arrayBuffer.byteLength);
|
|
43
|
+
new Uint8Array(result).set(new Uint8Array(arrayBuffer));
|
|
44
|
+
return result;
|
|
45
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Clones a typed array of any class, keeping its view offset and length over a copy of the whole buffer.
|
|
3
|
+
* A Node `Buffer` is copied through `Buffer.from`, since constructing one directly is deprecated.
|
|
4
|
+
*
|
|
5
|
+
* @param typedArray - The typed array to clone.
|
|
6
|
+
* @returns Returns the cloned typed array.
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
export declare function _cloneTypedArray(typedArray: ArrayBufferView & ArrayLike<unknown>): ArrayBufferView;
|
|
10
|
+
//# sourceMappingURL=_cloneTypedArray.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_cloneTypedArray.d.ts","sourceRoot":"","sources":["../../src/_/_cloneTypedArray.ts"],"names":[],"mappings":"AA8CA;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,eAAe,GAAG,SAAS,CAAC,OAAO,CAAC,GAAG,eAAe,CAQlG"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// (C) 2026 GoodData Corporation
|
|
2
|
+
/*!
|
|
3
|
+
* Portions of this file are derived from Lodash.
|
|
4
|
+
* https://github.com/lodash/lodash
|
|
5
|
+
*
|
|
6
|
+
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
7
|
+
*
|
|
8
|
+
* Based on Underscore.js, copyright Jeremy Ashkenas,
|
|
9
|
+
* DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
|
|
10
|
+
*
|
|
11
|
+
* Modifications Copyright (c) 2026 GoodData Corporation
|
|
12
|
+
*
|
|
13
|
+
* Permission is hereby granted, free of charge, to any person obtaining
|
|
14
|
+
* a copy of this software and associated documentation files (the
|
|
15
|
+
* "Software"), to deal in the Software without restriction, including
|
|
16
|
+
* without limitation the rights to use, copy, modify, merge, publish,
|
|
17
|
+
* distribute, sublicense, and/or sell copies of the Software, and to
|
|
18
|
+
* permit persons to whom the Software is furnished to do so, subject to
|
|
19
|
+
* the following conditions:
|
|
20
|
+
*
|
|
21
|
+
* The above copyright notice and this permission notice shall be
|
|
22
|
+
* included in all copies or substantial portions of the Software.
|
|
23
|
+
*
|
|
24
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
25
|
+
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
26
|
+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
27
|
+
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
28
|
+
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
29
|
+
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
30
|
+
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
31
|
+
*/
|
|
32
|
+
import { _cloneArrayBuffer } from "./_cloneArrayBuffer.js";
|
|
33
|
+
/** Node's `Buffer`, when present; typed structurally because this package has no Node typings. */
|
|
34
|
+
const NodeBuffer = globalThis.Buffer;
|
|
35
|
+
/**
|
|
36
|
+
* Clones a typed array of any class, keeping its view offset and length over a copy of the whole buffer.
|
|
37
|
+
* A Node `Buffer` is copied through `Buffer.from`, since constructing one directly is deprecated.
|
|
38
|
+
*
|
|
39
|
+
* @param typedArray - The typed array to clone.
|
|
40
|
+
* @returns Returns the cloned typed array.
|
|
41
|
+
* @internal
|
|
42
|
+
*/
|
|
43
|
+
export function _cloneTypedArray(typedArray) {
|
|
44
|
+
if (NodeBuffer?.isBuffer(typedArray)) {
|
|
45
|
+
return NodeBuffer.from(typedArray);
|
|
46
|
+
}
|
|
47
|
+
const Ctor = typedArray.constructor;
|
|
48
|
+
return new Ctor(_cloneArrayBuffer(typedArray.buffer), typedArray.byteOffset, typedArray.length);
|
|
49
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compares values to sort them in ascending order. Ordinary values come first, compared with `<` and `>`,
|
|
3
|
+
* followed by symbols, `null`, `undefined` and `NaN`, in that order. Values of the same group that are
|
|
4
|
+
* neither smaller nor greater than each other compare as equal.
|
|
5
|
+
*
|
|
6
|
+
* @param value - The value to compare.
|
|
7
|
+
* @param other - The other value to compare.
|
|
8
|
+
* @returns Returns the sort order indicator for `value`.
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
export declare function _compareAscending(value: unknown, other: unknown): number;
|
|
12
|
+
//# sourceMappingURL=_compareAscending.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_compareAscending.d.ts","sourceRoot":"","sources":["../../src/_/_compareAscending.ts"],"names":[],"mappings":"AAmCA;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM,CAwBxE"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
// (C) 2026 GoodData Corporation
|
|
2
|
+
/*!
|
|
3
|
+
* Portions of this file are derived from Lodash.
|
|
4
|
+
* https://github.com/lodash/lodash
|
|
5
|
+
*
|
|
6
|
+
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
7
|
+
*
|
|
8
|
+
* Based on Underscore.js, copyright Jeremy Ashkenas,
|
|
9
|
+
* DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
|
|
10
|
+
*
|
|
11
|
+
* Modifications Copyright (c) 2026 GoodData Corporation
|
|
12
|
+
*
|
|
13
|
+
* Permission is hereby granted, free of charge, to any person obtaining
|
|
14
|
+
* a copy of this software and associated documentation files (the
|
|
15
|
+
* "Software"), to deal in the Software without restriction, including
|
|
16
|
+
* without limitation the rights to use, copy, modify, merge, publish,
|
|
17
|
+
* distribute, sublicense, and/or sell copies of the Software, and to
|
|
18
|
+
* permit persons to whom the Software is furnished to do so, subject to
|
|
19
|
+
* the following conditions:
|
|
20
|
+
*
|
|
21
|
+
* The above copyright notice and this permission notice shall be
|
|
22
|
+
* included in all copies or substantial portions of the Software.
|
|
23
|
+
*
|
|
24
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
25
|
+
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
26
|
+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
27
|
+
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
28
|
+
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
29
|
+
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
30
|
+
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
31
|
+
*/
|
|
32
|
+
import { _isSymbol } from "./isSymbol.js";
|
|
33
|
+
/**
|
|
34
|
+
* Compares values to sort them in ascending order. Ordinary values come first, compared with `<` and `>`,
|
|
35
|
+
* followed by symbols, `null`, `undefined` and `NaN`, in that order. Values of the same group that are
|
|
36
|
+
* neither smaller nor greater than each other compare as equal.
|
|
37
|
+
*
|
|
38
|
+
* @param value - The value to compare.
|
|
39
|
+
* @param other - The other value to compare.
|
|
40
|
+
* @returns Returns the sort order indicator for `value`.
|
|
41
|
+
* @internal
|
|
42
|
+
*/
|
|
43
|
+
export function _compareAscending(value, other) {
|
|
44
|
+
if (value === other) {
|
|
45
|
+
return 0;
|
|
46
|
+
}
|
|
47
|
+
const valueRank = _rank(value);
|
|
48
|
+
const otherRank = _rank(other);
|
|
49
|
+
if (valueRank !== otherRank) {
|
|
50
|
+
return valueRank < otherRank ? -1 : 1;
|
|
51
|
+
}
|
|
52
|
+
// only ordinary values are compared to each other; the relational operators handle any type pair
|
|
53
|
+
if (valueRank === 0) {
|
|
54
|
+
if (value > other) {
|
|
55
|
+
return 1;
|
|
56
|
+
}
|
|
57
|
+
if (value < other) {
|
|
58
|
+
return -1;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return 0;
|
|
62
|
+
}
|
|
63
|
+
function _rank(value) {
|
|
64
|
+
if (_isSymbol(value)) {
|
|
65
|
+
return 1;
|
|
66
|
+
}
|
|
67
|
+
if (value === null) {
|
|
68
|
+
return 2;
|
|
69
|
+
}
|
|
70
|
+
if (value === undefined) {
|
|
71
|
+
return 3;
|
|
72
|
+
}
|
|
73
|
+
// NaN is the only value that is not equal to itself
|
|
74
|
+
if (value !== value) {
|
|
75
|
+
return 4;
|
|
76
|
+
}
|
|
77
|
+
return 0;
|
|
78
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a function like `_.groupBy`.
|
|
3
|
+
*
|
|
4
|
+
* @private
|
|
5
|
+
* @param {Function} setter The function to set accumulator values.
|
|
6
|
+
* @param {Function} [initializer] The accumulator object initializer.
|
|
7
|
+
* @returns {Function} Returns the new aggregator function.
|
|
8
|
+
*/
|
|
9
|
+
export declare function _createAggregator(setter: any, initializer?: any): (collection: any, iteratee?: any) => any;
|
|
10
|
+
//# sourceMappingURL=_createAggregator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_createAggregator.d.ts","sourceRoot":"","sources":["../../src/_/_createAggregator.ts"],"names":[],"mappings":"AAwCA;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,GAAG,EAAE,WAAW,CAAC,EAAE,GAAG,GAAG,CAAC,UAAU,EAAE,GAAG,EAAE,QAAQ,CAAC,EAAE,GAAG,KAAK,GAAG,CAO1G"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// (C) 2026 GoodData Corporation
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/*!
|
|
4
|
+
* Portions of this file are derived from Lodash.
|
|
5
|
+
* https://github.com/lodash/lodash
|
|
6
|
+
*
|
|
7
|
+
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
8
|
+
*
|
|
9
|
+
* Based on Underscore.js, copyright Jeremy Ashkenas,
|
|
10
|
+
* DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
|
|
11
|
+
*
|
|
12
|
+
* Modifications Copyright (c) 2026 GoodData Corporation
|
|
13
|
+
*
|
|
14
|
+
* Permission is hereby granted, free of charge, to any person obtaining
|
|
15
|
+
* a copy of this software and associated documentation files (the
|
|
16
|
+
* "Software"), to deal in the Software without restriction, including
|
|
17
|
+
* without limitation the rights to use, copy, modify, merge, publish,
|
|
18
|
+
* distribute, sublicense, and/or sell copies of the Software, and to
|
|
19
|
+
* permit persons to whom the Software is furnished to do so, subject to
|
|
20
|
+
* the following conditions:
|
|
21
|
+
*
|
|
22
|
+
* The above copyright notice and this permission notice shall be
|
|
23
|
+
* included in all copies or substantial portions of the Software.
|
|
24
|
+
*
|
|
25
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
26
|
+
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
27
|
+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
28
|
+
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
29
|
+
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
30
|
+
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
31
|
+
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
32
|
+
*/
|
|
33
|
+
import { _arrayAggregator } from "./_arrayAggregator.js";
|
|
34
|
+
import { _baseAggregator } from "./_baseAggregator.js";
|
|
35
|
+
import { _baseIteratee } from "./_baseIteratee.js";
|
|
36
|
+
import { _isArray } from "./isArray.js";
|
|
37
|
+
/**
|
|
38
|
+
* Creates a function like `_.groupBy`.
|
|
39
|
+
*
|
|
40
|
+
* @private
|
|
41
|
+
* @param {Function} setter The function to set accumulator values.
|
|
42
|
+
* @param {Function} [initializer] The accumulator object initializer.
|
|
43
|
+
* @returns {Function} Returns the new aggregator function.
|
|
44
|
+
*/
|
|
45
|
+
export function _createAggregator(setter, initializer) {
|
|
46
|
+
return function (collection, iteratee) {
|
|
47
|
+
const func = _isArray(collection) ? _arrayAggregator : _baseAggregator, accumulator = initializer ? initializer() : {};
|
|
48
|
+
return func(collection, setter, _baseIteratee(iteratee), accumulator);
|
|
49
|
+
};
|
|
50
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Initializes a plain-object clone with the same prototype. Prototype objects and objects without a
|
|
3
|
+
* constructor function, such as null-prototype objects, clone into ordinary `Object` instances.
|
|
4
|
+
*
|
|
5
|
+
* @param object - The object to clone.
|
|
6
|
+
* @returns Returns the initialized clone.
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
export declare function _initCloneObject(object: object): Record<PropertyKey, unknown>;
|
|
10
|
+
//# sourceMappingURL=_initCloneObject.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_initCloneObject.d.ts","sourceRoot":"","sources":["../../src/_/_initCloneObject.ts"],"names":[],"mappings":"AAoCA;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,CAQ7E"}
|
|
@@ -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 { _isPrototype } from "./_isPrototype.js";
|
|
33
|
+
import { _isObject } from "./isObject.js";
|
|
34
|
+
/**
|
|
35
|
+
* Initializes a plain-object clone with the same prototype. Prototype objects and objects without a
|
|
36
|
+
* constructor function, such as null-prototype objects, clone into ordinary `Object` instances.
|
|
37
|
+
*
|
|
38
|
+
* @param object - The object to clone.
|
|
39
|
+
* @returns Returns the initialized clone.
|
|
40
|
+
* @internal
|
|
41
|
+
*/
|
|
42
|
+
export function _initCloneObject(object) {
|
|
43
|
+
if (typeof object.constructor !== "function" || _isPrototype(object)) {
|
|
44
|
+
return {};
|
|
45
|
+
}
|
|
46
|
+
const proto = Object.getPrototypeOf(object);
|
|
47
|
+
return _isObject(proto) ? Object.create(proto) : {};
|
|
48
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks if `string` contains Unicode symbols: zero-width joiners, combining marks, variation selectors or
|
|
3
|
+
* code points from the astral planes.
|
|
4
|
+
*
|
|
5
|
+
* @param string - The string to inspect.
|
|
6
|
+
* @returns Returns `true` if a symbol is found, else `false`.
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
export declare function _hasUnicode(string: string): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Splits a Unicode `string` into an array of its symbols, keeping surrogate pairs, combining marks and
|
|
12
|
+
* joined emoji sequences together.
|
|
13
|
+
*
|
|
14
|
+
* @param string - The string to convert.
|
|
15
|
+
* @returns Returns the converted array.
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
18
|
+
export declare function _unicodeToArray(string: string): string[];
|
|
19
|
+
/**
|
|
20
|
+
* Splits a Unicode `string` into an array of its words.
|
|
21
|
+
*
|
|
22
|
+
* @param string - The string to inspect.
|
|
23
|
+
* @returns Returns the words of `string`.
|
|
24
|
+
* @internal
|
|
25
|
+
*/
|
|
26
|
+
export declare function _unicodeWords(string: string): string[];
|
|
27
|
+
//# sourceMappingURL=_unicode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_unicode.d.ts","sourceRoot":"","sources":["../../src/_/_unicode.ts"],"names":[],"mappings":"AAoGA;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAEnD;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAExD;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAEtD"}
|