@esri/solutions-components 0.3.6 → 0.3.7
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/buffer-tools_6.cjs.entry.js +8 -5
- package/dist/cjs/calcite-combobox_3.cjs.entry.js +2 -2
- package/dist/cjs/calcite-input-message_5.cjs.entry.js +6 -4
- package/dist/cjs/calcite-shell-panel_14.cjs.entry.js +2 -2
- package/dist/cjs/{csvUtils-83af7ae1.js → csvUtils-34666909.js} +1 -1
- package/dist/cjs/{interfaces-772edf61.js → interfaces-17c631bf.js} +1 -1
- package/dist/cjs/layer-table.cjs.entry.js +3 -3
- package/dist/cjs/map-card.cjs.entry.js +1 -1
- package/dist/cjs/{mapViewUtils-55ac76cb.js → mapViewUtils-24d1d859.js} +1 -1
- package/dist/cjs/public-notification.cjs.entry.js +16 -10
- package/dist/cjs/solution-configuration.cjs.entry.js +2 -2
- package/dist/cjs/solution-contents_3.cjs.entry.js +2 -2
- package/dist/cjs/{solution-store-39726b81.js → solution-store-2dbab624.js} +1 -1
- package/dist/collection/components/buffer-tools/buffer-tools.js +2 -2
- package/dist/collection/components/map-draw-tools/map-draw-tools.js +2 -1
- package/dist/collection/components/public-notification/public-notification.js +14 -8
- package/dist/collection/components/refine-selection/refine-selection.js +4 -2
- package/dist/collection/components/refine-selection-tools/refine-selection-tools.css +1 -0
- package/dist/collection/components/refine-selection-tools/refine-selection-tools.js +3 -1
- package/dist/collection/demos/new-public-notification.html +2 -1
- package/dist/collection/utils/interfaces.js +1 -1
- package/dist/collection/utils/interfaces.ts +2 -2
- package/dist/components/interfaces3.js +1 -1
- package/dist/components/map-draw-tools2.js +2 -1
- package/dist/components/public-notification.js +14 -8
- package/dist/components/refine-selection-tools2.js +4 -2
- package/dist/components/refine-selection2.js +4 -2
- package/dist/esm/buffer-tools_6.entry.js +8 -5
- package/dist/esm/calcite-combobox_3.entry.js +2 -2
- package/dist/esm/calcite-input-message_5.entry.js +6 -4
- package/dist/esm/calcite-shell-panel_14.entry.js +2 -2
- package/dist/esm/{csvUtils-eb231cfb.js → csvUtils-ae3004b9.js} +1 -1
- package/dist/esm/{interfaces-3b23a5f9.js → interfaces-d0d83efa.js} +1 -1
- package/dist/esm/layer-table.entry.js +3 -3
- package/dist/esm/map-card.entry.js +1 -1
- package/dist/esm/{mapViewUtils-e5d8a1e1.js → mapViewUtils-541e7a3c.js} +1 -1
- package/dist/esm/public-notification.entry.js +16 -10
- package/dist/esm/solution-configuration.entry.js +2 -2
- package/dist/esm/solution-contents_3.entry.js +2 -2
- package/dist/esm/{solution-store-c0bf9200.js → solution-store-41e15f1c.js} +1 -1
- package/dist/solutions-components/demos/new-public-notification.html +2 -1
- package/dist/solutions-components/p-05e64bd1.js +498 -2
- package/dist/solutions-components/p-08a95b33.entry.js +138 -0
- package/dist/solutions-components/p-0da5bbdf.entry.js +91 -0
- package/dist/solutions-components/p-0ef91144.entry.js +913 -0
- package/dist/solutions-components/p-0f523243.entry.js +1916 -0
- package/dist/solutions-components/p-11b9510e.entry.js +173 -0
- package/dist/solutions-components/p-1b875d94.entry.js +58 -0
- package/dist/solutions-components/p-1c567f3a.js +23 -16
- package/dist/solutions-components/p-1c883db9.entry.js +43 -0
- package/dist/solutions-components/p-1f225056.js +322 -0
- package/dist/solutions-components/p-1f499e67.entry.js +72 -0
- package/dist/solutions-components/p-20d3d758.entry.js +881 -0
- package/dist/solutions-components/p-2274ac9e.entry.js +160 -0
- package/dist/solutions-components/p-23ec5ac5.entry.js +93 -0
- package/dist/solutions-components/p-2447798c.entry.js +155 -0
- package/dist/solutions-components/p-2525e691.entry.js +432 -0
- package/dist/solutions-components/p-2561f5b5.js +4092 -0
- package/dist/solutions-components/p-29f887c0.entry.js +234 -0
- package/dist/solutions-components/p-2a0d8047.entry.js +345 -0
- package/dist/solutions-components/p-2c177e6a.entry.js +101 -0
- package/dist/solutions-components/p-2e9ed892.js +46 -1
- package/dist/solutions-components/p-316f56db.js +219 -2
- package/dist/solutions-components/p-327f3ebf.entry.js +98 -0
- package/dist/solutions-components/p-356f8b54.entry.js +138 -0
- package/dist/solutions-components/p-359c58de.entry.js +172 -0
- package/dist/solutions-components/p-37336c0d.entry.js +116 -0
- package/dist/solutions-components/p-374a5031.js +105 -2
- package/dist/solutions-components/p-39ea6ef4.entry.js +71 -0
- package/dist/solutions-components/p-3b010ce1.js +17 -1
- package/dist/solutions-components/p-4307dacd.js +194 -1
- package/dist/solutions-components/p-44da2507.js +405 -14
- package/dist/solutions-components/p-46bdffe8.entry.js +54 -0
- package/dist/solutions-components/p-4894bbeb.js +53 -2
- package/dist/solutions-components/p-4cd569f1.entry.js +1298 -0
- package/dist/solutions-components/p-4d4160f9.entry.js +121 -0
- package/dist/solutions-components/p-4e32bf8c.js +482 -1
- package/dist/solutions-components/p-4e9cbd32.entry.js +184 -0
- package/dist/solutions-components/p-508317b3.js +13 -2
- package/dist/solutions-components/p-54697d58.entry.js +198 -0
- package/dist/solutions-components/p-55c79103.entry.js +311 -0
- package/dist/solutions-components/p-57fd19c0.entry.js +706 -0
- package/dist/solutions-components/p-59b48fde.entry.js +443 -0
- package/dist/solutions-components/p-60e0e6a0.entry.js +214 -0
- package/dist/solutions-components/p-621d0534.entry.js +123 -0
- package/dist/solutions-components/p-63f6e8f1.js +14 -1
- package/dist/solutions-components/p-66aeec57.entry.js +61 -0
- package/dist/solutions-components/p-69834f46.entry.js +618 -0
- package/dist/solutions-components/p-6d9da8e5.entry.js +21530 -0
- package/dist/solutions-components/p-6e0da576.js +13 -1
- package/dist/solutions-components/p-6ec3f294.entry.js +106 -0
- package/dist/solutions-components/p-6fe17794.js +9 -1
- package/dist/solutions-components/p-7024cb16.entry.js +72 -0
- package/dist/solutions-components/p-70535506.entry.js +226 -0
- package/dist/solutions-components/p-708a63a8.js +12 -1
- package/dist/solutions-components/p-729708a3.js +14 -1
- package/dist/solutions-components/p-73e23995.js +6 -1
- package/dist/solutions-components/p-74b29d75.entry.js +231 -0
- package/dist/solutions-components/p-74b7ee25.entry.js +711 -0
- package/dist/solutions-components/p-77182c3a.js +3015 -1
- package/dist/solutions-components/p-78b3ef80.entry.js +456 -0
- package/dist/solutions-components/p-79709c19.js +60 -3
- package/dist/solutions-components/p-7a46ef97.js +181 -2
- package/dist/solutions-components/p-7be159e6.entry.js +175 -0
- package/dist/solutions-components/p-7d4451c2.entry.js +71 -0
- package/dist/solutions-components/p-7daea1df.js +41 -1
- package/dist/solutions-components/p-7e39e5ad.entry.js +102 -0
- package/dist/solutions-components/p-7fb45059.entry.js +43 -0
- package/dist/solutions-components/p-815533de.js +306 -3
- package/dist/solutions-components/p-816622ca.entry.js +248 -0
- package/dist/solutions-components/p-83166522.js +205 -2
- package/dist/solutions-components/p-83bd1991.entry.js +36 -0
- package/dist/solutions-components/p-856464d7.entry.js +572 -0
- package/dist/solutions-components/p-8c349bad.entry.js +347 -0
- package/dist/solutions-components/p-8dccb390.entry.js +1986 -0
- package/dist/solutions-components/p-904c185a.entry.js +228 -0
- package/dist/solutions-components/p-9092f8b3.entry.js +156 -0
- package/dist/solutions-components/p-9371145a.entry.js +477 -0
- package/dist/solutions-components/p-93d3119d.js +1948 -1
- package/dist/solutions-components/p-95ec8062.entry.js +173 -0
- package/dist/solutions-components/p-991ee695.js +109 -1
- package/dist/solutions-components/p-9a57dab7.entry.js +213 -0
- package/dist/solutions-components/p-9a9955db.js +41 -1
- package/dist/solutions-components/p-9c1ebc90.js +35 -16
- package/dist/solutions-components/p-9eba5c66.js +399 -3
- package/dist/solutions-components/p-a033a507.entry.js +252 -0
- package/dist/solutions-components/p-a3773415.entry.js +1132 -0
- package/dist/solutions-components/p-a44fe40f.entry.js +94 -0
- package/dist/solutions-components/p-a5b1ab03.js +33 -3
- package/dist/solutions-components/p-a5b2c13d.entry.js +723 -0
- package/dist/solutions-components/p-a6d729b7.entry.js +85 -0
- package/dist/solutions-components/p-a8005026.entry.js +565 -0
- package/dist/solutions-components/p-a80b3880.js +14 -1
- package/dist/solutions-components/p-a89198a3.entry.js +2620 -0
- package/dist/solutions-components/p-aa04bd1f.entry.js +95 -0
- package/dist/solutions-components/p-aa0a0922.entry.js +80 -0
- package/dist/solutions-components/p-ae1fd76b.js +11 -1
- package/dist/solutions-components/p-b2cf435e.entry.js +87 -0
- package/dist/solutions-components/p-b359dc78.js +41 -1
- package/dist/solutions-components/p-b57bc4eb.entry.js +71 -0
- package/dist/solutions-components/p-b75cc407.entry.js +145 -0
- package/dist/solutions-components/p-b911cb75.entry.js +71 -0
- package/dist/solutions-components/p-b965e177.entry.js +335 -0
- package/dist/solutions-components/p-b978636e.js +14 -1
- package/dist/solutions-components/p-ba10a5c8.entry.js +42 -0
- package/dist/solutions-components/p-bd67334c.js +122 -2
- package/dist/solutions-components/p-bde20dba.entry.js +212 -0
- package/dist/solutions-components/p-be0b5a94.entry.js +248 -0
- package/dist/solutions-components/p-c023e6a1.js +2028 -2
- package/dist/solutions-components/p-c27b0c2d.entry.js +150 -0
- package/dist/solutions-components/p-c579ed60.entry.js +447 -0
- package/dist/solutions-components/p-c92bc231.js +101 -2
- package/dist/solutions-components/p-cc815aca.js +839 -16
- package/dist/solutions-components/p-cc8beabb.entry.js +695 -0
- package/dist/solutions-components/p-cdc46c0c.js +1751 -2
- package/dist/solutions-components/p-d12e6992.entry.js +118 -0
- package/dist/solutions-components/p-d1dfed6b.entry.js +179 -0
- package/dist/solutions-components/p-d48a24e6.js +754 -2
- package/dist/solutions-components/p-d96ee3ef.entry.js +579 -0
- package/dist/solutions-components/p-dbc9a5a8.js +80 -0
- package/dist/solutions-components/p-dcdbe712.entry.js +278 -0
- package/dist/solutions-components/p-de39206f.entry.js +113 -0
- package/dist/solutions-components/p-de5416e8.js +28 -1
- package/dist/solutions-components/p-df420d54.entry.js +213 -0
- package/dist/solutions-components/p-e3138cf0.entry.js +20 -0
- package/dist/solutions-components/p-e4845fec.entry.js +152 -0
- package/dist/solutions-components/p-e611d8c8.js +28 -1
- package/dist/solutions-components/p-e947d3b0.js +5 -1
- package/dist/solutions-components/p-ea534300.js +41 -2
- package/dist/solutions-components/p-ec84ee85.entry.js +55 -0
- package/dist/solutions-components/p-ed36c637.entry.js +85 -0
- package/dist/solutions-components/p-f0add71c.js +74 -0
- package/dist/solutions-components/p-f42e014b.js +171 -2
- package/dist/solutions-components/p-fc02e7de.entry.js +308 -0
- package/dist/solutions-components/p-fc884dd6.js +28 -16
- package/dist/solutions-components/p-fcbfa59c.entry.js +181 -0
- package/dist/solutions-components/p-fdc5cf5f.entry.js +138 -0
- package/dist/solutions-components/solutions-components.esm.js +20 -1
- package/dist/solutions-components/utils/interfaces.ts +2 -2
- package/dist/types/components/buffer-tools/buffer-tools.d.ts +2 -2
- package/dist/types/components/public-notification/public-notification.d.ts +9 -1
- package/dist/types/components.d.ts +2 -2
- package/package.json +1 -1
- package/dist/solutions-components/p-021432b8.entry.js +0 -12
- package/dist/solutions-components/p-03440b1e.entry.js +0 -11
- package/dist/solutions-components/p-0512635b.entry.js +0 -6
- package/dist/solutions-components/p-086ef115.entry.js +0 -29
- package/dist/solutions-components/p-0b4bf57f.entry.js +0 -6
- package/dist/solutions-components/p-0c088725.entry.js +0 -6
- package/dist/solutions-components/p-0f820c08.entry.js +0 -6
- package/dist/solutions-components/p-164780a0.entry.js +0 -6
- package/dist/solutions-components/p-179a68a0.entry.js +0 -6
- package/dist/solutions-components/p-184b5005.entry.js +0 -11
- package/dist/solutions-components/p-1d082fee.entry.js +0 -11
- package/dist/solutions-components/p-1e6c02a2.entry.js +0 -11
- package/dist/solutions-components/p-20a58e62.entry.js +0 -17
- package/dist/solutions-components/p-20b2458c.entry.js +0 -11
- package/dist/solutions-components/p-245d47c1.entry.js +0 -6
- package/dist/solutions-components/p-2cb057a9.entry.js +0 -11
- package/dist/solutions-components/p-2cc72806.entry.js +0 -23
- package/dist/solutions-components/p-2de1db9c.entry.js +0 -11
- package/dist/solutions-components/p-2e9c7055.entry.js +0 -11
- package/dist/solutions-components/p-2ed5e6c8.entry.js +0 -11
- package/dist/solutions-components/p-3109d940.entry.js +0 -6
- package/dist/solutions-components/p-31a8bcfa.entry.js +0 -6
- package/dist/solutions-components/p-3649acb3.entry.js +0 -18
- package/dist/solutions-components/p-3f88ba73.entry.js +0 -6
- package/dist/solutions-components/p-3fa9b3c8.js +0 -36
- package/dist/solutions-components/p-40c41709.entry.js +0 -6
- package/dist/solutions-components/p-40e963c7.entry.js +0 -11
- package/dist/solutions-components/p-40f480da.entry.js +0 -11
- package/dist/solutions-components/p-49d5d2d3.entry.js +0 -11
- package/dist/solutions-components/p-4f7049a4.entry.js +0 -11
- package/dist/solutions-components/p-506e4d78.entry.js +0 -6
- package/dist/solutions-components/p-576fdcab.entry.js +0 -6
- package/dist/solutions-components/p-5bd0cf34.entry.js +0 -23
- package/dist/solutions-components/p-65e177f1.entry.js +0 -6
- package/dist/solutions-components/p-67d710c2.entry.js +0 -6
- package/dist/solutions-components/p-7268b445.entry.js +0 -11
- package/dist/solutions-components/p-75ea4667.entry.js +0 -6
- package/dist/solutions-components/p-778c0a36.entry.js +0 -17
- package/dist/solutions-components/p-7a22509b.entry.js +0 -12
- package/dist/solutions-components/p-7bff51db.entry.js +0 -6
- package/dist/solutions-components/p-7d2d0d5d.entry.js +0 -6
- package/dist/solutions-components/p-7f0036f1.entry.js +0 -11
- package/dist/solutions-components/p-8060fb94.entry.js +0 -6
- package/dist/solutions-components/p-80a1b305.entry.js +0 -6
- package/dist/solutions-components/p-81eae877.entry.js +0 -12
- package/dist/solutions-components/p-84e86b8b.entry.js +0 -6
- package/dist/solutions-components/p-851e04ae.entry.js +0 -6
- package/dist/solutions-components/p-9106950a.entry.js +0 -11
- package/dist/solutions-components/p-979804a4.entry.js +0 -11
- package/dist/solutions-components/p-9862baa8.entry.js +0 -11
- package/dist/solutions-components/p-9b5a9117.entry.js +0 -12
- package/dist/solutions-components/p-9deff0c2.entry.js +0 -6
- package/dist/solutions-components/p-9f400eeb.entry.js +0 -6
- package/dist/solutions-components/p-a0639ad1.entry.js +0 -11
- package/dist/solutions-components/p-a33c044e.entry.js +0 -6
- package/dist/solutions-components/p-a516c658.entry.js +0 -6
- package/dist/solutions-components/p-aa0ef36d.entry.js +0 -11
- package/dist/solutions-components/p-aaccbdf3.entry.js +0 -18
- package/dist/solutions-components/p-ab03a5c9.entry.js +0 -11
- package/dist/solutions-components/p-ad469b92.entry.js +0 -11
- package/dist/solutions-components/p-adc86ac3.entry.js +0 -6
- package/dist/solutions-components/p-addc1156.entry.js +0 -11
- package/dist/solutions-components/p-ae846934.entry.js +0 -11
- package/dist/solutions-components/p-b0572fc4.entry.js +0 -37
- package/dist/solutions-components/p-b4e476b7.js +0 -257
- package/dist/solutions-components/p-b668daf8.js +0 -21
- package/dist/solutions-components/p-b6e6eae1.entry.js +0 -6
- package/dist/solutions-components/p-bc317a7f.entry.js +0 -6
- package/dist/solutions-components/p-be41429f.js +0 -21
- package/dist/solutions-components/p-bf6b6353.entry.js +0 -11
- package/dist/solutions-components/p-c2e3dfbb.entry.js +0 -11
- package/dist/solutions-components/p-c4afae53.entry.js +0 -12
- package/dist/solutions-components/p-c9da1c26.entry.js +0 -6
- package/dist/solutions-components/p-cbf8cd49.entry.js +0 -6
- package/dist/solutions-components/p-cc1a064a.entry.js +0 -11
- package/dist/solutions-components/p-d09a168c.entry.js +0 -6
- package/dist/solutions-components/p-d377f913.entry.js +0 -11
- package/dist/solutions-components/p-d4cefead.entry.js +0 -37
- package/dist/solutions-components/p-d7bc0baf.entry.js +0 -16
- package/dist/solutions-components/p-d8968487.entry.js +0 -11
- package/dist/solutions-components/p-e00a0b86.entry.js +0 -11
- package/dist/solutions-components/p-e9a7ed49.entry.js +0 -11
- package/dist/solutions-components/p-ec27e493.entry.js +0 -11
- package/dist/solutions-components/p-ed6404eb.entry.js +0 -6
- package/dist/solutions-components/p-ef21e195.entry.js +0 -23
- package/dist/solutions-components/p-f6068a2d.entry.js +0 -11
- package/dist/solutions-components/p-f6c4cff3.entry.js +0 -11
- package/dist/solutions-components/p-f847291f.entry.js +0 -6
- package/dist/solutions-components/p-f90fd262.entry.js +0 -11
- package/dist/solutions-components/p-fc973005.entry.js +0 -6
- package/dist/solutions-components/p-ff9fb6bc.entry.js +0 -11
@@ -3,9 +3,761 @@
|
|
3
3
|
* Licensed under the Apache License, Version 2.0
|
4
4
|
* http://www.apache.org/licenses/LICENSE-2.0
|
5
5
|
*/
|
6
|
-
import{a as
|
6
|
+
import { a as isSymbol, S as Symbol, i as isObject, b as baseGetTag, c as isObjectLike, r as root, f as freeGlobal } from './p-4e32bf8c.js';
|
7
|
+
|
8
|
+
/**
|
9
|
+
* A specialized version of `_.map` for arrays without support for iteratee
|
10
|
+
* shorthands.
|
11
|
+
*
|
12
|
+
* @private
|
13
|
+
* @param {Array} [array] The array to iterate over.
|
14
|
+
* @param {Function} iteratee The function invoked per iteration.
|
15
|
+
* @returns {Array} Returns the new mapped array.
|
16
|
+
*/
|
17
|
+
function arrayMap(array, iteratee) {
|
18
|
+
var index = -1,
|
19
|
+
length = array == null ? 0 : array.length,
|
20
|
+
result = Array(length);
|
21
|
+
|
22
|
+
while (++index < length) {
|
23
|
+
result[index] = iteratee(array[index], index, array);
|
24
|
+
}
|
25
|
+
return result;
|
26
|
+
}
|
27
|
+
|
28
|
+
/**
|
29
|
+
* Checks if `value` is classified as an `Array` object.
|
30
|
+
*
|
31
|
+
* @static
|
32
|
+
* @memberOf _
|
33
|
+
* @since 0.1.0
|
34
|
+
* @category Lang
|
35
|
+
* @param {*} value The value to check.
|
36
|
+
* @returns {boolean} Returns `true` if `value` is an array, else `false`.
|
37
|
+
* @example
|
38
|
+
*
|
39
|
+
* _.isArray([1, 2, 3]);
|
40
|
+
* // => true
|
41
|
+
*
|
42
|
+
* _.isArray(document.body.children);
|
43
|
+
* // => false
|
44
|
+
*
|
45
|
+
* _.isArray('abc');
|
46
|
+
* // => false
|
47
|
+
*
|
48
|
+
* _.isArray(_.noop);
|
49
|
+
* // => false
|
50
|
+
*/
|
51
|
+
var isArray = Array.isArray;
|
52
|
+
|
53
|
+
/** Used as references for various `Number` constants. */
|
54
|
+
var INFINITY = 1 / 0;
|
55
|
+
|
56
|
+
/** Used to convert symbols to primitives and strings. */
|
57
|
+
var symbolProto = Symbol ? Symbol.prototype : undefined,
|
58
|
+
symbolToString = symbolProto ? symbolProto.toString : undefined;
|
59
|
+
|
60
|
+
/**
|
61
|
+
* The base implementation of `_.toString` which doesn't convert nullish
|
62
|
+
* values to empty strings.
|
63
|
+
*
|
64
|
+
* @private
|
65
|
+
* @param {*} value The value to process.
|
66
|
+
* @returns {string} Returns the string.
|
67
|
+
*/
|
68
|
+
function baseToString(value) {
|
69
|
+
// Exit early for strings to avoid a performance hit in some environments.
|
70
|
+
if (typeof value == 'string') {
|
71
|
+
return value;
|
72
|
+
}
|
73
|
+
if (isArray(value)) {
|
74
|
+
// Recursively convert values (susceptible to call stack limits).
|
75
|
+
return arrayMap(value, baseToString) + '';
|
76
|
+
}
|
77
|
+
if (isSymbol(value)) {
|
78
|
+
return symbolToString ? symbolToString.call(value) : '';
|
79
|
+
}
|
80
|
+
var result = (value + '');
|
81
|
+
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
|
82
|
+
}
|
83
|
+
|
84
|
+
/**
|
85
|
+
* This method returns the first argument it receives.
|
86
|
+
*
|
87
|
+
* @static
|
88
|
+
* @since 0.1.0
|
89
|
+
* @memberOf _
|
90
|
+
* @category Util
|
91
|
+
* @param {*} value Any value.
|
92
|
+
* @returns {*} Returns `value`.
|
93
|
+
* @example
|
94
|
+
*
|
95
|
+
* var object = { 'a': 1 };
|
96
|
+
*
|
97
|
+
* console.log(_.identity(object) === object);
|
98
|
+
* // => true
|
99
|
+
*/
|
100
|
+
function identity(value) {
|
101
|
+
return value;
|
102
|
+
}
|
103
|
+
|
104
|
+
/** `Object#toString` result references. */
|
105
|
+
var asyncTag = '[object AsyncFunction]',
|
106
|
+
funcTag$1 = '[object Function]',
|
107
|
+
genTag = '[object GeneratorFunction]',
|
108
|
+
proxyTag = '[object Proxy]';
|
109
|
+
|
110
|
+
/**
|
111
|
+
* Checks if `value` is classified as a `Function` object.
|
112
|
+
*
|
113
|
+
* @static
|
114
|
+
* @memberOf _
|
115
|
+
* @since 0.1.0
|
116
|
+
* @category Lang
|
117
|
+
* @param {*} value The value to check.
|
118
|
+
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
|
119
|
+
* @example
|
120
|
+
*
|
121
|
+
* _.isFunction(_);
|
122
|
+
* // => true
|
123
|
+
*
|
124
|
+
* _.isFunction(/abc/);
|
125
|
+
* // => false
|
126
|
+
*/
|
127
|
+
function isFunction(value) {
|
128
|
+
if (!isObject(value)) {
|
129
|
+
return false;
|
130
|
+
}
|
131
|
+
// The use of `Object#toString` avoids issues with the `typeof` operator
|
132
|
+
// in Safari 9 which returns 'object' for typed arrays and other constructors.
|
133
|
+
var tag = baseGetTag(value);
|
134
|
+
return tag == funcTag$1 || tag == genTag || tag == asyncTag || tag == proxyTag;
|
135
|
+
}
|
136
|
+
|
137
|
+
/** Used as references for various `Number` constants. */
|
138
|
+
var MAX_SAFE_INTEGER$1 = 9007199254740991;
|
139
|
+
|
140
|
+
/** Used to detect unsigned integer values. */
|
141
|
+
var reIsUint = /^(?:0|[1-9]\d*)$/;
|
142
|
+
|
143
|
+
/**
|
144
|
+
* Checks if `value` is a valid array-like index.
|
145
|
+
*
|
146
|
+
* @private
|
147
|
+
* @param {*} value The value to check.
|
148
|
+
* @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
|
149
|
+
* @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
|
150
|
+
*/
|
151
|
+
function isIndex(value, length) {
|
152
|
+
var type = typeof value;
|
153
|
+
length = length == null ? MAX_SAFE_INTEGER$1 : length;
|
154
|
+
|
155
|
+
return !!length &&
|
156
|
+
(type == 'number' ||
|
157
|
+
(type != 'symbol' && reIsUint.test(value))) &&
|
158
|
+
(value > -1 && value % 1 == 0 && value < length);
|
159
|
+
}
|
160
|
+
|
161
|
+
/** Used as references for various `Number` constants. */
|
162
|
+
var MAX_SAFE_INTEGER = 9007199254740991;
|
163
|
+
|
164
|
+
/**
|
165
|
+
* Checks if `value` is a valid array-like length.
|
166
|
+
*
|
167
|
+
* **Note:** This method is loosely based on
|
168
|
+
* [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
|
169
|
+
*
|
170
|
+
* @static
|
171
|
+
* @memberOf _
|
172
|
+
* @since 4.0.0
|
173
|
+
* @category Lang
|
174
|
+
* @param {*} value The value to check.
|
175
|
+
* @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
|
176
|
+
* @example
|
177
|
+
*
|
178
|
+
* _.isLength(3);
|
179
|
+
* // => true
|
180
|
+
*
|
181
|
+
* _.isLength(Number.MIN_VALUE);
|
182
|
+
* // => false
|
183
|
+
*
|
184
|
+
* _.isLength(Infinity);
|
185
|
+
* // => false
|
186
|
+
*
|
187
|
+
* _.isLength('3');
|
188
|
+
* // => false
|
189
|
+
*/
|
190
|
+
function isLength(value) {
|
191
|
+
return typeof value == 'number' &&
|
192
|
+
value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
|
193
|
+
}
|
194
|
+
|
195
|
+
/**
|
196
|
+
* Checks if `value` is array-like. A value is considered array-like if it's
|
197
|
+
* not a function and has a `value.length` that's an integer greater than or
|
198
|
+
* equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
|
199
|
+
*
|
200
|
+
* @static
|
201
|
+
* @memberOf _
|
202
|
+
* @since 4.0.0
|
203
|
+
* @category Lang
|
204
|
+
* @param {*} value The value to check.
|
205
|
+
* @returns {boolean} Returns `true` if `value` is array-like, else `false`.
|
206
|
+
* @example
|
207
|
+
*
|
208
|
+
* _.isArrayLike([1, 2, 3]);
|
209
|
+
* // => true
|
210
|
+
*
|
211
|
+
* _.isArrayLike(document.body.children);
|
212
|
+
* // => true
|
213
|
+
*
|
214
|
+
* _.isArrayLike('abc');
|
215
|
+
* // => true
|
216
|
+
*
|
217
|
+
* _.isArrayLike(_.noop);
|
218
|
+
* // => false
|
219
|
+
*/
|
220
|
+
function isArrayLike(value) {
|
221
|
+
return value != null && isLength(value.length) && !isFunction(value);
|
222
|
+
}
|
223
|
+
|
224
|
+
/** Used for built-in method references. */
|
225
|
+
var objectProto$3 = Object.prototype;
|
226
|
+
|
227
|
+
/**
|
228
|
+
* Checks if `value` is likely a prototype object.
|
229
|
+
*
|
230
|
+
* @private
|
231
|
+
* @param {*} value The value to check.
|
232
|
+
* @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
|
233
|
+
*/
|
234
|
+
function isPrototype(value) {
|
235
|
+
var Ctor = value && value.constructor,
|
236
|
+
proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$3;
|
237
|
+
|
238
|
+
return value === proto;
|
239
|
+
}
|
240
|
+
|
241
|
+
/**
|
242
|
+
* The base implementation of `_.times` without support for iteratee shorthands
|
243
|
+
* or max array length checks.
|
244
|
+
*
|
245
|
+
* @private
|
246
|
+
* @param {number} n The number of times to invoke `iteratee`.
|
247
|
+
* @param {Function} iteratee The function invoked per iteration.
|
248
|
+
* @returns {Array} Returns the array of results.
|
249
|
+
*/
|
250
|
+
function baseTimes(n, iteratee) {
|
251
|
+
var index = -1,
|
252
|
+
result = Array(n);
|
253
|
+
|
254
|
+
while (++index < n) {
|
255
|
+
result[index] = iteratee(index);
|
256
|
+
}
|
257
|
+
return result;
|
258
|
+
}
|
259
|
+
|
260
|
+
/** `Object#toString` result references. */
|
261
|
+
var argsTag$1 = '[object Arguments]';
|
262
|
+
|
263
|
+
/**
|
264
|
+
* The base implementation of `_.isArguments`.
|
265
|
+
*
|
266
|
+
* @private
|
267
|
+
* @param {*} value The value to check.
|
268
|
+
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
|
269
|
+
*/
|
270
|
+
function baseIsArguments(value) {
|
271
|
+
return isObjectLike(value) && baseGetTag(value) == argsTag$1;
|
272
|
+
}
|
273
|
+
|
274
|
+
/** Used for built-in method references. */
|
275
|
+
var objectProto$2 = Object.prototype;
|
276
|
+
|
277
|
+
/** Used to check objects for own properties. */
|
278
|
+
var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
|
279
|
+
|
280
|
+
/** Built-in value references. */
|
281
|
+
var propertyIsEnumerable = objectProto$2.propertyIsEnumerable;
|
282
|
+
|
283
|
+
/**
|
284
|
+
* Checks if `value` is likely an `arguments` object.
|
285
|
+
*
|
286
|
+
* @static
|
287
|
+
* @memberOf _
|
288
|
+
* @since 0.1.0
|
289
|
+
* @category Lang
|
290
|
+
* @param {*} value The value to check.
|
291
|
+
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
|
292
|
+
* else `false`.
|
293
|
+
* @example
|
294
|
+
*
|
295
|
+
* _.isArguments(function() { return arguments; }());
|
296
|
+
* // => true
|
297
|
+
*
|
298
|
+
* _.isArguments([1, 2, 3]);
|
299
|
+
* // => false
|
300
|
+
*/
|
301
|
+
var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
|
302
|
+
return isObjectLike(value) && hasOwnProperty$2.call(value, 'callee') &&
|
303
|
+
!propertyIsEnumerable.call(value, 'callee');
|
304
|
+
};
|
305
|
+
|
306
|
+
/**
|
307
|
+
* This method returns `false`.
|
308
|
+
*
|
309
|
+
* @static
|
310
|
+
* @memberOf _
|
311
|
+
* @since 4.13.0
|
312
|
+
* @category Util
|
313
|
+
* @returns {boolean} Returns `false`.
|
314
|
+
* @example
|
315
|
+
*
|
316
|
+
* _.times(2, _.stubFalse);
|
317
|
+
* // => [false, false]
|
318
|
+
*/
|
319
|
+
function stubFalse() {
|
320
|
+
return false;
|
321
|
+
}
|
322
|
+
|
323
|
+
/** Detect free variable `exports`. */
|
324
|
+
var freeExports$1 = typeof exports == 'object' && exports && !exports.nodeType && exports;
|
325
|
+
|
326
|
+
/** Detect free variable `module`. */
|
327
|
+
var freeModule$1 = freeExports$1 && typeof module == 'object' && module && !module.nodeType && module;
|
328
|
+
|
329
|
+
/** Detect the popular CommonJS extension `module.exports`. */
|
330
|
+
var moduleExports$1 = freeModule$1 && freeModule$1.exports === freeExports$1;
|
331
|
+
|
332
|
+
/** Built-in value references. */
|
333
|
+
var Buffer = moduleExports$1 ? root.Buffer : undefined;
|
334
|
+
|
335
|
+
/* Built-in method references for those with the same name as other `lodash` methods. */
|
336
|
+
var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
|
337
|
+
|
338
|
+
/**
|
339
|
+
* Checks if `value` is a buffer.
|
340
|
+
*
|
341
|
+
* @static
|
342
|
+
* @memberOf _
|
343
|
+
* @since 4.3.0
|
344
|
+
* @category Lang
|
345
|
+
* @param {*} value The value to check.
|
346
|
+
* @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
|
347
|
+
* @example
|
348
|
+
*
|
349
|
+
* _.isBuffer(new Buffer(2));
|
350
|
+
* // => true
|
351
|
+
*
|
352
|
+
* _.isBuffer(new Uint8Array(2));
|
353
|
+
* // => false
|
354
|
+
*/
|
355
|
+
var isBuffer = nativeIsBuffer || stubFalse;
|
356
|
+
|
357
|
+
/** `Object#toString` result references. */
|
358
|
+
var argsTag = '[object Arguments]',
|
359
|
+
arrayTag = '[object Array]',
|
360
|
+
boolTag = '[object Boolean]',
|
361
|
+
dateTag = '[object Date]',
|
362
|
+
errorTag = '[object Error]',
|
363
|
+
funcTag = '[object Function]',
|
364
|
+
mapTag = '[object Map]',
|
365
|
+
numberTag = '[object Number]',
|
366
|
+
objectTag = '[object Object]',
|
367
|
+
regexpTag = '[object RegExp]',
|
368
|
+
setTag = '[object Set]',
|
369
|
+
stringTag = '[object String]',
|
370
|
+
weakMapTag = '[object WeakMap]';
|
371
|
+
|
372
|
+
var arrayBufferTag = '[object ArrayBuffer]',
|
373
|
+
dataViewTag = '[object DataView]',
|
374
|
+
float32Tag = '[object Float32Array]',
|
375
|
+
float64Tag = '[object Float64Array]',
|
376
|
+
int8Tag = '[object Int8Array]',
|
377
|
+
int16Tag = '[object Int16Array]',
|
378
|
+
int32Tag = '[object Int32Array]',
|
379
|
+
uint8Tag = '[object Uint8Array]',
|
380
|
+
uint8ClampedTag = '[object Uint8ClampedArray]',
|
381
|
+
uint16Tag = '[object Uint16Array]',
|
382
|
+
uint32Tag = '[object Uint32Array]';
|
383
|
+
|
384
|
+
/** Used to identify `toStringTag` values of typed arrays. */
|
385
|
+
var typedArrayTags = {};
|
386
|
+
typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
|
387
|
+
typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
|
388
|
+
typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
|
389
|
+
typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
|
390
|
+
typedArrayTags[uint32Tag] = true;
|
391
|
+
typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
|
392
|
+
typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
|
393
|
+
typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
|
394
|
+
typedArrayTags[errorTag] = typedArrayTags[funcTag] =
|
395
|
+
typedArrayTags[mapTag] = typedArrayTags[numberTag] =
|
396
|
+
typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
|
397
|
+
typedArrayTags[setTag] = typedArrayTags[stringTag] =
|
398
|
+
typedArrayTags[weakMapTag] = false;
|
399
|
+
|
400
|
+
/**
|
401
|
+
* The base implementation of `_.isTypedArray` without Node.js optimizations.
|
402
|
+
*
|
403
|
+
* @private
|
404
|
+
* @param {*} value The value to check.
|
405
|
+
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
|
406
|
+
*/
|
407
|
+
function baseIsTypedArray(value) {
|
408
|
+
return isObjectLike(value) &&
|
409
|
+
isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
|
410
|
+
}
|
411
|
+
|
412
|
+
/**
|
413
|
+
* The base implementation of `_.unary` without support for storing metadata.
|
414
|
+
*
|
415
|
+
* @private
|
416
|
+
* @param {Function} func The function to cap arguments for.
|
417
|
+
* @returns {Function} Returns the new capped function.
|
418
|
+
*/
|
419
|
+
function baseUnary(func) {
|
420
|
+
return function(value) {
|
421
|
+
return func(value);
|
422
|
+
};
|
423
|
+
}
|
424
|
+
|
425
|
+
/** Detect free variable `exports`. */
|
426
|
+
var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
|
427
|
+
|
428
|
+
/** Detect free variable `module`. */
|
429
|
+
var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
|
430
|
+
|
431
|
+
/** Detect the popular CommonJS extension `module.exports`. */
|
432
|
+
var moduleExports = freeModule && freeModule.exports === freeExports;
|
433
|
+
|
434
|
+
/** Detect free variable `process` from Node.js. */
|
435
|
+
var freeProcess = moduleExports && freeGlobal.process;
|
436
|
+
|
437
|
+
/** Used to access faster Node.js helpers. */
|
438
|
+
var nodeUtil = (function() {
|
439
|
+
try {
|
440
|
+
// Use `util.types` for Node.js 10+.
|
441
|
+
var types = freeModule && freeModule.require && freeModule.require('util').types;
|
442
|
+
|
443
|
+
if (types) {
|
444
|
+
return types;
|
445
|
+
}
|
446
|
+
|
447
|
+
// Legacy `process.binding('util')` for Node.js < 10.
|
448
|
+
return freeProcess && freeProcess.binding && freeProcess.binding('util');
|
449
|
+
} catch (e) {}
|
450
|
+
}());
|
451
|
+
|
452
|
+
/* Node.js helper references. */
|
453
|
+
var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
|
454
|
+
|
455
|
+
/**
|
456
|
+
* Checks if `value` is classified as a typed array.
|
457
|
+
*
|
458
|
+
* @static
|
459
|
+
* @memberOf _
|
460
|
+
* @since 3.0.0
|
461
|
+
* @category Lang
|
462
|
+
* @param {*} value The value to check.
|
463
|
+
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
|
464
|
+
* @example
|
465
|
+
*
|
466
|
+
* _.isTypedArray(new Uint8Array);
|
467
|
+
* // => true
|
468
|
+
*
|
469
|
+
* _.isTypedArray([]);
|
470
|
+
* // => false
|
471
|
+
*/
|
472
|
+
var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
|
473
|
+
|
474
|
+
/** Used for built-in method references. */
|
475
|
+
var objectProto$1 = Object.prototype;
|
476
|
+
|
477
|
+
/** Used to check objects for own properties. */
|
478
|
+
var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
|
479
|
+
|
480
|
+
/**
|
481
|
+
* Creates an array of the enumerable property names of the array-like `value`.
|
482
|
+
*
|
483
|
+
* @private
|
484
|
+
* @param {*} value The value to query.
|
485
|
+
* @param {boolean} inherited Specify returning inherited property names.
|
486
|
+
* @returns {Array} Returns the array of property names.
|
487
|
+
*/
|
488
|
+
function arrayLikeKeys(value, inherited) {
|
489
|
+
var isArr = isArray(value),
|
490
|
+
isArg = !isArr && isArguments(value),
|
491
|
+
isBuff = !isArr && !isArg && isBuffer(value),
|
492
|
+
isType = !isArr && !isArg && !isBuff && isTypedArray(value),
|
493
|
+
skipIndexes = isArr || isArg || isBuff || isType,
|
494
|
+
result = skipIndexes ? baseTimes(value.length, String) : [],
|
495
|
+
length = result.length;
|
496
|
+
|
497
|
+
for (var key in value) {
|
498
|
+
if ((inherited || hasOwnProperty$1.call(value, key)) &&
|
499
|
+
!(skipIndexes && (
|
500
|
+
// Safari 9 has enumerable `arguments.length` in strict mode.
|
501
|
+
key == 'length' ||
|
502
|
+
// Node.js 0.10 has enumerable non-index properties on buffers.
|
503
|
+
(isBuff && (key == 'offset' || key == 'parent')) ||
|
504
|
+
// PhantomJS 2 has enumerable non-index properties on typed arrays.
|
505
|
+
(isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
|
506
|
+
// Skip index properties.
|
507
|
+
isIndex(key, length)
|
508
|
+
))) {
|
509
|
+
result.push(key);
|
510
|
+
}
|
511
|
+
}
|
512
|
+
return result;
|
513
|
+
}
|
514
|
+
|
515
|
+
/**
|
516
|
+
* This function is like
|
517
|
+
* [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
|
518
|
+
* except that it includes inherited enumerable properties.
|
519
|
+
*
|
520
|
+
* @private
|
521
|
+
* @param {Object} object The object to query.
|
522
|
+
* @returns {Array} Returns the array of property names.
|
523
|
+
*/
|
524
|
+
function nativeKeysIn(object) {
|
525
|
+
var result = [];
|
526
|
+
if (object != null) {
|
527
|
+
for (var key in Object(object)) {
|
528
|
+
result.push(key);
|
529
|
+
}
|
530
|
+
}
|
531
|
+
return result;
|
532
|
+
}
|
533
|
+
|
534
|
+
/** Used for built-in method references. */
|
535
|
+
var objectProto = Object.prototype;
|
536
|
+
|
537
|
+
/** Used to check objects for own properties. */
|
538
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
539
|
+
|
540
|
+
/**
|
541
|
+
* The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
|
542
|
+
*
|
543
|
+
* @private
|
544
|
+
* @param {Object} object The object to query.
|
545
|
+
* @returns {Array} Returns the array of property names.
|
546
|
+
*/
|
547
|
+
function baseKeysIn(object) {
|
548
|
+
if (!isObject(object)) {
|
549
|
+
return nativeKeysIn(object);
|
550
|
+
}
|
551
|
+
var isProto = isPrototype(object),
|
552
|
+
result = [];
|
553
|
+
|
554
|
+
for (var key in object) {
|
555
|
+
if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
|
556
|
+
result.push(key);
|
557
|
+
}
|
558
|
+
}
|
559
|
+
return result;
|
560
|
+
}
|
561
|
+
|
562
|
+
/**
|
563
|
+
* Creates an array of the own and inherited enumerable property names of `object`.
|
564
|
+
*
|
565
|
+
* **Note:** Non-object values are coerced to objects.
|
566
|
+
*
|
567
|
+
* @static
|
568
|
+
* @memberOf _
|
569
|
+
* @since 3.0.0
|
570
|
+
* @category Object
|
571
|
+
* @param {Object} object The object to query.
|
572
|
+
* @returns {Array} Returns the array of property names.
|
573
|
+
* @example
|
574
|
+
*
|
575
|
+
* function Foo() {
|
576
|
+
* this.a = 1;
|
577
|
+
* this.b = 2;
|
578
|
+
* }
|
579
|
+
*
|
580
|
+
* Foo.prototype.c = 3;
|
581
|
+
*
|
582
|
+
* _.keysIn(new Foo);
|
583
|
+
* // => ['a', 'b', 'c'] (iteration order is not guaranteed)
|
584
|
+
*/
|
585
|
+
function keysIn(object) {
|
586
|
+
return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
|
587
|
+
}
|
588
|
+
|
589
|
+
/**
|
590
|
+
* Converts `value` to a string. An empty string is returned for `null`
|
591
|
+
* and `undefined` values. The sign of `-0` is preserved.
|
592
|
+
*
|
593
|
+
* @static
|
594
|
+
* @memberOf _
|
595
|
+
* @since 4.0.0
|
596
|
+
* @category Lang
|
597
|
+
* @param {*} value The value to convert.
|
598
|
+
* @returns {string} Returns the converted string.
|
599
|
+
* @example
|
600
|
+
*
|
601
|
+
* _.toString(null);
|
602
|
+
* // => ''
|
603
|
+
*
|
604
|
+
* _.toString(-0);
|
605
|
+
* // => '-0'
|
606
|
+
*
|
607
|
+
* _.toString([1, 2, 3]);
|
608
|
+
* // => '1,2,3'
|
609
|
+
*/
|
610
|
+
function toString(value) {
|
611
|
+
return value == null ? '' : baseToString(value);
|
612
|
+
}
|
613
|
+
|
614
|
+
/**
|
615
|
+
* Creates a base function for methods like `_.forIn` and `_.forOwn`.
|
616
|
+
*
|
617
|
+
* @private
|
618
|
+
* @param {boolean} [fromRight] Specify iterating from right to left.
|
619
|
+
* @returns {Function} Returns the new base function.
|
620
|
+
*/
|
621
|
+
function createBaseFor(fromRight) {
|
622
|
+
return function(object, iteratee, keysFunc) {
|
623
|
+
var index = -1,
|
624
|
+
iterable = Object(object),
|
625
|
+
props = keysFunc(object),
|
626
|
+
length = props.length;
|
627
|
+
|
628
|
+
while (length--) {
|
629
|
+
var key = props[fromRight ? length : ++index];
|
630
|
+
if (iteratee(iterable[key], key, iterable) === false) {
|
631
|
+
break;
|
632
|
+
}
|
633
|
+
}
|
634
|
+
return object;
|
635
|
+
};
|
636
|
+
}
|
637
|
+
|
638
|
+
/**
|
639
|
+
* The base implementation of `baseForOwn` which iterates over `object`
|
640
|
+
* properties returned by `keysFunc` and invokes `iteratee` for each property.
|
641
|
+
* Iteratee functions may exit iteration early by explicitly returning `false`.
|
642
|
+
*
|
643
|
+
* @private
|
644
|
+
* @param {Object} object The object to iterate over.
|
645
|
+
* @param {Function} iteratee The function invoked per iteration.
|
646
|
+
* @param {Function} keysFunc The function to get the keys of `object`.
|
647
|
+
* @returns {Object} Returns `object`.
|
648
|
+
*/
|
649
|
+
var baseFor = createBaseFor();
|
650
|
+
|
651
|
+
/**
|
652
|
+
* Casts `value` to `identity` if it's not a function.
|
653
|
+
*
|
654
|
+
* @private
|
655
|
+
* @param {*} value The value to inspect.
|
656
|
+
* @returns {Function} Returns cast function.
|
657
|
+
*/
|
658
|
+
function castFunction(value) {
|
659
|
+
return typeof value == 'function' ? value : identity;
|
660
|
+
}
|
661
|
+
|
662
|
+
/**
|
663
|
+
* Used to match `RegExp`
|
664
|
+
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
|
665
|
+
*/
|
666
|
+
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
|
667
|
+
reHasRegExpChar = RegExp(reRegExpChar.source);
|
668
|
+
|
669
|
+
/**
|
670
|
+
* Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
|
671
|
+
* "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
|
672
|
+
*
|
673
|
+
* @static
|
674
|
+
* @memberOf _
|
675
|
+
* @since 3.0.0
|
676
|
+
* @category String
|
677
|
+
* @param {string} [string=''] The string to escape.
|
678
|
+
* @returns {string} Returns the escaped string.
|
679
|
+
* @example
|
680
|
+
*
|
681
|
+
* _.escapeRegExp('[lodash](https://lodash.com/)');
|
682
|
+
* // => '\[lodash\]\(https://lodash\.com/\)'
|
683
|
+
*/
|
684
|
+
function escapeRegExp(string) {
|
685
|
+
string = toString(string);
|
686
|
+
return (string && reHasRegExpChar.test(string))
|
687
|
+
? string.replace(reRegExpChar, '\\$&')
|
688
|
+
: string;
|
689
|
+
}
|
690
|
+
|
691
|
+
/**
|
692
|
+
* Iterates over own and inherited enumerable string keyed properties of an
|
693
|
+
* object and invokes `iteratee` for each property. The iteratee is invoked
|
694
|
+
* with three arguments: (value, key, object). Iteratee functions may exit
|
695
|
+
* iteration early by explicitly returning `false`.
|
696
|
+
*
|
697
|
+
* @static
|
698
|
+
* @memberOf _
|
699
|
+
* @since 0.3.0
|
700
|
+
* @category Object
|
701
|
+
* @param {Object} object The object to iterate over.
|
702
|
+
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
|
703
|
+
* @returns {Object} Returns `object`.
|
704
|
+
* @see _.forInRight
|
705
|
+
* @example
|
706
|
+
*
|
707
|
+
* function Foo() {
|
708
|
+
* this.a = 1;
|
709
|
+
* this.b = 2;
|
710
|
+
* }
|
711
|
+
*
|
712
|
+
* Foo.prototype.c = 3;
|
713
|
+
*
|
714
|
+
* _.forIn(new Foo, function(value, key) {
|
715
|
+
* console.log(key);
|
716
|
+
* });
|
717
|
+
* // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
|
718
|
+
*/
|
719
|
+
function forIn(object, iteratee) {
|
720
|
+
return object == null
|
721
|
+
? object
|
722
|
+
: baseFor(object, castFunction(iteratee), keysIn);
|
723
|
+
}
|
724
|
+
|
7
725
|
/*!
|
8
726
|
* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
9
727
|
* See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
|
10
728
|
* v1.0.0-beta.97
|
11
|
-
*/
|
729
|
+
*/
|
730
|
+
const filter = (data, value) => {
|
731
|
+
const escapedValue = escapeRegExp(value);
|
732
|
+
const regex = new RegExp(escapedValue, "i");
|
733
|
+
if (data.length === 0) {
|
734
|
+
console.warn(`No data was passed to the filter function.
|
735
|
+
The data argument should be an array of objects`);
|
736
|
+
}
|
737
|
+
const find = (input, RE) => {
|
738
|
+
if ((input === null || input === void 0 ? void 0 : input.constant) || (input === null || input === void 0 ? void 0 : input.filterDisabled)) {
|
739
|
+
return true;
|
740
|
+
}
|
741
|
+
let found = false;
|
742
|
+
forIn(input, (val) => {
|
743
|
+
if (typeof val === "function" || val == null /* intentional == to catch undefined */) {
|
744
|
+
return;
|
745
|
+
}
|
746
|
+
if (Array.isArray(val) || (typeof val === "object" && val !== null)) {
|
747
|
+
if (find(val, RE)) {
|
748
|
+
found = true;
|
749
|
+
}
|
750
|
+
}
|
751
|
+
else if (RE.test(val)) {
|
752
|
+
found = true;
|
753
|
+
}
|
754
|
+
});
|
755
|
+
return found;
|
756
|
+
};
|
757
|
+
const result = data.filter((item) => {
|
758
|
+
return find(item, regex);
|
759
|
+
});
|
760
|
+
return result;
|
761
|
+
};
|
762
|
+
|
763
|
+
export { filter as f };
|