@wfrog/vc-ui 1.0.0
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/README.md +95 -0
- package/dist/es/chunk/-EkpfdcW.mjs +1100 -0
- package/dist/es/chunk/8rLUmOVR.mjs +29 -0
- package/dist/es/chunk/B-rxnVJv.mjs +3 -0
- package/dist/es/chunk/BAGoDD49.mjs +36 -0
- package/dist/es/chunk/BAtns-Mc.mjs +96 -0
- package/dist/es/chunk/BJS5Pdfp.mjs +55 -0
- package/dist/es/chunk/BMzd-IS6.mjs +900 -0
- package/dist/es/chunk/BWcCXRRK.mjs +229 -0
- package/dist/es/chunk/BX-Ogf7p.mjs +3743 -0
- package/dist/es/chunk/B_tU9Nax.mjs +49 -0
- package/dist/es/chunk/BdDihk0t.mjs +3420 -0
- package/dist/es/chunk/C2LgraHx.mjs +489 -0
- package/dist/es/chunk/C5hWsUfD.mjs +64 -0
- package/dist/es/chunk/C7iSSBUr.mjs +303 -0
- package/dist/es/chunk/CD98REcR.mjs +666 -0
- package/dist/es/chunk/CEClY-_T.mjs +445 -0
- package/dist/es/chunk/CEm0brzD.mjs +35 -0
- package/dist/es/chunk/CMABHk8B.mjs +1942 -0
- package/dist/es/chunk/CS4VKsqy.mjs +19 -0
- package/dist/es/chunk/CVlj9F0I.mjs +291 -0
- package/dist/es/chunk/CZ4ggqDE.mjs +140 -0
- package/dist/es/chunk/CaTfZePA.mjs +533 -0
- package/dist/es/chunk/Ce9ApjrT.mjs +201 -0
- package/dist/es/chunk/ClZGuAIb.mjs +10 -0
- package/dist/es/chunk/Coex0GxM.mjs +450 -0
- package/dist/es/chunk/Ct6q2FXg.mjs +5 -0
- package/dist/es/chunk/CyxEcbcy.mjs +29 -0
- package/dist/es/chunk/D389hx_T.mjs +35 -0
- package/dist/es/chunk/D3DXeVfC.mjs +1171 -0
- package/dist/es/chunk/D3uV7vm-.mjs +45 -0
- package/dist/es/chunk/D5259bwd.mjs +50 -0
- package/dist/es/chunk/DMHNh_tw.mjs +49 -0
- package/dist/es/chunk/DVNTpOBR.mjs +4 -0
- package/dist/es/chunk/DZACQ9LT.mjs +95 -0
- package/dist/es/chunk/De_EXLIy.mjs +22 -0
- package/dist/es/chunk/Dh4jaUSg.mjs +89 -0
- package/dist/es/chunk/DhhdKtyu.mjs +439 -0
- package/dist/es/chunk/DqUIKX7f.mjs +2039 -0
- package/dist/es/chunk/Dqz1zvKN.mjs +59 -0
- package/dist/es/chunk/Dvi7RsXg.mjs +727 -0
- package/dist/es/chunk/DyDMGLoF.mjs +123 -0
- package/dist/es/chunk/E_WRn0OP.mjs +449 -0
- package/dist/es/chunk/Fo0dZYnz.mjs +128 -0
- package/dist/es/chunk/HSv8BL8o.mjs +72 -0
- package/dist/es/chunk/JCIyOUEY.mjs +105 -0
- package/dist/es/chunk/O-uhUKF4.mjs +43 -0
- package/dist/es/chunk/Spa-JKB4.mjs +1046 -0
- package/dist/es/chunk/VAdRxe-1.mjs +16 -0
- package/dist/es/chunk/VCrtRnxt.mjs +1477 -0
- package/dist/es/chunk/ViP2SEY4.mjs +211 -0
- package/dist/es/chunk/aibQ9WSZ.mjs +249 -0
- package/dist/es/chunk/nWBcrYxV.mjs +690 -0
- package/dist/es/chunk/pcqpp-6-.mjs +9 -0
- package/dist/es/chunk/qY9OvNHY.mjs +283 -0
- package/dist/es/chunk/su2Zrql0.mjs +53 -0
- package/dist/es/chunk/zfg5SOj1.mjs +138 -0
- package/dist/es/components/awesome-icon/awesome-icon.d.ts +6 -0
- package/dist/es/components/awesome-icon/awesome-icon.mjs +41 -0
- package/dist/es/components/awesome-icon/awesome-icon.vue.d.ts +5 -0
- package/dist/es/components/awesome-icon/index.d.ts +4 -0
- package/dist/es/components/awesome-icon/index.mjs +6 -0
- package/dist/es/components/backbottom/backbottom.d.ts +7 -0
- package/dist/es/components/backbottom/backbottom.mjs +172 -0
- package/dist/es/components/backbottom/backbottom.vue.d.ts +7 -0
- package/dist/es/components/backbottom/components/child.vue.d.ts +30 -0
- package/dist/es/components/backbottom/index.d.ts +4 -0
- package/dist/es/components/backbottom/index.mjs +6 -0
- package/dist/es/components/button/button.d.ts +18 -0
- package/dist/es/components/button/button.mjs +313 -0
- package/dist/es/components/button/button.vue.d.ts +33 -0
- package/dist/es/components/button/index.css +9 -0
- package/dist/es/components/button/index.d.ts +4 -0
- package/dist/es/components/button/index.mjs +6 -0
- package/dist/es/components/cdn-tag.vue.d.ts +5 -0
- package/dist/es/components/chat-container/chat-container.d.ts +9 -0
- package/dist/es/components/chat-container/chat-container.mjs +77 -0
- package/dist/es/components/chat-container/chat-container.vue.d.ts +29 -0
- package/dist/es/components/chat-container/index.css +9 -0
- package/dist/es/components/chat-container/index.d.ts +4 -0
- package/dist/es/components/chat-container/index.mjs +6 -0
- package/dist/es/components/choice/choice.d.ts +6 -0
- package/dist/es/components/choice/choice.mjs +53 -0
- package/dist/es/components/choice/choice.vue.d.ts +5 -0
- package/dist/es/components/choice/index.css +7 -0
- package/dist/es/components/choice/index.d.ts +4 -0
- package/dist/es/components/choice/index.mjs +6 -0
- package/dist/es/components/choice-boolean/choice-boolean.d.ts +5 -0
- package/dist/es/components/choice-boolean/choice-boolean.mjs +32 -0
- package/dist/es/components/choice-boolean/choice-boolean.vue.d.ts +10 -0
- package/dist/es/components/choice-boolean/index.d.ts +4 -0
- package/dist/es/components/choice-boolean/index.mjs +6 -0
- package/dist/es/components/config-provider/config-provider.d.ts +16 -0
- package/dist/es/components/config-provider/config-provider.mjs +29 -0
- package/dist/es/components/config-provider/config-provider.vue.d.ts +18 -0
- package/dist/es/components/config-provider/config-provider2.mjs +6 -0
- package/dist/es/components/config-provider/index.d.ts +4 -0
- package/dist/es/components/config-provider/index.mjs +6 -0
- package/dist/es/components/cropper/cropper.d.ts +12 -0
- package/dist/es/components/cropper/cropper.mjs +333 -0
- package/dist/es/components/cropper/cropper.vue.d.ts +32 -0
- package/dist/es/components/cropper/index.css +4 -0
- package/dist/es/components/cropper/index.d.ts +4 -0
- package/dist/es/components/cropper/index.mjs +6 -0
- package/dist/es/components/currency/currency.d.ts +21 -0
- package/dist/es/components/currency/currency.mjs +185 -0
- package/dist/es/components/currency/currency.vue.d.ts +14 -0
- package/dist/es/components/currency/index.css +8 -0
- package/dist/es/components/currency/index.d.ts +4 -0
- package/dist/es/components/currency/index.mjs +6 -0
- package/dist/es/components/daterange-picker/daterange-picker.d.ts +6 -0
- package/dist/es/components/daterange-picker/daterange-picker.mjs +5550 -0
- package/dist/es/components/daterange-picker/daterange-picker.vue.d.ts +13 -0
- package/dist/es/components/daterange-picker/index.d.ts +4 -0
- package/dist/es/components/daterange-picker/index.mjs +6 -0
- package/dist/es/components/dialog/dialog.d.ts +13 -0
- package/dist/es/components/dialog/dialog.mjs +537 -0
- package/dist/es/components/dialog/dialog.vue.d.ts +38 -0
- package/dist/es/components/dialog/index.css +87 -0
- package/dist/es/components/dialog/index.d.ts +4 -0
- package/dist/es/components/dialog/index.mjs +6 -0
- package/dist/es/components/dialog-camera-upload/dialog-camera-upload.d.ts +33 -0
- package/dist/es/components/dialog-camera-upload/dialog-camera-upload.mjs +412 -0
- package/dist/es/components/dialog-camera-upload/dialog-camera-upload.vue.d.ts +23 -0
- package/dist/es/components/dialog-camera-upload/index.css +66 -0
- package/dist/es/components/dialog-camera-upload/index.d.ts +4 -0
- package/dist/es/components/dialog-camera-upload/index.mjs +6 -0
- package/dist/es/components/dialog-map-point/dialog-map-point.d.ts +9 -0
- package/dist/es/components/dialog-map-point/dialog-map-point.mjs +183 -0
- package/dist/es/components/dialog-map-point/dialog-map-point.vue.d.ts +22 -0
- package/dist/es/components/dialog-map-point/index.css +11 -0
- package/dist/es/components/dialog-map-point/index.d.ts +4 -0
- package/dist/es/components/dialog-map-point/index.mjs +6 -0
- package/dist/es/components/dialog-upload-images/dialog-upload-images.d.ts +16 -0
- package/dist/es/components/dialog-upload-images/dialog-upload-images.mjs +1391 -0
- package/dist/es/components/dialog-upload-images/dialog-upload-images.vue.d.ts +19 -0
- package/dist/es/components/dialog-upload-images/index.css +62 -0
- package/dist/es/components/dialog-upload-images/index.d.ts +4 -0
- package/dist/es/components/dialog-upload-images/index.mjs +6 -0
- package/dist/es/components/document.vue.d.ts +14 -0
- package/dist/es/components/drawer/drawer.d.ts +7 -0
- package/dist/es/components/drawer/drawer.mjs +412 -0
- package/dist/es/components/drawer/drawer.vue.d.ts +31 -0
- package/dist/es/components/drawer/index.css +56 -0
- package/dist/es/components/drawer/index.d.ts +4 -0
- package/dist/es/components/drawer/index.mjs +6 -0
- package/dist/es/components/easy-pagination/easy-pagination.d.ts +8 -0
- package/dist/es/components/easy-pagination/easy-pagination.mjs +74 -0
- package/dist/es/components/easy-pagination/easy-pagination.vue.d.ts +19 -0
- package/dist/es/components/easy-pagination/index.css +10 -0
- package/dist/es/components/easy-pagination/index.d.ts +4 -0
- package/dist/es/components/easy-pagination/index.mjs +6 -0
- package/dist/es/components/el-icon/el-icon.d.ts +6 -0
- package/dist/es/components/el-icon/el-icon.mjs +46 -0
- package/dist/es/components/el-icon/el-icon.vue.d.ts +6 -0
- package/dist/es/components/el-icon/index.css +7 -0
- package/dist/es/components/el-icon/index.d.ts +4 -0
- package/dist/es/components/el-icon/index.mjs +6 -0
- package/dist/es/components/example-wrapper.vue.d.ts +19 -0
- package/dist/es/components/flag/flag.mjs +44 -0
- package/dist/es/components/flag/flag.vue.d.ts +5 -0
- package/dist/es/components/flag/flags.d.ts +8 -0
- package/dist/es/components/flag/index.d.ts +4 -0
- package/dist/es/components/flag/index.mjs +6 -0
- package/dist/es/components/icon/icon.d.ts +6 -0
- package/dist/es/components/icon/icon.mjs +54 -0
- package/dist/es/components/icon/icon.vue.d.ts +3 -0
- package/dist/es/components/icon/icon2.mjs +27 -0
- package/dist/es/components/icon/index.css +9 -0
- package/dist/es/components/icon/index.d.ts +4 -0
- package/dist/es/components/icon/index.mjs +6 -0
- package/dist/es/components/image/image.d.ts +16 -0
- package/dist/es/components/image/image.mjs +167 -0
- package/dist/es/components/image/image.vue.d.ts +206 -0
- package/dist/es/components/image/index.css +20 -0
- package/dist/es/components/image/index.d.ts +4 -0
- package/dist/es/components/image/index.mjs +6 -0
- package/dist/es/components/input/index.css +9 -0
- package/dist/es/components/input/index.d.ts +4 -0
- package/dist/es/components/input/index.mjs +6 -0
- package/dist/es/components/input/input.d.ts +4 -0
- package/dist/es/components/input/input.mjs +85 -0
- package/dist/es/components/input/input.vue.d.ts +1232 -0
- package/dist/es/components/input-number/index.css +24 -0
- package/dist/es/components/input-number/index.d.ts +4 -0
- package/dist/es/components/input-number/index.mjs +6 -0
- package/dist/es/components/input-number/input-number.d.ts +8 -0
- package/dist/es/components/input-number/input-number.mjs +137 -0
- package/dist/es/components/input-number/input-number.vue.d.ts +35 -0
- package/dist/es/components/pca-picker/components/c.vue.d.ts +123 -0
- package/dist/es/components/pca-picker/components/elevator-item.vue.d.ts +7 -0
- package/dist/es/components/pca-picker/components/filter.vue.d.ts +2 -0
- package/dist/es/components/pca-picker/components/history.vue.d.ts +2 -0
- package/dist/es/components/pca-picker/components/hot.vue.d.ts +2 -0
- package/dist/es/components/pca-picker/components/p.vue.d.ts +2 -0
- package/dist/es/components/pca-picker/components/pca.vue.d.ts +9 -0
- package/dist/es/components/pca-picker/index.css +107 -0
- package/dist/es/components/pca-picker/index.d.ts +4 -0
- package/dist/es/components/pca-picker/index.mjs +6 -0
- package/dist/es/components/pca-picker/pca-picker.d.ts +78 -0
- package/dist/es/components/pca-picker/pca-picker.mjs +1667 -0
- package/dist/es/components/pca-picker/pca-picker.vue.d.ts +583 -0
- package/dist/es/components/qr-code/index.d.ts +4 -0
- package/dist/es/components/qr-code/index.mjs +6 -0
- package/dist/es/components/qr-code/qr-code.d.ts +9 -0
- package/dist/es/components/qr-code/qr-code.mjs +69 -0
- package/dist/es/components/qr-code/qr-code.vue.d.ts +13 -0
- package/dist/es/components/screenfull/index.css +14 -0
- package/dist/es/components/screenfull/index.d.ts +4 -0
- package/dist/es/components/screenfull/index.mjs +6 -0
- package/dist/es/components/screenfull/screenfull.d.ts +4 -0
- package/dist/es/components/screenfull/screenfull.mjs +91 -0
- package/dist/es/components/screenfull/screenfull.vue.d.ts +20 -0
- package/dist/es/components/select/index.css +9 -0
- package/dist/es/components/select/index.d.ts +4 -0
- package/dist/es/components/select/index.mjs +6 -0
- package/dist/es/components/select/select.d.ts +6 -0
- package/dist/es/components/select/select.mjs +63 -0
- package/dist/es/components/select/select.vue.d.ts +6 -0
- package/dist/es/components/single-player/index.css +45 -0
- package/dist/es/components/single-player/index.d.ts +4 -0
- package/dist/es/components/single-player/index.mjs +6 -0
- package/dist/es/components/single-player/single-player.d.ts +4 -0
- package/dist/es/components/single-player/single-player.mjs +1172 -0
- package/dist/es/components/single-player/single-player.vue.d.ts +13 -0
- package/dist/es/components/svg-icon/index.css +9 -0
- package/dist/es/components/svg-icon/index.d.ts +4 -0
- package/dist/es/components/svg-icon/index.mjs +6 -0
- package/dist/es/components/svg-icon/svg-icon.d.ts +5 -0
- package/dist/es/components/svg-icon/svg-icon.mjs +46 -0
- package/dist/es/components/svg-icon/svg-icon.vue.d.ts +18 -0
- package/dist/es/components/switch/index.css +15 -0
- package/dist/es/components/switch/index.d.ts +4 -0
- package/dist/es/components/switch/index.mjs +6 -0
- package/dist/es/components/switch/switch.d.ts +9 -0
- package/dist/es/components/switch/switch.mjs +82 -0
- package/dist/es/components/switch/switch.vue.d.ts +14 -0
- package/dist/es/components/sync-scroll-container/index.css +82 -0
- package/dist/es/components/sync-scroll-container/index.d.ts +4 -0
- package/dist/es/components/sync-scroll-container/index.mjs +6 -0
- package/dist/es/components/sync-scroll-container/sync-scroll-container.d.ts +6 -0
- package/dist/es/components/sync-scroll-container/sync-scroll-container.mjs +157 -0
- package/dist/es/components/sync-scroll-container/sync-scroll-container.vue.d.ts +36 -0
- package/dist/es/components/tags/index.css +17 -0
- package/dist/es/components/tags/index.d.ts +4 -0
- package/dist/es/components/tags/index.mjs +6 -0
- package/dist/es/components/tags/tags.d.ts +9 -0
- package/dist/es/components/tags/tags.mjs +296 -0
- package/dist/es/components/tags/tags.vue.d.ts +20 -0
- package/dist/es/components/text-ellipsis/index.css +15 -0
- package/dist/es/components/text-ellipsis/index.d.ts +4 -0
- package/dist/es/components/text-ellipsis/index.mjs +6 -0
- package/dist/es/components/text-ellipsis/text-ellipsis.d.ts +12 -0
- package/dist/es/components/text-ellipsis/text-ellipsis.mjs +137 -0
- package/dist/es/components/text-ellipsis/text-ellipsis.vue.d.ts +41 -0
- package/dist/es/components/thousand-input/index.css +4 -0
- package/dist/es/components/thousand-input/index.d.ts +4 -0
- package/dist/es/components/thousand-input/index.mjs +6 -0
- package/dist/es/components/thousand-input/thousand-input.d.ts +11 -0
- package/dist/es/components/thousand-input/thousand-input.mjs +159 -0
- package/dist/es/components/thousand-input/thousand-input.vue.d.ts +2558 -0
- package/dist/es/components/tinymce/config.d.ts +25 -0
- package/dist/es/components/tinymce/index.css +9 -0
- package/dist/es/components/tinymce/index.d.ts +4 -0
- package/dist/es/components/tinymce/index.mjs +6 -0
- package/dist/es/components/tinymce/tinymce.d.ts +9 -0
- package/dist/es/components/tinymce/tinymce.mjs +176 -0
- package/dist/es/components/tinymce/tinymce.vue.d.ts +20 -0
- package/dist/es/components/tree-picker/components/popover-cascader.d.ts +8 -0
- package/dist/es/components/tree-picker/components/popover-cascader.vue.d.ts +1361 -0
- package/dist/es/components/tree-picker/docs/data.d.ts +2 -0
- package/dist/es/components/tree-picker/index.css +41 -0
- package/dist/es/components/tree-picker/index.d.ts +4 -0
- package/dist/es/components/tree-picker/index.mjs +6 -0
- package/dist/es/components/tree-picker/popover-cascader.css +23 -0
- package/dist/es/components/tree-picker/tree-picker.d.ts +14 -0
- package/dist/es/components/tree-picker/tree-picker.mjs +173 -0
- package/dist/es/components/tree-picker/tree-picker.vue.d.ts +575 -0
- package/dist/es/components/upload-file/index.css +30 -0
- package/dist/es/components/upload-file/index.d.ts +4 -0
- package/dist/es/components/upload-file/index.mjs +6 -0
- package/dist/es/components/upload-file/upload-file.d.ts +39 -0
- package/dist/es/components/upload-file/upload-file.mjs +202 -0
- package/dist/es/components/upload-file/upload-file.vue.d.ts +30 -0
- package/dist/es/directives/cleave/index.d.ts +3 -0
- package/dist/es/directives/focus/index.d.ts +4 -0
- package/dist/es/directives/index.d.ts +3 -0
- package/dist/es/directives/thousand/index.d.ts +3 -0
- package/dist/es/index.d.ts +42 -0
- package/dist/es/index.mjs +122 -0
- package/dist/es/use/useSmallScreen/index.d.ts +4 -0
- package/dist/es/use/useSmallScreen/index.mjs +10 -0
- package/dist/es/use/useStore/index.d.ts +3 -0
- package/dist/es/use/useStore/index.mjs +22 -0
- package/dist/es/utils/index.d.ts +6 -0
- package/dist/es/utils/resolver.d.ts +3 -0
- package/dist/es/utils/resolver.mjs +24 -0
- package/dist/es/utils/typescript.d.ts +6 -0
- package/dist/global.d.ts +42 -0
- package/dist/index.css +869 -0
- package/package.json +58 -0
|
@@ -0,0 +1,1046 @@
|
|
|
1
|
+
import { i as isObjectLike, b as baseGetTag, S as Symbol$1, r as root } from './Fo0dZYnz.mjs';
|
|
2
|
+
|
|
3
|
+
/** `Object#toString` result references. */
|
|
4
|
+
var symbolTag = '[object Symbol]';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Checks if `value` is classified as a `Symbol` primitive or object.
|
|
8
|
+
*
|
|
9
|
+
* @static
|
|
10
|
+
* @memberOf _
|
|
11
|
+
* @since 4.0.0
|
|
12
|
+
* @category Lang
|
|
13
|
+
* @param {*} value The value to check.
|
|
14
|
+
* @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
|
|
15
|
+
* @example
|
|
16
|
+
*
|
|
17
|
+
* _.isSymbol(Symbol.iterator);
|
|
18
|
+
* // => true
|
|
19
|
+
*
|
|
20
|
+
* _.isSymbol('abc');
|
|
21
|
+
* // => false
|
|
22
|
+
*/
|
|
23
|
+
function isSymbol(value) {
|
|
24
|
+
return typeof value == 'symbol' ||
|
|
25
|
+
(isObjectLike(value) && baseGetTag(value) == symbolTag);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* A specialized version of `_.map` for arrays without support for iteratee
|
|
30
|
+
* shorthands.
|
|
31
|
+
*
|
|
32
|
+
* @private
|
|
33
|
+
* @param {Array} [array] The array to iterate over.
|
|
34
|
+
* @param {Function} iteratee The function invoked per iteration.
|
|
35
|
+
* @returns {Array} Returns the new mapped array.
|
|
36
|
+
*/
|
|
37
|
+
function arrayMap(array, iteratee) {
|
|
38
|
+
var index = -1,
|
|
39
|
+
length = array == null ? 0 : array.length,
|
|
40
|
+
result = Array(length);
|
|
41
|
+
|
|
42
|
+
while (++index < length) {
|
|
43
|
+
result[index] = iteratee(array[index], index, array);
|
|
44
|
+
}
|
|
45
|
+
return result;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Checks if `value` is classified as an `Array` object.
|
|
50
|
+
*
|
|
51
|
+
* @static
|
|
52
|
+
* @memberOf _
|
|
53
|
+
* @since 0.1.0
|
|
54
|
+
* @category Lang
|
|
55
|
+
* @param {*} value The value to check.
|
|
56
|
+
* @returns {boolean} Returns `true` if `value` is an array, else `false`.
|
|
57
|
+
* @example
|
|
58
|
+
*
|
|
59
|
+
* _.isArray([1, 2, 3]);
|
|
60
|
+
* // => true
|
|
61
|
+
*
|
|
62
|
+
* _.isArray(document.body.children);
|
|
63
|
+
* // => false
|
|
64
|
+
*
|
|
65
|
+
* _.isArray('abc');
|
|
66
|
+
* // => false
|
|
67
|
+
*
|
|
68
|
+
* _.isArray(_.noop);
|
|
69
|
+
* // => false
|
|
70
|
+
*/
|
|
71
|
+
var isArray = Array.isArray;
|
|
72
|
+
|
|
73
|
+
/** Used to convert symbols to primitives and strings. */
|
|
74
|
+
var symbolProto = Symbol$1 ? Symbol$1.prototype : undefined,
|
|
75
|
+
symbolToString = symbolProto ? symbolProto.toString : undefined;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* The base implementation of `_.toString` which doesn't convert nullish
|
|
79
|
+
* values to empty strings.
|
|
80
|
+
*
|
|
81
|
+
* @private
|
|
82
|
+
* @param {*} value The value to process.
|
|
83
|
+
* @returns {string} Returns the string.
|
|
84
|
+
*/
|
|
85
|
+
function baseToString(value) {
|
|
86
|
+
// Exit early for strings to avoid a performance hit in some environments.
|
|
87
|
+
if (typeof value == 'string') {
|
|
88
|
+
return value;
|
|
89
|
+
}
|
|
90
|
+
if (isArray(value)) {
|
|
91
|
+
// Recursively convert values (susceptible to call stack limits).
|
|
92
|
+
return arrayMap(value, baseToString) + '';
|
|
93
|
+
}
|
|
94
|
+
if (isSymbol(value)) {
|
|
95
|
+
return symbolToString ? symbolToString.call(value) : '';
|
|
96
|
+
}
|
|
97
|
+
var result = (value + '');
|
|
98
|
+
return (result == '0' && (1 / value) == -Infinity) ? '-0' : result;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Checks if `value` is the
|
|
103
|
+
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
|
|
104
|
+
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
|
105
|
+
*
|
|
106
|
+
* @static
|
|
107
|
+
* @memberOf _
|
|
108
|
+
* @since 0.1.0
|
|
109
|
+
* @category Lang
|
|
110
|
+
* @param {*} value The value to check.
|
|
111
|
+
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
|
|
112
|
+
* @example
|
|
113
|
+
*
|
|
114
|
+
* _.isObject({});
|
|
115
|
+
* // => true
|
|
116
|
+
*
|
|
117
|
+
* _.isObject([1, 2, 3]);
|
|
118
|
+
* // => true
|
|
119
|
+
*
|
|
120
|
+
* _.isObject(_.noop);
|
|
121
|
+
* // => true
|
|
122
|
+
*
|
|
123
|
+
* _.isObject(null);
|
|
124
|
+
* // => false
|
|
125
|
+
*/
|
|
126
|
+
function isObject(value) {
|
|
127
|
+
var type = typeof value;
|
|
128
|
+
return value != null && (type == 'object' || type == 'function');
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/** `Object#toString` result references. */
|
|
132
|
+
var asyncTag = '[object AsyncFunction]',
|
|
133
|
+
funcTag = '[object Function]',
|
|
134
|
+
genTag = '[object GeneratorFunction]',
|
|
135
|
+
proxyTag = '[object Proxy]';
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Checks if `value` is classified as a `Function` object.
|
|
139
|
+
*
|
|
140
|
+
* @static
|
|
141
|
+
* @memberOf _
|
|
142
|
+
* @since 0.1.0
|
|
143
|
+
* @category Lang
|
|
144
|
+
* @param {*} value The value to check.
|
|
145
|
+
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
|
|
146
|
+
* @example
|
|
147
|
+
*
|
|
148
|
+
* _.isFunction(_);
|
|
149
|
+
* // => true
|
|
150
|
+
*
|
|
151
|
+
* _.isFunction(/abc/);
|
|
152
|
+
* // => false
|
|
153
|
+
*/
|
|
154
|
+
function isFunction(value) {
|
|
155
|
+
if (!isObject(value)) {
|
|
156
|
+
return false;
|
|
157
|
+
}
|
|
158
|
+
// The use of `Object#toString` avoids issues with the `typeof` operator
|
|
159
|
+
// in Safari 9 which returns 'object' for typed arrays and other constructors.
|
|
160
|
+
var tag = baseGetTag(value);
|
|
161
|
+
return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/** Used to detect overreaching core-js shims. */
|
|
165
|
+
var coreJsData = root['__core-js_shared__'];
|
|
166
|
+
|
|
167
|
+
/** Used to detect methods masquerading as native. */
|
|
168
|
+
var maskSrcKey = (function() {
|
|
169
|
+
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
|
|
170
|
+
return uid ? ('Symbol(src)_1.' + uid) : '';
|
|
171
|
+
}());
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Checks if `func` has its source masked.
|
|
175
|
+
*
|
|
176
|
+
* @private
|
|
177
|
+
* @param {Function} func The function to check.
|
|
178
|
+
* @returns {boolean} Returns `true` if `func` is masked, else `false`.
|
|
179
|
+
*/
|
|
180
|
+
function isMasked(func) {
|
|
181
|
+
return !!maskSrcKey && (maskSrcKey in func);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/** Used for built-in method references. */
|
|
185
|
+
var funcProto$1 = Function.prototype;
|
|
186
|
+
|
|
187
|
+
/** Used to resolve the decompiled source of functions. */
|
|
188
|
+
var funcToString$1 = funcProto$1.toString;
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Converts `func` to its source code.
|
|
192
|
+
*
|
|
193
|
+
* @private
|
|
194
|
+
* @param {Function} func The function to convert.
|
|
195
|
+
* @returns {string} Returns the source code.
|
|
196
|
+
*/
|
|
197
|
+
function toSource(func) {
|
|
198
|
+
if (func != null) {
|
|
199
|
+
try {
|
|
200
|
+
return funcToString$1.call(func);
|
|
201
|
+
} catch (e) {}
|
|
202
|
+
try {
|
|
203
|
+
return (func + '');
|
|
204
|
+
} catch (e) {}
|
|
205
|
+
}
|
|
206
|
+
return '';
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Used to match `RegExp`
|
|
211
|
+
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
|
|
212
|
+
*/
|
|
213
|
+
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
|
214
|
+
|
|
215
|
+
/** Used to detect host constructors (Safari). */
|
|
216
|
+
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
217
|
+
|
|
218
|
+
/** Used for built-in method references. */
|
|
219
|
+
var funcProto = Function.prototype,
|
|
220
|
+
objectProto$3 = Object.prototype;
|
|
221
|
+
|
|
222
|
+
/** Used to resolve the decompiled source of functions. */
|
|
223
|
+
var funcToString = funcProto.toString;
|
|
224
|
+
|
|
225
|
+
/** Used to check objects for own properties. */
|
|
226
|
+
var hasOwnProperty$3 = objectProto$3.hasOwnProperty;
|
|
227
|
+
|
|
228
|
+
/** Used to detect if a method is native. */
|
|
229
|
+
var reIsNative = RegExp('^' +
|
|
230
|
+
funcToString.call(hasOwnProperty$3).replace(reRegExpChar, '\\$&')
|
|
231
|
+
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
|
|
232
|
+
);
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* The base implementation of `_.isNative` without bad shim checks.
|
|
236
|
+
*
|
|
237
|
+
* @private
|
|
238
|
+
* @param {*} value The value to check.
|
|
239
|
+
* @returns {boolean} Returns `true` if `value` is a native function,
|
|
240
|
+
* else `false`.
|
|
241
|
+
*/
|
|
242
|
+
function baseIsNative(value) {
|
|
243
|
+
if (!isObject(value) || isMasked(value)) {
|
|
244
|
+
return false;
|
|
245
|
+
}
|
|
246
|
+
var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
|
|
247
|
+
return pattern.test(toSource(value));
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* Gets the value at `key` of `object`.
|
|
252
|
+
*
|
|
253
|
+
* @private
|
|
254
|
+
* @param {Object} [object] The object to query.
|
|
255
|
+
* @param {string} key The key of the property to get.
|
|
256
|
+
* @returns {*} Returns the property value.
|
|
257
|
+
*/
|
|
258
|
+
function getValue(object, key) {
|
|
259
|
+
return object == null ? undefined : object[key];
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Gets the native function at `key` of `object`.
|
|
264
|
+
*
|
|
265
|
+
* @private
|
|
266
|
+
* @param {Object} object The object to query.
|
|
267
|
+
* @param {string} key The key of the method to get.
|
|
268
|
+
* @returns {*} Returns the function if it's native, else `undefined`.
|
|
269
|
+
*/
|
|
270
|
+
function getNative(object, key) {
|
|
271
|
+
var value = getValue(object, key);
|
|
272
|
+
return baseIsNative(value) ? value : undefined;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/** Used as references for various `Number` constants. */
|
|
276
|
+
var MAX_SAFE_INTEGER$1 = 9007199254740991;
|
|
277
|
+
|
|
278
|
+
/** Used to detect unsigned integer values. */
|
|
279
|
+
var reIsUint = /^(?:0|[1-9]\d*)$/;
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* Checks if `value` is a valid array-like index.
|
|
283
|
+
*
|
|
284
|
+
* @private
|
|
285
|
+
* @param {*} value The value to check.
|
|
286
|
+
* @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
|
|
287
|
+
* @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
|
|
288
|
+
*/
|
|
289
|
+
function isIndex(value, length) {
|
|
290
|
+
var type = typeof value;
|
|
291
|
+
length = length == null ? MAX_SAFE_INTEGER$1 : length;
|
|
292
|
+
|
|
293
|
+
return !!length &&
|
|
294
|
+
(type == 'number' ||
|
|
295
|
+
(type != 'symbol' && reIsUint.test(value))) &&
|
|
296
|
+
(value > -1 && value % 1 == 0 && value < length);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* Performs a
|
|
301
|
+
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
|
|
302
|
+
* comparison between two values to determine if they are equivalent.
|
|
303
|
+
*
|
|
304
|
+
* @static
|
|
305
|
+
* @memberOf _
|
|
306
|
+
* @since 4.0.0
|
|
307
|
+
* @category Lang
|
|
308
|
+
* @param {*} value The value to compare.
|
|
309
|
+
* @param {*} other The other value to compare.
|
|
310
|
+
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
|
311
|
+
* @example
|
|
312
|
+
*
|
|
313
|
+
* var object = { 'a': 1 };
|
|
314
|
+
* var other = { 'a': 1 };
|
|
315
|
+
*
|
|
316
|
+
* _.eq(object, object);
|
|
317
|
+
* // => true
|
|
318
|
+
*
|
|
319
|
+
* _.eq(object, other);
|
|
320
|
+
* // => false
|
|
321
|
+
*
|
|
322
|
+
* _.eq('a', 'a');
|
|
323
|
+
* // => true
|
|
324
|
+
*
|
|
325
|
+
* _.eq('a', Object('a'));
|
|
326
|
+
* // => false
|
|
327
|
+
*
|
|
328
|
+
* _.eq(NaN, NaN);
|
|
329
|
+
* // => true
|
|
330
|
+
*/
|
|
331
|
+
function eq(value, other) {
|
|
332
|
+
return value === other || (value !== value && other !== other);
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
/** Used as references for various `Number` constants. */
|
|
336
|
+
var MAX_SAFE_INTEGER = 9007199254740991;
|
|
337
|
+
|
|
338
|
+
/**
|
|
339
|
+
* Checks if `value` is a valid array-like length.
|
|
340
|
+
*
|
|
341
|
+
* **Note:** This method is loosely based on
|
|
342
|
+
* [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
|
|
343
|
+
*
|
|
344
|
+
* @static
|
|
345
|
+
* @memberOf _
|
|
346
|
+
* @since 4.0.0
|
|
347
|
+
* @category Lang
|
|
348
|
+
* @param {*} value The value to check.
|
|
349
|
+
* @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
|
|
350
|
+
* @example
|
|
351
|
+
*
|
|
352
|
+
* _.isLength(3);
|
|
353
|
+
* // => true
|
|
354
|
+
*
|
|
355
|
+
* _.isLength(Number.MIN_VALUE);
|
|
356
|
+
* // => false
|
|
357
|
+
*
|
|
358
|
+
* _.isLength(Infinity);
|
|
359
|
+
* // => false
|
|
360
|
+
*
|
|
361
|
+
* _.isLength('3');
|
|
362
|
+
* // => false
|
|
363
|
+
*/
|
|
364
|
+
function isLength(value) {
|
|
365
|
+
return typeof value == 'number' &&
|
|
366
|
+
value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
/** `Object#toString` result references. */
|
|
370
|
+
var argsTag = '[object Arguments]';
|
|
371
|
+
|
|
372
|
+
/**
|
|
373
|
+
* The base implementation of `_.isArguments`.
|
|
374
|
+
*
|
|
375
|
+
* @private
|
|
376
|
+
* @param {*} value The value to check.
|
|
377
|
+
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
|
|
378
|
+
*/
|
|
379
|
+
function baseIsArguments(value) {
|
|
380
|
+
return isObjectLike(value) && baseGetTag(value) == argsTag;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
/** Used for built-in method references. */
|
|
384
|
+
var objectProto$2 = Object.prototype;
|
|
385
|
+
|
|
386
|
+
/** Used to check objects for own properties. */
|
|
387
|
+
var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
|
|
388
|
+
|
|
389
|
+
/** Built-in value references. */
|
|
390
|
+
var propertyIsEnumerable = objectProto$2.propertyIsEnumerable;
|
|
391
|
+
|
|
392
|
+
/**
|
|
393
|
+
* Checks if `value` is likely an `arguments` object.
|
|
394
|
+
*
|
|
395
|
+
* @static
|
|
396
|
+
* @memberOf _
|
|
397
|
+
* @since 0.1.0
|
|
398
|
+
* @category Lang
|
|
399
|
+
* @param {*} value The value to check.
|
|
400
|
+
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
|
|
401
|
+
* else `false`.
|
|
402
|
+
* @example
|
|
403
|
+
*
|
|
404
|
+
* _.isArguments(function() { return arguments; }());
|
|
405
|
+
* // => true
|
|
406
|
+
*
|
|
407
|
+
* _.isArguments([1, 2, 3]);
|
|
408
|
+
* // => false
|
|
409
|
+
*/
|
|
410
|
+
var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
|
|
411
|
+
return isObjectLike(value) && hasOwnProperty$2.call(value, 'callee') &&
|
|
412
|
+
!propertyIsEnumerable.call(value, 'callee');
|
|
413
|
+
};
|
|
414
|
+
|
|
415
|
+
/** Used to match property names within property paths. */
|
|
416
|
+
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
|
|
417
|
+
reIsPlainProp = /^\w*$/;
|
|
418
|
+
|
|
419
|
+
/**
|
|
420
|
+
* Checks if `value` is a property name and not a property path.
|
|
421
|
+
*
|
|
422
|
+
* @private
|
|
423
|
+
* @param {*} value The value to check.
|
|
424
|
+
* @param {Object} [object] The object to query keys on.
|
|
425
|
+
* @returns {boolean} Returns `true` if `value` is a property name, else `false`.
|
|
426
|
+
*/
|
|
427
|
+
function isKey(value, object) {
|
|
428
|
+
if (isArray(value)) {
|
|
429
|
+
return false;
|
|
430
|
+
}
|
|
431
|
+
var type = typeof value;
|
|
432
|
+
if (type == 'number' || type == 'symbol' || type == 'boolean' ||
|
|
433
|
+
value == null || isSymbol(value)) {
|
|
434
|
+
return true;
|
|
435
|
+
}
|
|
436
|
+
return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
|
|
437
|
+
(object != null && value in Object(object));
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
/* Built-in method references that are verified to be native. */
|
|
441
|
+
var nativeCreate = getNative(Object, 'create');
|
|
442
|
+
|
|
443
|
+
/**
|
|
444
|
+
* Removes all key-value entries from the hash.
|
|
445
|
+
*
|
|
446
|
+
* @private
|
|
447
|
+
* @name clear
|
|
448
|
+
* @memberOf Hash
|
|
449
|
+
*/
|
|
450
|
+
function hashClear() {
|
|
451
|
+
this.__data__ = nativeCreate ? nativeCreate(null) : {};
|
|
452
|
+
this.size = 0;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
/**
|
|
456
|
+
* Removes `key` and its value from the hash.
|
|
457
|
+
*
|
|
458
|
+
* @private
|
|
459
|
+
* @name delete
|
|
460
|
+
* @memberOf Hash
|
|
461
|
+
* @param {Object} hash The hash to modify.
|
|
462
|
+
* @param {string} key The key of the value to remove.
|
|
463
|
+
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
464
|
+
*/
|
|
465
|
+
function hashDelete(key) {
|
|
466
|
+
var result = this.has(key) && delete this.__data__[key];
|
|
467
|
+
this.size -= result ? 1 : 0;
|
|
468
|
+
return result;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
/** Used to stand-in for `undefined` hash values. */
|
|
472
|
+
var HASH_UNDEFINED$1 = '__lodash_hash_undefined__';
|
|
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
|
+
* Gets the hash value for `key`.
|
|
482
|
+
*
|
|
483
|
+
* @private
|
|
484
|
+
* @name get
|
|
485
|
+
* @memberOf Hash
|
|
486
|
+
* @param {string} key The key of the value to get.
|
|
487
|
+
* @returns {*} Returns the entry value.
|
|
488
|
+
*/
|
|
489
|
+
function hashGet(key) {
|
|
490
|
+
var data = this.__data__;
|
|
491
|
+
if (nativeCreate) {
|
|
492
|
+
var result = data[key];
|
|
493
|
+
return result === HASH_UNDEFINED$1 ? undefined : result;
|
|
494
|
+
}
|
|
495
|
+
return hasOwnProperty$1.call(data, key) ? data[key] : undefined;
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
/** Used for built-in method references. */
|
|
499
|
+
var objectProto = Object.prototype;
|
|
500
|
+
|
|
501
|
+
/** Used to check objects for own properties. */
|
|
502
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
503
|
+
|
|
504
|
+
/**
|
|
505
|
+
* Checks if a hash value for `key` exists.
|
|
506
|
+
*
|
|
507
|
+
* @private
|
|
508
|
+
* @name has
|
|
509
|
+
* @memberOf Hash
|
|
510
|
+
* @param {string} key The key of the entry to check.
|
|
511
|
+
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
512
|
+
*/
|
|
513
|
+
function hashHas(key) {
|
|
514
|
+
var data = this.__data__;
|
|
515
|
+
return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
/** Used to stand-in for `undefined` hash values. */
|
|
519
|
+
var HASH_UNDEFINED = '__lodash_hash_undefined__';
|
|
520
|
+
|
|
521
|
+
/**
|
|
522
|
+
* Sets the hash `key` to `value`.
|
|
523
|
+
*
|
|
524
|
+
* @private
|
|
525
|
+
* @name set
|
|
526
|
+
* @memberOf Hash
|
|
527
|
+
* @param {string} key The key of the value to set.
|
|
528
|
+
* @param {*} value The value to set.
|
|
529
|
+
* @returns {Object} Returns the hash instance.
|
|
530
|
+
*/
|
|
531
|
+
function hashSet(key, value) {
|
|
532
|
+
var data = this.__data__;
|
|
533
|
+
this.size += this.has(key) ? 0 : 1;
|
|
534
|
+
data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
|
|
535
|
+
return this;
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
/**
|
|
539
|
+
* Creates a hash object.
|
|
540
|
+
*
|
|
541
|
+
* @private
|
|
542
|
+
* @constructor
|
|
543
|
+
* @param {Array} [entries] The key-value pairs to cache.
|
|
544
|
+
*/
|
|
545
|
+
function Hash(entries) {
|
|
546
|
+
var index = -1,
|
|
547
|
+
length = entries == null ? 0 : entries.length;
|
|
548
|
+
|
|
549
|
+
this.clear();
|
|
550
|
+
while (++index < length) {
|
|
551
|
+
var entry = entries[index];
|
|
552
|
+
this.set(entry[0], entry[1]);
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
// Add methods to `Hash`.
|
|
557
|
+
Hash.prototype.clear = hashClear;
|
|
558
|
+
Hash.prototype['delete'] = hashDelete;
|
|
559
|
+
Hash.prototype.get = hashGet;
|
|
560
|
+
Hash.prototype.has = hashHas;
|
|
561
|
+
Hash.prototype.set = hashSet;
|
|
562
|
+
|
|
563
|
+
/**
|
|
564
|
+
* Removes all key-value entries from the list cache.
|
|
565
|
+
*
|
|
566
|
+
* @private
|
|
567
|
+
* @name clear
|
|
568
|
+
* @memberOf ListCache
|
|
569
|
+
*/
|
|
570
|
+
function listCacheClear() {
|
|
571
|
+
this.__data__ = [];
|
|
572
|
+
this.size = 0;
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
/**
|
|
576
|
+
* Gets the index at which the `key` is found in `array` of key-value pairs.
|
|
577
|
+
*
|
|
578
|
+
* @private
|
|
579
|
+
* @param {Array} array The array to inspect.
|
|
580
|
+
* @param {*} key The key to search for.
|
|
581
|
+
* @returns {number} Returns the index of the matched value, else `-1`.
|
|
582
|
+
*/
|
|
583
|
+
function assocIndexOf(array, key) {
|
|
584
|
+
var length = array.length;
|
|
585
|
+
while (length--) {
|
|
586
|
+
if (eq(array[length][0], key)) {
|
|
587
|
+
return length;
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
return -1;
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
/** Used for built-in method references. */
|
|
594
|
+
var arrayProto = Array.prototype;
|
|
595
|
+
|
|
596
|
+
/** Built-in value references. */
|
|
597
|
+
var splice = arrayProto.splice;
|
|
598
|
+
|
|
599
|
+
/**
|
|
600
|
+
* Removes `key` and its value from the list cache.
|
|
601
|
+
*
|
|
602
|
+
* @private
|
|
603
|
+
* @name delete
|
|
604
|
+
* @memberOf ListCache
|
|
605
|
+
* @param {string} key The key of the value to remove.
|
|
606
|
+
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
607
|
+
*/
|
|
608
|
+
function listCacheDelete(key) {
|
|
609
|
+
var data = this.__data__,
|
|
610
|
+
index = assocIndexOf(data, key);
|
|
611
|
+
|
|
612
|
+
if (index < 0) {
|
|
613
|
+
return false;
|
|
614
|
+
}
|
|
615
|
+
var lastIndex = data.length - 1;
|
|
616
|
+
if (index == lastIndex) {
|
|
617
|
+
data.pop();
|
|
618
|
+
} else {
|
|
619
|
+
splice.call(data, index, 1);
|
|
620
|
+
}
|
|
621
|
+
--this.size;
|
|
622
|
+
return true;
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
/**
|
|
626
|
+
* Gets the list cache value for `key`.
|
|
627
|
+
*
|
|
628
|
+
* @private
|
|
629
|
+
* @name get
|
|
630
|
+
* @memberOf ListCache
|
|
631
|
+
* @param {string} key The key of the value to get.
|
|
632
|
+
* @returns {*} Returns the entry value.
|
|
633
|
+
*/
|
|
634
|
+
function listCacheGet(key) {
|
|
635
|
+
var data = this.__data__,
|
|
636
|
+
index = assocIndexOf(data, key);
|
|
637
|
+
|
|
638
|
+
return index < 0 ? undefined : data[index][1];
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
/**
|
|
642
|
+
* Checks if a list cache value for `key` exists.
|
|
643
|
+
*
|
|
644
|
+
* @private
|
|
645
|
+
* @name has
|
|
646
|
+
* @memberOf ListCache
|
|
647
|
+
* @param {string} key The key of the entry to check.
|
|
648
|
+
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
649
|
+
*/
|
|
650
|
+
function listCacheHas(key) {
|
|
651
|
+
return assocIndexOf(this.__data__, key) > -1;
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
/**
|
|
655
|
+
* Sets the list cache `key` to `value`.
|
|
656
|
+
*
|
|
657
|
+
* @private
|
|
658
|
+
* @name set
|
|
659
|
+
* @memberOf ListCache
|
|
660
|
+
* @param {string} key The key of the value to set.
|
|
661
|
+
* @param {*} value The value to set.
|
|
662
|
+
* @returns {Object} Returns the list cache instance.
|
|
663
|
+
*/
|
|
664
|
+
function listCacheSet(key, value) {
|
|
665
|
+
var data = this.__data__,
|
|
666
|
+
index = assocIndexOf(data, key);
|
|
667
|
+
|
|
668
|
+
if (index < 0) {
|
|
669
|
+
++this.size;
|
|
670
|
+
data.push([key, value]);
|
|
671
|
+
} else {
|
|
672
|
+
data[index][1] = value;
|
|
673
|
+
}
|
|
674
|
+
return this;
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
/**
|
|
678
|
+
* Creates an list cache object.
|
|
679
|
+
*
|
|
680
|
+
* @private
|
|
681
|
+
* @constructor
|
|
682
|
+
* @param {Array} [entries] The key-value pairs to cache.
|
|
683
|
+
*/
|
|
684
|
+
function ListCache(entries) {
|
|
685
|
+
var index = -1,
|
|
686
|
+
length = entries == null ? 0 : entries.length;
|
|
687
|
+
|
|
688
|
+
this.clear();
|
|
689
|
+
while (++index < length) {
|
|
690
|
+
var entry = entries[index];
|
|
691
|
+
this.set(entry[0], entry[1]);
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
// Add methods to `ListCache`.
|
|
696
|
+
ListCache.prototype.clear = listCacheClear;
|
|
697
|
+
ListCache.prototype['delete'] = listCacheDelete;
|
|
698
|
+
ListCache.prototype.get = listCacheGet;
|
|
699
|
+
ListCache.prototype.has = listCacheHas;
|
|
700
|
+
ListCache.prototype.set = listCacheSet;
|
|
701
|
+
|
|
702
|
+
/* Built-in method references that are verified to be native. */
|
|
703
|
+
var Map = getNative(root, 'Map');
|
|
704
|
+
|
|
705
|
+
/**
|
|
706
|
+
* Removes all key-value entries from the map.
|
|
707
|
+
*
|
|
708
|
+
* @private
|
|
709
|
+
* @name clear
|
|
710
|
+
* @memberOf MapCache
|
|
711
|
+
*/
|
|
712
|
+
function mapCacheClear() {
|
|
713
|
+
this.size = 0;
|
|
714
|
+
this.__data__ = {
|
|
715
|
+
'hash': new Hash,
|
|
716
|
+
'map': new (Map || ListCache),
|
|
717
|
+
'string': new Hash
|
|
718
|
+
};
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
/**
|
|
722
|
+
* Checks if `value` is suitable for use as unique object key.
|
|
723
|
+
*
|
|
724
|
+
* @private
|
|
725
|
+
* @param {*} value The value to check.
|
|
726
|
+
* @returns {boolean} Returns `true` if `value` is suitable, else `false`.
|
|
727
|
+
*/
|
|
728
|
+
function isKeyable(value) {
|
|
729
|
+
var type = typeof value;
|
|
730
|
+
return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
|
|
731
|
+
? (value !== '__proto__')
|
|
732
|
+
: (value === null);
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
/**
|
|
736
|
+
* Gets the data for `map`.
|
|
737
|
+
*
|
|
738
|
+
* @private
|
|
739
|
+
* @param {Object} map The map to query.
|
|
740
|
+
* @param {string} key The reference key.
|
|
741
|
+
* @returns {*} Returns the map data.
|
|
742
|
+
*/
|
|
743
|
+
function getMapData(map, key) {
|
|
744
|
+
var data = map.__data__;
|
|
745
|
+
return isKeyable(key)
|
|
746
|
+
? data[typeof key == 'string' ? 'string' : 'hash']
|
|
747
|
+
: data.map;
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
/**
|
|
751
|
+
* Removes `key` and its value from the map.
|
|
752
|
+
*
|
|
753
|
+
* @private
|
|
754
|
+
* @name delete
|
|
755
|
+
* @memberOf MapCache
|
|
756
|
+
* @param {string} key The key of the value to remove.
|
|
757
|
+
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
758
|
+
*/
|
|
759
|
+
function mapCacheDelete(key) {
|
|
760
|
+
var result = getMapData(this, key)['delete'](key);
|
|
761
|
+
this.size -= result ? 1 : 0;
|
|
762
|
+
return result;
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
/**
|
|
766
|
+
* Gets the map value for `key`.
|
|
767
|
+
*
|
|
768
|
+
* @private
|
|
769
|
+
* @name get
|
|
770
|
+
* @memberOf MapCache
|
|
771
|
+
* @param {string} key The key of the value to get.
|
|
772
|
+
* @returns {*} Returns the entry value.
|
|
773
|
+
*/
|
|
774
|
+
function mapCacheGet(key) {
|
|
775
|
+
return getMapData(this, key).get(key);
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
/**
|
|
779
|
+
* Checks if a map value for `key` exists.
|
|
780
|
+
*
|
|
781
|
+
* @private
|
|
782
|
+
* @name has
|
|
783
|
+
* @memberOf MapCache
|
|
784
|
+
* @param {string} key The key of the entry to check.
|
|
785
|
+
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
786
|
+
*/
|
|
787
|
+
function mapCacheHas(key) {
|
|
788
|
+
return getMapData(this, key).has(key);
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
/**
|
|
792
|
+
* Sets the map `key` to `value`.
|
|
793
|
+
*
|
|
794
|
+
* @private
|
|
795
|
+
* @name set
|
|
796
|
+
* @memberOf MapCache
|
|
797
|
+
* @param {string} key The key of the value to set.
|
|
798
|
+
* @param {*} value The value to set.
|
|
799
|
+
* @returns {Object} Returns the map cache instance.
|
|
800
|
+
*/
|
|
801
|
+
function mapCacheSet(key, value) {
|
|
802
|
+
var data = getMapData(this, key),
|
|
803
|
+
size = data.size;
|
|
804
|
+
|
|
805
|
+
data.set(key, value);
|
|
806
|
+
this.size += data.size == size ? 0 : 1;
|
|
807
|
+
return this;
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
/**
|
|
811
|
+
* Creates a map cache object to store key-value pairs.
|
|
812
|
+
*
|
|
813
|
+
* @private
|
|
814
|
+
* @constructor
|
|
815
|
+
* @param {Array} [entries] The key-value pairs to cache.
|
|
816
|
+
*/
|
|
817
|
+
function MapCache(entries) {
|
|
818
|
+
var index = -1,
|
|
819
|
+
length = entries == null ? 0 : entries.length;
|
|
820
|
+
|
|
821
|
+
this.clear();
|
|
822
|
+
while (++index < length) {
|
|
823
|
+
var entry = entries[index];
|
|
824
|
+
this.set(entry[0], entry[1]);
|
|
825
|
+
}
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
// Add methods to `MapCache`.
|
|
829
|
+
MapCache.prototype.clear = mapCacheClear;
|
|
830
|
+
MapCache.prototype['delete'] = mapCacheDelete;
|
|
831
|
+
MapCache.prototype.get = mapCacheGet;
|
|
832
|
+
MapCache.prototype.has = mapCacheHas;
|
|
833
|
+
MapCache.prototype.set = mapCacheSet;
|
|
834
|
+
|
|
835
|
+
/** Error message constants. */
|
|
836
|
+
var FUNC_ERROR_TEXT = 'Expected a function';
|
|
837
|
+
|
|
838
|
+
/**
|
|
839
|
+
* Creates a function that memoizes the result of `func`. If `resolver` is
|
|
840
|
+
* provided, it determines the cache key for storing the result based on the
|
|
841
|
+
* arguments provided to the memoized function. By default, the first argument
|
|
842
|
+
* provided to the memoized function is used as the map cache key. The `func`
|
|
843
|
+
* is invoked with the `this` binding of the memoized function.
|
|
844
|
+
*
|
|
845
|
+
* **Note:** The cache is exposed as the `cache` property on the memoized
|
|
846
|
+
* function. Its creation may be customized by replacing the `_.memoize.Cache`
|
|
847
|
+
* constructor with one whose instances implement the
|
|
848
|
+
* [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
|
|
849
|
+
* method interface of `clear`, `delete`, `get`, `has`, and `set`.
|
|
850
|
+
*
|
|
851
|
+
* @static
|
|
852
|
+
* @memberOf _
|
|
853
|
+
* @since 0.1.0
|
|
854
|
+
* @category Function
|
|
855
|
+
* @param {Function} func The function to have its output memoized.
|
|
856
|
+
* @param {Function} [resolver] The function to resolve the cache key.
|
|
857
|
+
* @returns {Function} Returns the new memoized function.
|
|
858
|
+
* @example
|
|
859
|
+
*
|
|
860
|
+
* var object = { 'a': 1, 'b': 2 };
|
|
861
|
+
* var other = { 'c': 3, 'd': 4 };
|
|
862
|
+
*
|
|
863
|
+
* var values = _.memoize(_.values);
|
|
864
|
+
* values(object);
|
|
865
|
+
* // => [1, 2]
|
|
866
|
+
*
|
|
867
|
+
* values(other);
|
|
868
|
+
* // => [3, 4]
|
|
869
|
+
*
|
|
870
|
+
* object.a = 2;
|
|
871
|
+
* values(object);
|
|
872
|
+
* // => [1, 2]
|
|
873
|
+
*
|
|
874
|
+
* // Modify the result cache.
|
|
875
|
+
* values.cache.set(object, ['a', 'b']);
|
|
876
|
+
* values(object);
|
|
877
|
+
* // => ['a', 'b']
|
|
878
|
+
*
|
|
879
|
+
* // Replace `_.memoize.Cache`.
|
|
880
|
+
* _.memoize.Cache = WeakMap;
|
|
881
|
+
*/
|
|
882
|
+
function memoize(func, resolver) {
|
|
883
|
+
if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
|
|
884
|
+
throw new TypeError(FUNC_ERROR_TEXT);
|
|
885
|
+
}
|
|
886
|
+
var memoized = function() {
|
|
887
|
+
var args = arguments,
|
|
888
|
+
key = resolver ? resolver.apply(this, args) : args[0],
|
|
889
|
+
cache = memoized.cache;
|
|
890
|
+
|
|
891
|
+
if (cache.has(key)) {
|
|
892
|
+
return cache.get(key);
|
|
893
|
+
}
|
|
894
|
+
var result = func.apply(this, args);
|
|
895
|
+
memoized.cache = cache.set(key, result) || cache;
|
|
896
|
+
return result;
|
|
897
|
+
};
|
|
898
|
+
memoized.cache = new (memoize.Cache || MapCache);
|
|
899
|
+
return memoized;
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
// Expose `MapCache`.
|
|
903
|
+
memoize.Cache = MapCache;
|
|
904
|
+
|
|
905
|
+
/** Used as the maximum memoize cache size. */
|
|
906
|
+
var MAX_MEMOIZE_SIZE = 500;
|
|
907
|
+
|
|
908
|
+
/**
|
|
909
|
+
* A specialized version of `_.memoize` which clears the memoized function's
|
|
910
|
+
* cache when it exceeds `MAX_MEMOIZE_SIZE`.
|
|
911
|
+
*
|
|
912
|
+
* @private
|
|
913
|
+
* @param {Function} func The function to have its output memoized.
|
|
914
|
+
* @returns {Function} Returns the new memoized function.
|
|
915
|
+
*/
|
|
916
|
+
function memoizeCapped(func) {
|
|
917
|
+
var result = memoize(func, function(key) {
|
|
918
|
+
if (cache.size === MAX_MEMOIZE_SIZE) {
|
|
919
|
+
cache.clear();
|
|
920
|
+
}
|
|
921
|
+
return key;
|
|
922
|
+
});
|
|
923
|
+
|
|
924
|
+
var cache = result.cache;
|
|
925
|
+
return result;
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
/** Used to match property names within property paths. */
|
|
929
|
+
var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
|
|
930
|
+
|
|
931
|
+
/** Used to match backslashes in property paths. */
|
|
932
|
+
var reEscapeChar = /\\(\\)?/g;
|
|
933
|
+
|
|
934
|
+
/**
|
|
935
|
+
* Converts `string` to a property path array.
|
|
936
|
+
*
|
|
937
|
+
* @private
|
|
938
|
+
* @param {string} string The string to convert.
|
|
939
|
+
* @returns {Array} Returns the property path array.
|
|
940
|
+
*/
|
|
941
|
+
var stringToPath = memoizeCapped(function(string) {
|
|
942
|
+
var result = [];
|
|
943
|
+
if (string.charCodeAt(0) === 46 /* . */) {
|
|
944
|
+
result.push('');
|
|
945
|
+
}
|
|
946
|
+
string.replace(rePropName, function(match, number, quote, subString) {
|
|
947
|
+
result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
|
|
948
|
+
});
|
|
949
|
+
return result;
|
|
950
|
+
});
|
|
951
|
+
|
|
952
|
+
/**
|
|
953
|
+
* Converts `value` to a string. An empty string is returned for `null`
|
|
954
|
+
* and `undefined` values. The sign of `-0` is preserved.
|
|
955
|
+
*
|
|
956
|
+
* @static
|
|
957
|
+
* @memberOf _
|
|
958
|
+
* @since 4.0.0
|
|
959
|
+
* @category Lang
|
|
960
|
+
* @param {*} value The value to convert.
|
|
961
|
+
* @returns {string} Returns the converted string.
|
|
962
|
+
* @example
|
|
963
|
+
*
|
|
964
|
+
* _.toString(null);
|
|
965
|
+
* // => ''
|
|
966
|
+
*
|
|
967
|
+
* _.toString(-0);
|
|
968
|
+
* // => '-0'
|
|
969
|
+
*
|
|
970
|
+
* _.toString([1, 2, 3]);
|
|
971
|
+
* // => '1,2,3'
|
|
972
|
+
*/
|
|
973
|
+
function toString(value) {
|
|
974
|
+
return value == null ? '' : baseToString(value);
|
|
975
|
+
}
|
|
976
|
+
|
|
977
|
+
/**
|
|
978
|
+
* Casts `value` to a path array if it's not one.
|
|
979
|
+
*
|
|
980
|
+
* @private
|
|
981
|
+
* @param {*} value The value to inspect.
|
|
982
|
+
* @param {Object} [object] The object to query keys on.
|
|
983
|
+
* @returns {Array} Returns the cast property path array.
|
|
984
|
+
*/
|
|
985
|
+
function castPath(value, object) {
|
|
986
|
+
if (isArray(value)) {
|
|
987
|
+
return value;
|
|
988
|
+
}
|
|
989
|
+
return isKey(value, object) ? [value] : stringToPath(toString(value));
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
/**
|
|
993
|
+
* Converts `value` to a string key if it's not a string or symbol.
|
|
994
|
+
*
|
|
995
|
+
* @private
|
|
996
|
+
* @param {*} value The value to inspect.
|
|
997
|
+
* @returns {string|symbol} Returns the key.
|
|
998
|
+
*/
|
|
999
|
+
function toKey(value) {
|
|
1000
|
+
if (typeof value == 'string' || isSymbol(value)) {
|
|
1001
|
+
return value;
|
|
1002
|
+
}
|
|
1003
|
+
var result = (value + '');
|
|
1004
|
+
return (result == '0' && (1 / value) == -Infinity) ? '-0' : result;
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
/**
|
|
1008
|
+
* The base implementation of `_.get` without support for default values.
|
|
1009
|
+
*
|
|
1010
|
+
* @private
|
|
1011
|
+
* @param {Object} object The object to query.
|
|
1012
|
+
* @param {Array|string} path The path of the property to get.
|
|
1013
|
+
* @returns {*} Returns the resolved value.
|
|
1014
|
+
*/
|
|
1015
|
+
function baseGet(object, path) {
|
|
1016
|
+
path = castPath(path, object);
|
|
1017
|
+
|
|
1018
|
+
var index = 0,
|
|
1019
|
+
length = path.length;
|
|
1020
|
+
|
|
1021
|
+
while (object != null && index < length) {
|
|
1022
|
+
object = object[toKey(path[index++])];
|
|
1023
|
+
}
|
|
1024
|
+
return (index && index == length) ? object : undefined;
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
/**
|
|
1028
|
+
* Appends the elements of `values` to `array`.
|
|
1029
|
+
*
|
|
1030
|
+
* @private
|
|
1031
|
+
* @param {Array} array The array to modify.
|
|
1032
|
+
* @param {Array} values The values to append.
|
|
1033
|
+
* @returns {Array} Returns `array`.
|
|
1034
|
+
*/
|
|
1035
|
+
function arrayPush(array, values) {
|
|
1036
|
+
var index = -1,
|
|
1037
|
+
length = values.length,
|
|
1038
|
+
offset = array.length;
|
|
1039
|
+
|
|
1040
|
+
while (++index < length) {
|
|
1041
|
+
array[offset + index] = values[index];
|
|
1042
|
+
}
|
|
1043
|
+
return array;
|
|
1044
|
+
}
|
|
1045
|
+
|
|
1046
|
+
export { ListCache as L, Map as M, arrayMap as a, isArray as b, isKey as c, baseGet as d, castPath as e, isLength as f, getNative as g, isFunction as h, isObject as i, isArguments as j, isIndex as k, MapCache as l, arrayPush as m, toSource as n, eq as o, isSymbol as p, toKey as t };
|