@vunk/form 2.18.2 → 2.19.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.
Files changed (323) hide show
  1. package/components/_plugin-vue_export-helper.cjs +1 -11
  2. package/components/api-tables-select/index.cjs +1 -467
  3. package/components/api-tables-select/index.mjs +56 -413
  4. package/components/api-tables-select/src/ctx.d.ts +152 -172
  5. package/components/api-tables-select/src/index.vue.d.ts +394 -983
  6. package/components/button/index.cjs +1 -112
  7. package/components/button/index.mjs +57 -85
  8. package/components/button/src/ctx.d.ts +28 -113
  9. package/components/button/src/index.vue.d.ts +317 -625
  10. package/components/card-input-collection/index.cjs +1 -370
  11. package/components/card-input-collection/index.mjs +175 -277
  12. package/components/card-input-collection/src/core.vue.d.ts +54 -951
  13. package/components/card-input-collection/src/ctx.d.ts +19 -49
  14. package/components/card-input-collection/src/index.vue.d.ts +46 -110
  15. package/components/cascader/index.cjs +1 -150
  16. package/components/cascader/index.mjs +88 -116
  17. package/components/cascader/src/ctx.d.ts +140 -207
  18. package/components/cascader/src/index.vue.d.ts +315 -522
  19. package/components/cascader/src/use.d.ts +1 -1
  20. package/components/checkbox/index.cjs +1 -152
  21. package/components/checkbox/index.mjs +75 -119
  22. package/components/checkbox/src/ctx.d.ts +46 -69
  23. package/components/checkbox/src/index.vue.d.ts +448 -1016
  24. package/components/cloneDeep.cjs +1 -2106
  25. package/components/color-picker/index.cjs +1 -80
  26. package/components/color-picker/index.mjs +46 -69
  27. package/components/color-picker/src/ctx.d.ts +130 -107
  28. package/components/color-picker/src/index.vue.d.ts +285 -255
  29. package/components/date-picker/index.cjs +1 -119
  30. package/components/date-picker/index.mjs +63 -97
  31. package/components/date-picker/src/ctx.d.ts +123 -206
  32. package/components/date-picker/src/index.vue.d.ts +269 -1358
  33. package/components/date-picker/src/types.d.ts +7 -7
  34. package/components/date-picker-range/index.cjs +1 -177
  35. package/components/date-picker-range/index.mjs +62 -113
  36. package/components/date-picker-range/src/ctx.d.ts +130 -206
  37. package/components/date-picker-range/src/index.vue.d.ts +861 -448
  38. package/components/debounce.cjs +1 -0
  39. package/components/dialog/index.cjs +1 -126
  40. package/components/dialog/index.mjs +65 -99
  41. package/components/dialog/src/ctx.d.ts +17 -108
  42. package/components/dialog/src/index.vue.d.ts +77 -1072
  43. package/components/dialog-input-collection/index.cjs +1 -624
  44. package/components/dialog-input-collection/index.mjs +276 -498
  45. package/components/dialog-input-collection/src/ctx.d.ts +21 -52
  46. package/components/dialog-input-collection/src/dialog-form.vue.d.ts +29 -6371
  47. package/components/dialog-input-collection/src/index.vue.d.ts +65 -7630
  48. package/components/dialog-input-collection/src/layout.vue.d.ts +13 -73
  49. package/components/download-plus/index.cjs +1 -456
  50. package/components/download-plus/index.mjs +215 -358
  51. package/components/download-plus/src/api.d.ts +1 -1
  52. package/components/download-plus/src/ctx.d.ts +21 -52
  53. package/components/download-plus/src/index.vue.d.ts +437 -1177
  54. package/components/editable-text/index.cjs +1 -295
  55. package/components/editable-text/index.mjs +113 -239
  56. package/components/editable-text/src/ctx.d.ts +24 -50
  57. package/components/editable-text/src/index.vue.d.ts +59 -3258
  58. package/components/el-slider/index.cjs +1 -0
  59. package/components/el-slider/index.d.ts +5 -0
  60. package/components/el-slider/index.mjs +475 -0
  61. package/components/el-slider/src/button.d.ts +36 -0
  62. package/components/el-slider/src/button.vue.d.ts +41 -0
  63. package/components/el-slider/src/composables/index.cjs +1 -0
  64. package/components/el-slider/src/composables/index.d.ts +6 -0
  65. package/components/el-slider/src/composables/index.mjs +9 -0
  66. package/components/el-slider/src/composables/use-lifecycle.d.ts +4 -0
  67. package/components/el-slider/src/composables/use-marks.d.ts +7 -0
  68. package/components/el-slider/src/composables/use-slide.d.ts +23 -0
  69. package/components/el-slider/src/composables/use-slider-button.d.ts +18 -0
  70. package/components/el-slider/src/composables/use-stops.d.ts +8 -0
  71. package/components/el-slider/src/composables/use-watch.d.ts +4 -0
  72. package/components/el-slider/src/constants.d.ts +14 -0
  73. package/components/el-slider/src/marker.d.ts +37 -0
  74. package/components/el-slider/src/slider-core.vue.d.ts +218 -0
  75. package/components/el-slider/src/slider.d.ts +174 -0
  76. package/components/esri-input-geojson/index.cjs +2 -1604
  77. package/components/esri-input-geojson/index.mjs +682 -1290
  78. package/components/esri-input-geojson/src/append.vue.d.ts +239 -1099
  79. package/components/esri-input-geojson/src/const.d.ts +1 -1
  80. package/components/esri-input-geojson/src/ctx.d.ts +66 -161
  81. package/components/esri-input-geojson/src/default-view.vue.d.ts +8 -132
  82. package/components/esri-input-geojson/src/index.vue.d.ts +982 -708
  83. package/components/esri-input-geojson/src/types.d.ts +1 -0
  84. package/components/esri-input-geojson/src/viewer.vue.d.ts +53 -282
  85. package/components/fieldset/index.cjs +1 -110
  86. package/components/fieldset/index.mjs +63 -76
  87. package/components/fieldset/src/ctx.d.ts +4 -4
  88. package/components/fieldset/src/index.vue.d.ts +7 -7
  89. package/components/form/index.cjs +1 -248
  90. package/components/form/index.mjs +107 -161
  91. package/components/form/src/ctx.d.ts +15 -64
  92. package/components/form/src/index.vue.d.ts +374 -2431
  93. package/components/form-item/index.cjs +1 -294
  94. package/components/form-item/index.mjs +140 -229
  95. package/components/form-item/src/core.vue.d.ts +32 -1854
  96. package/components/form-item/src/ctx.d.ts +19 -51
  97. package/components/form-item/src/index.vue.d.ts +38 -101
  98. package/components/form-item-renderer/index.cjs +1 -193
  99. package/components/form-item-renderer/index.mjs +103 -162
  100. package/components/form-item-renderer/src/core.vue.d.ts +9 -9
  101. package/components/form-item-renderer/src/ctx.d.ts +3 -3
  102. package/components/form-item-renderer/src/index.vue.d.ts +24 -74
  103. package/components/form-item-renderer-template/index.cjs +1 -47
  104. package/components/form-item-renderer-template/index.mjs +20 -33
  105. package/components/form-item-renderer-template/src/index.vue.d.ts +1 -1
  106. package/components/forms-provider/index.cjs +1 -99
  107. package/components/forms-provider/index.mjs +44 -73
  108. package/components/forms-provider/src/core.d.ts +3 -2
  109. package/components/forms-provider/src/segment.vue.d.ts +8 -8
  110. package/components/forms-provider/src/view.vue.d.ts +14 -4
  111. package/components/index.cjs +1 -399
  112. package/components/index2.cjs +1 -17
  113. package/components/information/index.cjs +1 -65
  114. package/components/information/index.mjs +28 -38
  115. package/components/information/src/ctx.d.ts +2 -2
  116. package/components/information/src/index.vue.d.ts +4 -4
  117. package/components/information-collection/index.cjs +1 -81
  118. package/components/information-collection/index.mjs +44 -48
  119. package/components/information-collection/src/ctx.d.ts +29 -65
  120. package/components/information-collection/src/index.vue.d.ts +64 -136
  121. package/components/information-renderer/index.cjs +1 -16
  122. package/components/information-renderer/index.d.ts +9 -9
  123. package/components/information-renderer/index.mjs +9 -10
  124. package/components/information-tag/index.cjs +1 -101
  125. package/components/information-tag/index.mjs +44 -54
  126. package/components/information-tag/src/ctx.d.ts +6 -21
  127. package/components/information-tag/src/index.vue.d.ts +23 -51
  128. package/components/information-templates-default/index.cjs +1 -101
  129. package/components/information-templates-default/index.mjs +63 -73
  130. package/components/information-templates-default/src/index.vue.d.ts +1 -1
  131. package/components/input/index.cjs +1 -115
  132. package/components/input/index.mjs +60 -83
  133. package/components/input/src/ctx.d.ts +51 -152
  134. package/components/input/src/index.vue.d.ts +392 -951
  135. package/components/input-array/index.cjs +1 -310
  136. package/components/input-array/index.mjs +114 -244
  137. package/components/input-array/src/ctx.d.ts +19 -49
  138. package/components/input-array/src/form-template.vue.d.ts +1 -901
  139. package/components/input-array/src/index.vue.d.ts +43 -730
  140. package/components/input-collection/index.cjs +1 -452
  141. package/components/input-collection/index.mjs +195 -355
  142. package/components/input-collection/src/core.vue.d.ts +64 -1026
  143. package/components/input-collection/src/ctx.d.ts +21 -51
  144. package/components/input-collection/src/index.vue.d.ts +50 -114
  145. package/components/input-file/index.cjs +1 -142
  146. package/components/input-file/index.mjs +68 -100
  147. package/components/input-file/src/ctx.d.ts +8 -29
  148. package/components/input-file/src/index.vue.d.ts +444 -74
  149. package/components/input-file/src/template.vue.d.ts +1 -124
  150. package/components/input-link/index.cjs +1 -167
  151. package/components/input-link/index.mjs +60 -83
  152. package/components/input-link/src/ctx.d.ts +52 -137
  153. package/components/input-link/src/index.vue.d.ts +833 -311
  154. package/components/input-number/index.cjs +1 -119
  155. package/components/input-number/index.mjs +73 -87
  156. package/components/input-number/src/ctx.d.ts +38 -131
  157. package/components/input-number/src/index.vue.d.ts +321 -683
  158. package/components/input-tag/index.cjs +1 -100
  159. package/components/input-tag/index.mjs +51 -78
  160. package/components/input-tag/src/ctx.d.ts +43 -145
  161. package/components/input-tag/src/index.vue.d.ts +324 -778
  162. package/components/isObject.cjs +1 -165
  163. package/components/monaco-editor/index.cjs +1 -83
  164. package/components/monaco-editor/index.mjs +40 -59
  165. package/components/monaco-editor/src/ctx.d.ts +19 -44
  166. package/components/monaco-editor/src/index.vue.d.ts +209 -109
  167. package/components/radio/index.cjs +1 -267
  168. package/components/radio/index.mjs +110 -209
  169. package/components/radio/src/ctx.d.ts +27 -91
  170. package/components/radio/src/index.vue.d.ts +298 -1279
  171. package/components/radio/src/option.vue.d.ts +29 -881
  172. package/components/radio/src/wraper.vue.d.ts +64 -196
  173. package/components/renderer-data/index.cjs +1 -41
  174. package/components/renderer-data/index.mjs +19 -26
  175. package/components/renderer-data/src/ctx.d.ts +1 -1
  176. package/components/renderer-data/src/index.vue.d.ts +2 -2
  177. package/components/select/index.cjs +1 -311
  178. package/components/select/index.mjs +156 -214
  179. package/components/select/src/core.vue.d.ts +638 -1080
  180. package/components/select/src/ctx.d.ts +140 -223
  181. package/components/select/src/index.vue.d.ts +334 -610
  182. package/components/select/src/options.vue.d.ts +1 -1
  183. package/components/slider/index.cjs +1 -88
  184. package/components/slider/index.mjs +41 -70
  185. package/components/slider/src/ctx.d.ts +63 -174
  186. package/components/slider/src/index.vue.d.ts +151 -420
  187. package/components/style.css +1 -0
  188. package/components/switch/index.cjs +1 -88
  189. package/components/switch/index.mjs +37 -69
  190. package/components/switch/src/ctx.d.ts +34 -113
  191. package/components/switch/src/index.vue.d.ts +88 -699
  192. package/components/switch/src/types.d.ts +2 -2
  193. package/components/tables-select/index.cjs +1 -263
  194. package/components/tables-select/index.mjs +102 -172
  195. package/components/tables-select/src/ctx.d.ts +76 -91
  196. package/components/tables-select/src/index.vue.d.ts +228 -4969
  197. package/components/template-instances-provider/index.cjs +1 -31
  198. package/components/template-instances-provider/index.mjs +18 -22
  199. package/components/template-instances-provider/src/index.vue.d.ts +2 -2
  200. package/components/templates-default/index.cjs +1 -235
  201. package/components/templates-default/index.mjs +152 -211
  202. package/components/templates-default/src/ctx.d.ts +5 -3
  203. package/components/templates-default/src/index.vue.d.ts +7298 -157
  204. package/components/templates-element-plus/index.cjs +1 -112
  205. package/components/templates-element-plus/index.mjs +49 -91
  206. package/components/templates-element-plus/src/ctx.d.ts +1 -1
  207. package/components/templates-element-plus/src/index.vue.d.ts +65 -258
  208. package/components/templates-esri/index.cjs +1 -65
  209. package/components/templates-esri/index.mjs +29 -39
  210. package/components/templates-esri/src/ctx.d.ts +1 -1
  211. package/components/templates-esri/src/index.vue.d.ts +1776 -24
  212. package/components/templates-layout/index.cjs +1 -137
  213. package/components/templates-layout/index.mjs +78 -116
  214. package/components/templates-layout/src/ctx.d.ts +1 -1
  215. package/components/templates-layout/src/index.vue.d.ts +79 -411
  216. package/components/templates-variant/index.cjs +1 -70
  217. package/components/templates-variant/index.mjs +33 -43
  218. package/components/templates-variant/src/ctx.d.ts +1 -1
  219. package/components/templates-variant/src/index.vue.d.ts +1238 -24
  220. package/components/time-picker/index.cjs +1 -104
  221. package/components/time-picker/index.mjs +57 -87
  222. package/components/time-picker/src/ctx.d.ts +121 -211
  223. package/components/time-picker/src/index.vue.d.ts +263 -1368
  224. package/components/upload/index.cjs +1 -663
  225. package/components/upload/index.mjs +343 -537
  226. package/components/upload/src/ctx.d.ts +108 -195
  227. package/components/upload/src/file.vue.d.ts +197 -776
  228. package/components/upload/src/index.vue.d.ts +689 -1931
  229. package/components/upload/src/types.d.ts +1 -1
  230. package/components/upload/src/wraper.vue.d.ts +232 -407
  231. package/components/upload-plus/index.cjs +21 -18673
  232. package/components/upload-plus/index.mjs +4598 -18372
  233. package/components/upload-plus/src/api.d.ts +2 -2
  234. package/components/upload-plus/src/ctx.d.ts +24 -51
  235. package/components/upload-plus/src/index.vue.d.ts +51 -1656
  236. package/components/use-watch.cjs +1 -0
  237. package/components/van-cascader/index.cjs +1 -125
  238. package/components/van-cascader/index.mjs +51 -96
  239. package/components/van-cascader/src/ctx.d.ts +135 -203
  240. package/components/van-cascader/src/index.vue.d.ts +312 -985
  241. package/components/var-datetime-picker/index.cjs +1 -333
  242. package/components/var-datetime-picker/index.mjs +175 -254
  243. package/components/var-datetime-picker/src/ctx.d.ts +19 -50
  244. package/components/var-datetime-picker/src/index.vue.d.ts +688 -1115
  245. package/components/vditor/index.cjs +1 -86
  246. package/components/vditor/index.mjs +40 -66
  247. package/components/vditor/src/ctx.d.ts +16 -45
  248. package/components/vditor/src/index.vue.d.ts +195 -120
  249. package/composables/element-plus/index.cjs +1 -23
  250. package/composables/element-plus/index.mjs +14 -18
  251. package/composables/index.cjs +1 -161
  252. package/composables/index.d.ts +1 -0
  253. package/composables/index.mjs +102 -135
  254. package/composables/useForm.d.ts +2 -2
  255. package/composables/useRtl.d.ts +18 -0
  256. package/composables/useSourceManager.d.ts +2 -2
  257. package/composables/useTemplateInstances.d.ts +3 -3
  258. package/index.css +1 -562
  259. package/index.d.ts +0 -3
  260. package/index.esm.js +23 -48
  261. package/locale/index.cjs +1 -102
  262. package/locale/index.mjs +34 -34
  263. package/locale/lang/index.cjs +1 -2
  264. package/locale/lang/index.d.ts +1 -0
  265. package/package.json +14 -85
  266. package/shared/const/index.cjs +1 -59
  267. package/shared/const/index.d.ts +1 -1
  268. package/shared/const/index.mjs +18 -20
  269. package/shared/element-plus/ctx.d.ts +40 -37
  270. package/shared/element-plus/index.cjs +1 -211
  271. package/shared/element-plus/index.mjs +93 -161
  272. package/shared/element-plus/instances.d.ts +207 -321
  273. package/shared/form/index.cjs +1 -33
  274. package/shared/form/index.mjs +23 -25
  275. package/shared/helper/index.cjs +1 -11
  276. package/shared/helper/index.mjs +7 -8
  277. package/shared/index.cjs +1 -8
  278. package/shared/index.mjs +5 -1
  279. package/shared/infer-prop/index.cjs +1 -36
  280. package/shared/infer-prop/index.mjs +22 -28
  281. package/shared/progress-it/index.cjs +1 -42
  282. package/shared/progress-it/index.mjs +15 -31
  283. package/shared/rules/index.cjs +1 -56
  284. package/shared/rules/index.mjs +19 -18
  285. package/shared/types/form/index.cjs +1 -2
  286. package/shared/types/index.cjs +1 -2
  287. package/shared/types/source/index.cjs +1 -2
  288. package/shared/types/source-manager/index.cjs +1 -2
  289. package/shared/upload/index.cjs +1 -774
  290. package/shared/upload/index.mjs +180 -764
  291. package/component.d.ts +0 -3
  292. package/components/_plugin-vue_export-helper.mjs +0 -9
  293. package/components/card-input-collection/index.css +0 -21
  294. package/components/cascader/index.css +0 -9
  295. package/components/checkbox/index.css +0 -30
  296. package/components/cloneDeep.mjs +0 -2104
  297. package/components/date-picker-range/index.css +0 -18
  298. package/components/dialog-input-collection/index.css +0 -21
  299. package/components/download-plus/index.css +0 -68
  300. package/components/editable-text/index.css +0 -9
  301. package/components/esri-input-geojson/index.css +0 -32
  302. package/components/fieldset/index.css +0 -5
  303. package/components/form-item/index.css +0 -35
  304. package/components/index.mjs +0 -378
  305. package/components/index2.mjs +0 -14
  306. package/components/information-tag/index.css +0 -6
  307. package/components/information-templates-default/index.css +0 -16
  308. package/components/input-array/index.css +0 -14
  309. package/components/input-collection/index.css +0 -20
  310. package/components/input-link/index.css +0 -4
  311. package/components/input-number/index.css +0 -13
  312. package/components/isObject.mjs +0 -158
  313. package/components/monaco-editor/index.css +0 -4
  314. package/components/radio/index.css +0 -40
  315. package/components/select/index.css +0 -15
  316. package/components/switch/index.css +0 -10
  317. package/components/tables-select/index.css +0 -3
  318. package/components/templates-layout/index.css +0 -3
  319. package/components/upload/index.css +0 -34
  320. package/components/upload-plus/index.css +0 -84
  321. package/components/van-cascader/index.css +0 -6
  322. package/components/var-datetime-picker/index.css +0 -17
  323. package/defaults.d.ts +0 -5
@@ -1,2104 +0,0 @@
1
- import { a as isObject, b as baseGetTag, r as root, i as isObjectLike, f as freeGlobal, S as Symbol } from './isObject.mjs';
2
-
3
- /**
4
- * Checks if `value` is classified as an `Array` object.
5
- *
6
- * @static
7
- * @memberOf _
8
- * @since 0.1.0
9
- * @category Lang
10
- * @param {*} value The value to check.
11
- * @returns {boolean} Returns `true` if `value` is an array, else `false`.
12
- * @example
13
- *
14
- * _.isArray([1, 2, 3]);
15
- * // => true
16
- *
17
- * _.isArray(document.body.children);
18
- * // => false
19
- *
20
- * _.isArray('abc');
21
- * // => false
22
- *
23
- * _.isArray(_.noop);
24
- * // => false
25
- */
26
- var isArray = Array.isArray;
27
-
28
- var isArray$1 = isArray;
29
-
30
- /** `Object#toString` result references. */
31
- var asyncTag = '[object AsyncFunction]',
32
- funcTag$2 = '[object Function]',
33
- genTag$1 = '[object GeneratorFunction]',
34
- proxyTag = '[object Proxy]';
35
-
36
- /**
37
- * Checks if `value` is classified as a `Function` object.
38
- *
39
- * @static
40
- * @memberOf _
41
- * @since 0.1.0
42
- * @category Lang
43
- * @param {*} value The value to check.
44
- * @returns {boolean} Returns `true` if `value` is a function, else `false`.
45
- * @example
46
- *
47
- * _.isFunction(_);
48
- * // => true
49
- *
50
- * _.isFunction(/abc/);
51
- * // => false
52
- */
53
- function isFunction(value) {
54
- if (!isObject(value)) {
55
- return false;
56
- }
57
- // The use of `Object#toString` avoids issues with the `typeof` operator
58
- // in Safari 9 which returns 'object' for typed arrays and other constructors.
59
- var tag = baseGetTag(value);
60
- return tag == funcTag$2 || tag == genTag$1 || tag == asyncTag || tag == proxyTag;
61
- }
62
-
63
- /** Used to detect overreaching core-js shims. */
64
- var coreJsData = root['__core-js_shared__'];
65
-
66
- /** Used to detect methods masquerading as native. */
67
- var maskSrcKey = (function() {
68
- var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
69
- return uid ? ('Symbol(src)_1.' + uid) : '';
70
- }());
71
-
72
- /**
73
- * Checks if `func` has its source masked.
74
- *
75
- * @private
76
- * @param {Function} func The function to check.
77
- * @returns {boolean} Returns `true` if `func` is masked, else `false`.
78
- */
79
- function isMasked(func) {
80
- return !!maskSrcKey && (maskSrcKey in func);
81
- }
82
-
83
- /** Used for built-in method references. */
84
- var funcProto$1 = Function.prototype;
85
-
86
- /** Used to resolve the decompiled source of functions. */
87
- var funcToString$1 = funcProto$1.toString;
88
-
89
- /**
90
- * Converts `func` to its source code.
91
- *
92
- * @private
93
- * @param {Function} func The function to convert.
94
- * @returns {string} Returns the source code.
95
- */
96
- function toSource(func) {
97
- if (func != null) {
98
- try {
99
- return funcToString$1.call(func);
100
- } catch (e) {}
101
- try {
102
- return (func + '');
103
- } catch (e) {}
104
- }
105
- return '';
106
- }
107
-
108
- /**
109
- * Used to match `RegExp`
110
- * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
111
- */
112
- var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
113
-
114
- /** Used to detect host constructors (Safari). */
115
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
116
-
117
- /** Used for built-in method references. */
118
- var funcProto = Function.prototype,
119
- objectProto$a = Object.prototype;
120
-
121
- /** Used to resolve the decompiled source of functions. */
122
- var funcToString = funcProto.toString;
123
-
124
- /** Used to check objects for own properties. */
125
- var hasOwnProperty$8 = objectProto$a.hasOwnProperty;
126
-
127
- /** Used to detect if a method is native. */
128
- var reIsNative = RegExp('^' +
129
- funcToString.call(hasOwnProperty$8).replace(reRegExpChar, '\\$&')
130
- .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
131
- );
132
-
133
- /**
134
- * The base implementation of `_.isNative` without bad shim checks.
135
- *
136
- * @private
137
- * @param {*} value The value to check.
138
- * @returns {boolean} Returns `true` if `value` is a native function,
139
- * else `false`.
140
- */
141
- function baseIsNative(value) {
142
- if (!isObject(value) || isMasked(value)) {
143
- return false;
144
- }
145
- var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
146
- return pattern.test(toSource(value));
147
- }
148
-
149
- /**
150
- * Gets the value at `key` of `object`.
151
- *
152
- * @private
153
- * @param {Object} [object] The object to query.
154
- * @param {string} key The key of the property to get.
155
- * @returns {*} Returns the property value.
156
- */
157
- function getValue(object, key) {
158
- return object == null ? undefined : object[key];
159
- }
160
-
161
- /**
162
- * Gets the native function at `key` of `object`.
163
- *
164
- * @private
165
- * @param {Object} object The object to query.
166
- * @param {string} key The key of the method to get.
167
- * @returns {*} Returns the function if it's native, else `undefined`.
168
- */
169
- function getNative(object, key) {
170
- var value = getValue(object, key);
171
- return baseIsNative(value) ? value : undefined;
172
- }
173
-
174
- /* Built-in method references that are verified to be native. */
175
- var WeakMap = getNative(root, 'WeakMap');
176
-
177
- /** Built-in value references. */
178
- var objectCreate = Object.create;
179
-
180
- /**
181
- * The base implementation of `_.create` without support for assigning
182
- * properties to the created object.
183
- *
184
- * @private
185
- * @param {Object} proto The object to inherit from.
186
- * @returns {Object} Returns the new object.
187
- */
188
- var baseCreate = (function() {
189
- function object() {}
190
- return function(proto) {
191
- if (!isObject(proto)) {
192
- return {};
193
- }
194
- if (objectCreate) {
195
- return objectCreate(proto);
196
- }
197
- object.prototype = proto;
198
- var result = new object;
199
- object.prototype = undefined;
200
- return result;
201
- };
202
- }());
203
-
204
- /**
205
- * Copies the values of `source` to `array`.
206
- *
207
- * @private
208
- * @param {Array} source The array to copy values from.
209
- * @param {Array} [array=[]] The array to copy values to.
210
- * @returns {Array} Returns `array`.
211
- */
212
- function copyArray(source, array) {
213
- var index = -1,
214
- length = source.length;
215
-
216
- array || (array = Array(length));
217
- while (++index < length) {
218
- array[index] = source[index];
219
- }
220
- return array;
221
- }
222
-
223
- var defineProperty = (function() {
224
- try {
225
- var func = getNative(Object, 'defineProperty');
226
- func({}, '', {});
227
- return func;
228
- } catch (e) {}
229
- }());
230
-
231
- /**
232
- * A specialized version of `_.forEach` for arrays without support for
233
- * iteratee shorthands.
234
- *
235
- * @private
236
- * @param {Array} [array] The array to iterate over.
237
- * @param {Function} iteratee The function invoked per iteration.
238
- * @returns {Array} Returns `array`.
239
- */
240
- function arrayEach(array, iteratee) {
241
- var index = -1,
242
- length = array == null ? 0 : array.length;
243
-
244
- while (++index < length) {
245
- if (iteratee(array[index], index, array) === false) {
246
- break;
247
- }
248
- }
249
- return array;
250
- }
251
-
252
- /** Used as references for various `Number` constants. */
253
- var MAX_SAFE_INTEGER$1 = 9007199254740991;
254
-
255
- /** Used to detect unsigned integer values. */
256
- var reIsUint = /^(?:0|[1-9]\d*)$/;
257
-
258
- /**
259
- * Checks if `value` is a valid array-like index.
260
- *
261
- * @private
262
- * @param {*} value The value to check.
263
- * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
264
- * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
265
- */
266
- function isIndex(value, length) {
267
- var type = typeof value;
268
- length = length == null ? MAX_SAFE_INTEGER$1 : length;
269
-
270
- return !!length &&
271
- (type == 'number' ||
272
- (type != 'symbol' && reIsUint.test(value))) &&
273
- (value > -1 && value % 1 == 0 && value < length);
274
- }
275
-
276
- /**
277
- * The base implementation of `assignValue` and `assignMergeValue` without
278
- * value checks.
279
- *
280
- * @private
281
- * @param {Object} object The object to modify.
282
- * @param {string} key The key of the property to assign.
283
- * @param {*} value The value to assign.
284
- */
285
- function baseAssignValue(object, key, value) {
286
- if (key == '__proto__' && defineProperty) {
287
- defineProperty(object, key, {
288
- 'configurable': true,
289
- 'enumerable': true,
290
- 'value': value,
291
- 'writable': true
292
- });
293
- } else {
294
- object[key] = value;
295
- }
296
- }
297
-
298
- /**
299
- * Performs a
300
- * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
301
- * comparison between two values to determine if they are equivalent.
302
- *
303
- * @static
304
- * @memberOf _
305
- * @since 4.0.0
306
- * @category Lang
307
- * @param {*} value The value to compare.
308
- * @param {*} other The other value to compare.
309
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
310
- * @example
311
- *
312
- * var object = { 'a': 1 };
313
- * var other = { 'a': 1 };
314
- *
315
- * _.eq(object, object);
316
- * // => true
317
- *
318
- * _.eq(object, other);
319
- * // => false
320
- *
321
- * _.eq('a', 'a');
322
- * // => true
323
- *
324
- * _.eq('a', Object('a'));
325
- * // => false
326
- *
327
- * _.eq(NaN, NaN);
328
- * // => true
329
- */
330
- function eq(value, other) {
331
- return value === other || (value !== value && other !== other);
332
- }
333
-
334
- /** Used for built-in method references. */
335
- var objectProto$9 = Object.prototype;
336
-
337
- /** Used to check objects for own properties. */
338
- var hasOwnProperty$7 = objectProto$9.hasOwnProperty;
339
-
340
- /**
341
- * Assigns `value` to `key` of `object` if the existing value is not equivalent
342
- * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
343
- * for equality comparisons.
344
- *
345
- * @private
346
- * @param {Object} object The object to modify.
347
- * @param {string} key The key of the property to assign.
348
- * @param {*} value The value to assign.
349
- */
350
- function assignValue(object, key, value) {
351
- var objValue = object[key];
352
- if (!(hasOwnProperty$7.call(object, key) && eq(objValue, value)) ||
353
- (value === undefined && !(key in object))) {
354
- baseAssignValue(object, key, value);
355
- }
356
- }
357
-
358
- /**
359
- * Copies properties of `source` to `object`.
360
- *
361
- * @private
362
- * @param {Object} source The object to copy properties from.
363
- * @param {Array} props The property identifiers to copy.
364
- * @param {Object} [object={}] The object to copy properties to.
365
- * @param {Function} [customizer] The function to customize copied values.
366
- * @returns {Object} Returns `object`.
367
- */
368
- function copyObject(source, props, object, customizer) {
369
- var isNew = !object;
370
- object || (object = {});
371
-
372
- var index = -1,
373
- length = props.length;
374
-
375
- while (++index < length) {
376
- var key = props[index];
377
-
378
- var newValue = undefined;
379
-
380
- if (newValue === undefined) {
381
- newValue = source[key];
382
- }
383
- if (isNew) {
384
- baseAssignValue(object, key, newValue);
385
- } else {
386
- assignValue(object, key, newValue);
387
- }
388
- }
389
- return object;
390
- }
391
-
392
- /** Used as references for various `Number` constants. */
393
- var MAX_SAFE_INTEGER = 9007199254740991;
394
-
395
- /**
396
- * Checks if `value` is a valid array-like length.
397
- *
398
- * **Note:** This method is loosely based on
399
- * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
400
- *
401
- * @static
402
- * @memberOf _
403
- * @since 4.0.0
404
- * @category Lang
405
- * @param {*} value The value to check.
406
- * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
407
- * @example
408
- *
409
- * _.isLength(3);
410
- * // => true
411
- *
412
- * _.isLength(Number.MIN_VALUE);
413
- * // => false
414
- *
415
- * _.isLength(Infinity);
416
- * // => false
417
- *
418
- * _.isLength('3');
419
- * // => false
420
- */
421
- function isLength(value) {
422
- return typeof value == 'number' &&
423
- value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
424
- }
425
-
426
- /**
427
- * Checks if `value` is array-like. A value is considered array-like if it's
428
- * not a function and has a `value.length` that's an integer greater than or
429
- * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
430
- *
431
- * @static
432
- * @memberOf _
433
- * @since 4.0.0
434
- * @category Lang
435
- * @param {*} value The value to check.
436
- * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
437
- * @example
438
- *
439
- * _.isArrayLike([1, 2, 3]);
440
- * // => true
441
- *
442
- * _.isArrayLike(document.body.children);
443
- * // => true
444
- *
445
- * _.isArrayLike('abc');
446
- * // => true
447
- *
448
- * _.isArrayLike(_.noop);
449
- * // => false
450
- */
451
- function isArrayLike(value) {
452
- return value != null && isLength(value.length) && !isFunction(value);
453
- }
454
-
455
- /** Used for built-in method references. */
456
- var objectProto$8 = Object.prototype;
457
-
458
- /**
459
- * Checks if `value` is likely a prototype object.
460
- *
461
- * @private
462
- * @param {*} value The value to check.
463
- * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
464
- */
465
- function isPrototype(value) {
466
- var Ctor = value && value.constructor,
467
- proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$8;
468
-
469
- return value === proto;
470
- }
471
-
472
- /**
473
- * The base implementation of `_.times` without support for iteratee shorthands
474
- * or max array length checks.
475
- *
476
- * @private
477
- * @param {number} n The number of times to invoke `iteratee`.
478
- * @param {Function} iteratee The function invoked per iteration.
479
- * @returns {Array} Returns the array of results.
480
- */
481
- function baseTimes(n, iteratee) {
482
- var index = -1,
483
- result = Array(n);
484
-
485
- while (++index < n) {
486
- result[index] = iteratee(index);
487
- }
488
- return result;
489
- }
490
-
491
- /** `Object#toString` result references. */
492
- var argsTag$2 = '[object Arguments]';
493
-
494
- /**
495
- * The base implementation of `_.isArguments`.
496
- *
497
- * @private
498
- * @param {*} value The value to check.
499
- * @returns {boolean} Returns `true` if `value` is an `arguments` object,
500
- */
501
- function baseIsArguments(value) {
502
- return isObjectLike(value) && baseGetTag(value) == argsTag$2;
503
- }
504
-
505
- /** Used for built-in method references. */
506
- var objectProto$7 = Object.prototype;
507
-
508
- /** Used to check objects for own properties. */
509
- var hasOwnProperty$6 = objectProto$7.hasOwnProperty;
510
-
511
- /** Built-in value references. */
512
- var propertyIsEnumerable$1 = objectProto$7.propertyIsEnumerable;
513
-
514
- /**
515
- * Checks if `value` is likely an `arguments` object.
516
- *
517
- * @static
518
- * @memberOf _
519
- * @since 0.1.0
520
- * @category Lang
521
- * @param {*} value The value to check.
522
- * @returns {boolean} Returns `true` if `value` is an `arguments` object,
523
- * else `false`.
524
- * @example
525
- *
526
- * _.isArguments(function() { return arguments; }());
527
- * // => true
528
- *
529
- * _.isArguments([1, 2, 3]);
530
- * // => false
531
- */
532
- var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
533
- return isObjectLike(value) && hasOwnProperty$6.call(value, 'callee') &&
534
- !propertyIsEnumerable$1.call(value, 'callee');
535
- };
536
-
537
- /**
538
- * This method returns `false`.
539
- *
540
- * @static
541
- * @memberOf _
542
- * @since 4.13.0
543
- * @category Util
544
- * @returns {boolean} Returns `false`.
545
- * @example
546
- *
547
- * _.times(2, _.stubFalse);
548
- * // => [false, false]
549
- */
550
- function stubFalse() {
551
- return false;
552
- }
553
-
554
- /** Detect free variable `exports`. */
555
- var freeExports$2 = typeof exports == 'object' && exports && !exports.nodeType && exports;
556
-
557
- /** Detect free variable `module`. */
558
- var freeModule$2 = freeExports$2 && typeof module == 'object' && module && !module.nodeType && module;
559
-
560
- /** Detect the popular CommonJS extension `module.exports`. */
561
- var moduleExports$2 = freeModule$2 && freeModule$2.exports === freeExports$2;
562
-
563
- /** Built-in value references. */
564
- var Buffer$1 = moduleExports$2 ? root.Buffer : undefined;
565
-
566
- /* Built-in method references for those with the same name as other `lodash` methods. */
567
- var nativeIsBuffer = Buffer$1 ? Buffer$1.isBuffer : undefined;
568
-
569
- /**
570
- * Checks if `value` is a buffer.
571
- *
572
- * @static
573
- * @memberOf _
574
- * @since 4.3.0
575
- * @category Lang
576
- * @param {*} value The value to check.
577
- * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
578
- * @example
579
- *
580
- * _.isBuffer(new Buffer(2));
581
- * // => true
582
- *
583
- * _.isBuffer(new Uint8Array(2));
584
- * // => false
585
- */
586
- var isBuffer = nativeIsBuffer || stubFalse;
587
-
588
- /** `Object#toString` result references. */
589
- var argsTag$1 = '[object Arguments]',
590
- arrayTag$1 = '[object Array]',
591
- boolTag$2 = '[object Boolean]',
592
- dateTag$2 = '[object Date]',
593
- errorTag$1 = '[object Error]',
594
- funcTag$1 = '[object Function]',
595
- mapTag$4 = '[object Map]',
596
- numberTag$2 = '[object Number]',
597
- objectTag$2 = '[object Object]',
598
- regexpTag$2 = '[object RegExp]',
599
- setTag$4 = '[object Set]',
600
- stringTag$2 = '[object String]',
601
- weakMapTag$2 = '[object WeakMap]';
602
-
603
- var arrayBufferTag$2 = '[object ArrayBuffer]',
604
- dataViewTag$3 = '[object DataView]',
605
- float32Tag$2 = '[object Float32Array]',
606
- float64Tag$2 = '[object Float64Array]',
607
- int8Tag$2 = '[object Int8Array]',
608
- int16Tag$2 = '[object Int16Array]',
609
- int32Tag$2 = '[object Int32Array]',
610
- uint8Tag$2 = '[object Uint8Array]',
611
- uint8ClampedTag$2 = '[object Uint8ClampedArray]',
612
- uint16Tag$2 = '[object Uint16Array]',
613
- uint32Tag$2 = '[object Uint32Array]';
614
-
615
- /** Used to identify `toStringTag` values of typed arrays. */
616
- var typedArrayTags = {};
617
- typedArrayTags[float32Tag$2] = typedArrayTags[float64Tag$2] =
618
- typedArrayTags[int8Tag$2] = typedArrayTags[int16Tag$2] =
619
- typedArrayTags[int32Tag$2] = typedArrayTags[uint8Tag$2] =
620
- typedArrayTags[uint8ClampedTag$2] = typedArrayTags[uint16Tag$2] =
621
- typedArrayTags[uint32Tag$2] = true;
622
- typedArrayTags[argsTag$1] = typedArrayTags[arrayTag$1] =
623
- typedArrayTags[arrayBufferTag$2] = typedArrayTags[boolTag$2] =
624
- typedArrayTags[dataViewTag$3] = typedArrayTags[dateTag$2] =
625
- typedArrayTags[errorTag$1] = typedArrayTags[funcTag$1] =
626
- typedArrayTags[mapTag$4] = typedArrayTags[numberTag$2] =
627
- typedArrayTags[objectTag$2] = typedArrayTags[regexpTag$2] =
628
- typedArrayTags[setTag$4] = typedArrayTags[stringTag$2] =
629
- typedArrayTags[weakMapTag$2] = false;
630
-
631
- /**
632
- * The base implementation of `_.isTypedArray` without Node.js optimizations.
633
- *
634
- * @private
635
- * @param {*} value The value to check.
636
- * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
637
- */
638
- function baseIsTypedArray(value) {
639
- return isObjectLike(value) &&
640
- isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
641
- }
642
-
643
- /**
644
- * The base implementation of `_.unary` without support for storing metadata.
645
- *
646
- * @private
647
- * @param {Function} func The function to cap arguments for.
648
- * @returns {Function} Returns the new capped function.
649
- */
650
- function baseUnary(func) {
651
- return function(value) {
652
- return func(value);
653
- };
654
- }
655
-
656
- /** Detect free variable `exports`. */
657
- var freeExports$1 = typeof exports == 'object' && exports && !exports.nodeType && exports;
658
-
659
- /** Detect free variable `module`. */
660
- var freeModule$1 = freeExports$1 && typeof module == 'object' && module && !module.nodeType && module;
661
-
662
- /** Detect the popular CommonJS extension `module.exports`. */
663
- var moduleExports$1 = freeModule$1 && freeModule$1.exports === freeExports$1;
664
-
665
- /** Detect free variable `process` from Node.js. */
666
- var freeProcess = moduleExports$1 && freeGlobal.process;
667
-
668
- /** Used to access faster Node.js helpers. */
669
- var nodeUtil = (function() {
670
- try {
671
- // Use `util.types` for Node.js 10+.
672
- var types = freeModule$1 && freeModule$1.require && freeModule$1.require('util').types;
673
-
674
- if (types) {
675
- return types;
676
- }
677
-
678
- // Legacy `process.binding('util')` for Node.js < 10.
679
- return freeProcess && freeProcess.binding && freeProcess.binding('util');
680
- } catch (e) {}
681
- }());
682
-
683
- /* Node.js helper references. */
684
- var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
685
-
686
- /**
687
- * Checks if `value` is classified as a typed array.
688
- *
689
- * @static
690
- * @memberOf _
691
- * @since 3.0.0
692
- * @category Lang
693
- * @param {*} value The value to check.
694
- * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
695
- * @example
696
- *
697
- * _.isTypedArray(new Uint8Array);
698
- * // => true
699
- *
700
- * _.isTypedArray([]);
701
- * // => false
702
- */
703
- var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
704
-
705
- /** Used for built-in method references. */
706
- var objectProto$6 = Object.prototype;
707
-
708
- /** Used to check objects for own properties. */
709
- var hasOwnProperty$5 = objectProto$6.hasOwnProperty;
710
-
711
- /**
712
- * Creates an array of the enumerable property names of the array-like `value`.
713
- *
714
- * @private
715
- * @param {*} value The value to query.
716
- * @param {boolean} inherited Specify returning inherited property names.
717
- * @returns {Array} Returns the array of property names.
718
- */
719
- function arrayLikeKeys(value, inherited) {
720
- var isArr = isArray$1(value),
721
- isArg = !isArr && isArguments(value),
722
- isBuff = !isArr && !isArg && isBuffer(value),
723
- isType = !isArr && !isArg && !isBuff && isTypedArray(value),
724
- skipIndexes = isArr || isArg || isBuff || isType,
725
- result = skipIndexes ? baseTimes(value.length, String) : [],
726
- length = result.length;
727
-
728
- for (var key in value) {
729
- if ((inherited || hasOwnProperty$5.call(value, key)) &&
730
- !(skipIndexes && (
731
- // Safari 9 has enumerable `arguments.length` in strict mode.
732
- key == 'length' ||
733
- // Node.js 0.10 has enumerable non-index properties on buffers.
734
- (isBuff && (key == 'offset' || key == 'parent')) ||
735
- // PhantomJS 2 has enumerable non-index properties on typed arrays.
736
- (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
737
- // Skip index properties.
738
- isIndex(key, length)
739
- ))) {
740
- result.push(key);
741
- }
742
- }
743
- return result;
744
- }
745
-
746
- /**
747
- * Creates a unary function that invokes `func` with its argument transformed.
748
- *
749
- * @private
750
- * @param {Function} func The function to wrap.
751
- * @param {Function} transform The argument transform.
752
- * @returns {Function} Returns the new function.
753
- */
754
- function overArg(func, transform) {
755
- return function(arg) {
756
- return func(transform(arg));
757
- };
758
- }
759
-
760
- /* Built-in method references for those with the same name as other `lodash` methods. */
761
- var nativeKeys = overArg(Object.keys, Object);
762
-
763
- /** Used for built-in method references. */
764
- var objectProto$5 = Object.prototype;
765
-
766
- /** Used to check objects for own properties. */
767
- var hasOwnProperty$4 = objectProto$5.hasOwnProperty;
768
-
769
- /**
770
- * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
771
- *
772
- * @private
773
- * @param {Object} object The object to query.
774
- * @returns {Array} Returns the array of property names.
775
- */
776
- function baseKeys(object) {
777
- if (!isPrototype(object)) {
778
- return nativeKeys(object);
779
- }
780
- var result = [];
781
- for (var key in Object(object)) {
782
- if (hasOwnProperty$4.call(object, key) && key != 'constructor') {
783
- result.push(key);
784
- }
785
- }
786
- return result;
787
- }
788
-
789
- /**
790
- * Creates an array of the own enumerable property names of `object`.
791
- *
792
- * **Note:** Non-object values are coerced to objects. See the
793
- * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
794
- * for more details.
795
- *
796
- * @static
797
- * @since 0.1.0
798
- * @memberOf _
799
- * @category Object
800
- * @param {Object} object The object to query.
801
- * @returns {Array} Returns the array of property names.
802
- * @example
803
- *
804
- * function Foo() {
805
- * this.a = 1;
806
- * this.b = 2;
807
- * }
808
- *
809
- * Foo.prototype.c = 3;
810
- *
811
- * _.keys(new Foo);
812
- * // => ['a', 'b'] (iteration order is not guaranteed)
813
- *
814
- * _.keys('hi');
815
- * // => ['0', '1']
816
- */
817
- function keys(object) {
818
- return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
819
- }
820
-
821
- /**
822
- * This function is like
823
- * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
824
- * except that it includes inherited enumerable properties.
825
- *
826
- * @private
827
- * @param {Object} object The object to query.
828
- * @returns {Array} Returns the array of property names.
829
- */
830
- function nativeKeysIn(object) {
831
- var result = [];
832
- if (object != null) {
833
- for (var key in Object(object)) {
834
- result.push(key);
835
- }
836
- }
837
- return result;
838
- }
839
-
840
- /** Used for built-in method references. */
841
- var objectProto$4 = Object.prototype;
842
-
843
- /** Used to check objects for own properties. */
844
- var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
845
-
846
- /**
847
- * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
848
- *
849
- * @private
850
- * @param {Object} object The object to query.
851
- * @returns {Array} Returns the array of property names.
852
- */
853
- function baseKeysIn(object) {
854
- if (!isObject(object)) {
855
- return nativeKeysIn(object);
856
- }
857
- var isProto = isPrototype(object),
858
- result = [];
859
-
860
- for (var key in object) {
861
- if (!(key == 'constructor' && (isProto || !hasOwnProperty$3.call(object, key)))) {
862
- result.push(key);
863
- }
864
- }
865
- return result;
866
- }
867
-
868
- /**
869
- * Creates an array of the own and inherited enumerable property names of `object`.
870
- *
871
- * **Note:** Non-object values are coerced to objects.
872
- *
873
- * @static
874
- * @memberOf _
875
- * @since 3.0.0
876
- * @category Object
877
- * @param {Object} object The object to query.
878
- * @returns {Array} Returns the array of property names.
879
- * @example
880
- *
881
- * function Foo() {
882
- * this.a = 1;
883
- * this.b = 2;
884
- * }
885
- *
886
- * Foo.prototype.c = 3;
887
- *
888
- * _.keysIn(new Foo);
889
- * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
890
- */
891
- function keysIn(object) {
892
- return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
893
- }
894
-
895
- /* Built-in method references that are verified to be native. */
896
- var nativeCreate = getNative(Object, 'create');
897
-
898
- /**
899
- * Removes all key-value entries from the hash.
900
- *
901
- * @private
902
- * @name clear
903
- * @memberOf Hash
904
- */
905
- function hashClear() {
906
- this.__data__ = nativeCreate ? nativeCreate(null) : {};
907
- this.size = 0;
908
- }
909
-
910
- /**
911
- * Removes `key` and its value from the hash.
912
- *
913
- * @private
914
- * @name delete
915
- * @memberOf Hash
916
- * @param {Object} hash The hash to modify.
917
- * @param {string} key The key of the value to remove.
918
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
919
- */
920
- function hashDelete(key) {
921
- var result = this.has(key) && delete this.__data__[key];
922
- this.size -= result ? 1 : 0;
923
- return result;
924
- }
925
-
926
- /** Used to stand-in for `undefined` hash values. */
927
- var HASH_UNDEFINED$1 = '__lodash_hash_undefined__';
928
-
929
- /** Used for built-in method references. */
930
- var objectProto$3 = Object.prototype;
931
-
932
- /** Used to check objects for own properties. */
933
- var hasOwnProperty$2 = objectProto$3.hasOwnProperty;
934
-
935
- /**
936
- * Gets the hash value for `key`.
937
- *
938
- * @private
939
- * @name get
940
- * @memberOf Hash
941
- * @param {string} key The key of the value to get.
942
- * @returns {*} Returns the entry value.
943
- */
944
- function hashGet(key) {
945
- var data = this.__data__;
946
- if (nativeCreate) {
947
- var result = data[key];
948
- return result === HASH_UNDEFINED$1 ? undefined : result;
949
- }
950
- return hasOwnProperty$2.call(data, key) ? data[key] : undefined;
951
- }
952
-
953
- /** Used for built-in method references. */
954
- var objectProto$2 = Object.prototype;
955
-
956
- /** Used to check objects for own properties. */
957
- var hasOwnProperty$1 = objectProto$2.hasOwnProperty;
958
-
959
- /**
960
- * Checks if a hash value for `key` exists.
961
- *
962
- * @private
963
- * @name has
964
- * @memberOf Hash
965
- * @param {string} key The key of the entry to check.
966
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
967
- */
968
- function hashHas(key) {
969
- var data = this.__data__;
970
- return nativeCreate ? (data[key] !== undefined) : hasOwnProperty$1.call(data, key);
971
- }
972
-
973
- /** Used to stand-in for `undefined` hash values. */
974
- var HASH_UNDEFINED = '__lodash_hash_undefined__';
975
-
976
- /**
977
- * Sets the hash `key` to `value`.
978
- *
979
- * @private
980
- * @name set
981
- * @memberOf Hash
982
- * @param {string} key The key of the value to set.
983
- * @param {*} value The value to set.
984
- * @returns {Object} Returns the hash instance.
985
- */
986
- function hashSet(key, value) {
987
- var data = this.__data__;
988
- this.size += this.has(key) ? 0 : 1;
989
- data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
990
- return this;
991
- }
992
-
993
- /**
994
- * Creates a hash object.
995
- *
996
- * @private
997
- * @constructor
998
- * @param {Array} [entries] The key-value pairs to cache.
999
- */
1000
- function Hash(entries) {
1001
- var index = -1,
1002
- length = entries == null ? 0 : entries.length;
1003
-
1004
- this.clear();
1005
- while (++index < length) {
1006
- var entry = entries[index];
1007
- this.set(entry[0], entry[1]);
1008
- }
1009
- }
1010
-
1011
- // Add methods to `Hash`.
1012
- Hash.prototype.clear = hashClear;
1013
- Hash.prototype['delete'] = hashDelete;
1014
- Hash.prototype.get = hashGet;
1015
- Hash.prototype.has = hashHas;
1016
- Hash.prototype.set = hashSet;
1017
-
1018
- /**
1019
- * Removes all key-value entries from the list cache.
1020
- *
1021
- * @private
1022
- * @name clear
1023
- * @memberOf ListCache
1024
- */
1025
- function listCacheClear() {
1026
- this.__data__ = [];
1027
- this.size = 0;
1028
- }
1029
-
1030
- /**
1031
- * Gets the index at which the `key` is found in `array` of key-value pairs.
1032
- *
1033
- * @private
1034
- * @param {Array} array The array to inspect.
1035
- * @param {*} key The key to search for.
1036
- * @returns {number} Returns the index of the matched value, else `-1`.
1037
- */
1038
- function assocIndexOf(array, key) {
1039
- var length = array.length;
1040
- while (length--) {
1041
- if (eq(array[length][0], key)) {
1042
- return length;
1043
- }
1044
- }
1045
- return -1;
1046
- }
1047
-
1048
- /** Used for built-in method references. */
1049
- var arrayProto = Array.prototype;
1050
-
1051
- /** Built-in value references. */
1052
- var splice = arrayProto.splice;
1053
-
1054
- /**
1055
- * Removes `key` and its value from the list cache.
1056
- *
1057
- * @private
1058
- * @name delete
1059
- * @memberOf ListCache
1060
- * @param {string} key The key of the value to remove.
1061
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1062
- */
1063
- function listCacheDelete(key) {
1064
- var data = this.__data__,
1065
- index = assocIndexOf(data, key);
1066
-
1067
- if (index < 0) {
1068
- return false;
1069
- }
1070
- var lastIndex = data.length - 1;
1071
- if (index == lastIndex) {
1072
- data.pop();
1073
- } else {
1074
- splice.call(data, index, 1);
1075
- }
1076
- --this.size;
1077
- return true;
1078
- }
1079
-
1080
- /**
1081
- * Gets the list cache value for `key`.
1082
- *
1083
- * @private
1084
- * @name get
1085
- * @memberOf ListCache
1086
- * @param {string} key The key of the value to get.
1087
- * @returns {*} Returns the entry value.
1088
- */
1089
- function listCacheGet(key) {
1090
- var data = this.__data__,
1091
- index = assocIndexOf(data, key);
1092
-
1093
- return index < 0 ? undefined : data[index][1];
1094
- }
1095
-
1096
- /**
1097
- * Checks if a list cache value for `key` exists.
1098
- *
1099
- * @private
1100
- * @name has
1101
- * @memberOf ListCache
1102
- * @param {string} key The key of the entry to check.
1103
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1104
- */
1105
- function listCacheHas(key) {
1106
- return assocIndexOf(this.__data__, key) > -1;
1107
- }
1108
-
1109
- /**
1110
- * Sets the list cache `key` to `value`.
1111
- *
1112
- * @private
1113
- * @name set
1114
- * @memberOf ListCache
1115
- * @param {string} key The key of the value to set.
1116
- * @param {*} value The value to set.
1117
- * @returns {Object} Returns the list cache instance.
1118
- */
1119
- function listCacheSet(key, value) {
1120
- var data = this.__data__,
1121
- index = assocIndexOf(data, key);
1122
-
1123
- if (index < 0) {
1124
- ++this.size;
1125
- data.push([key, value]);
1126
- } else {
1127
- data[index][1] = value;
1128
- }
1129
- return this;
1130
- }
1131
-
1132
- /**
1133
- * Creates an list cache object.
1134
- *
1135
- * @private
1136
- * @constructor
1137
- * @param {Array} [entries] The key-value pairs to cache.
1138
- */
1139
- function ListCache(entries) {
1140
- var index = -1,
1141
- length = entries == null ? 0 : entries.length;
1142
-
1143
- this.clear();
1144
- while (++index < length) {
1145
- var entry = entries[index];
1146
- this.set(entry[0], entry[1]);
1147
- }
1148
- }
1149
-
1150
- // Add methods to `ListCache`.
1151
- ListCache.prototype.clear = listCacheClear;
1152
- ListCache.prototype['delete'] = listCacheDelete;
1153
- ListCache.prototype.get = listCacheGet;
1154
- ListCache.prototype.has = listCacheHas;
1155
- ListCache.prototype.set = listCacheSet;
1156
-
1157
- /* Built-in method references that are verified to be native. */
1158
- var Map = getNative(root, 'Map');
1159
-
1160
- /**
1161
- * Removes all key-value entries from the map.
1162
- *
1163
- * @private
1164
- * @name clear
1165
- * @memberOf MapCache
1166
- */
1167
- function mapCacheClear() {
1168
- this.size = 0;
1169
- this.__data__ = {
1170
- 'hash': new Hash,
1171
- 'map': new (Map || ListCache),
1172
- 'string': new Hash
1173
- };
1174
- }
1175
-
1176
- /**
1177
- * Checks if `value` is suitable for use as unique object key.
1178
- *
1179
- * @private
1180
- * @param {*} value The value to check.
1181
- * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
1182
- */
1183
- function isKeyable(value) {
1184
- var type = typeof value;
1185
- return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
1186
- ? (value !== '__proto__')
1187
- : (value === null);
1188
- }
1189
-
1190
- /**
1191
- * Gets the data for `map`.
1192
- *
1193
- * @private
1194
- * @param {Object} map The map to query.
1195
- * @param {string} key The reference key.
1196
- * @returns {*} Returns the map data.
1197
- */
1198
- function getMapData(map, key) {
1199
- var data = map.__data__;
1200
- return isKeyable(key)
1201
- ? data[typeof key == 'string' ? 'string' : 'hash']
1202
- : data.map;
1203
- }
1204
-
1205
- /**
1206
- * Removes `key` and its value from the map.
1207
- *
1208
- * @private
1209
- * @name delete
1210
- * @memberOf MapCache
1211
- * @param {string} key The key of the value to remove.
1212
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1213
- */
1214
- function mapCacheDelete(key) {
1215
- var result = getMapData(this, key)['delete'](key);
1216
- this.size -= result ? 1 : 0;
1217
- return result;
1218
- }
1219
-
1220
- /**
1221
- * Gets the map value for `key`.
1222
- *
1223
- * @private
1224
- * @name get
1225
- * @memberOf MapCache
1226
- * @param {string} key The key of the value to get.
1227
- * @returns {*} Returns the entry value.
1228
- */
1229
- function mapCacheGet(key) {
1230
- return getMapData(this, key).get(key);
1231
- }
1232
-
1233
- /**
1234
- * Checks if a map value for `key` exists.
1235
- *
1236
- * @private
1237
- * @name has
1238
- * @memberOf MapCache
1239
- * @param {string} key The key of the entry to check.
1240
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1241
- */
1242
- function mapCacheHas(key) {
1243
- return getMapData(this, key).has(key);
1244
- }
1245
-
1246
- /**
1247
- * Sets the map `key` to `value`.
1248
- *
1249
- * @private
1250
- * @name set
1251
- * @memberOf MapCache
1252
- * @param {string} key The key of the value to set.
1253
- * @param {*} value The value to set.
1254
- * @returns {Object} Returns the map cache instance.
1255
- */
1256
- function mapCacheSet(key, value) {
1257
- var data = getMapData(this, key),
1258
- size = data.size;
1259
-
1260
- data.set(key, value);
1261
- this.size += data.size == size ? 0 : 1;
1262
- return this;
1263
- }
1264
-
1265
- /**
1266
- * Creates a map cache object to store key-value pairs.
1267
- *
1268
- * @private
1269
- * @constructor
1270
- * @param {Array} [entries] The key-value pairs to cache.
1271
- */
1272
- function MapCache(entries) {
1273
- var index = -1,
1274
- length = entries == null ? 0 : entries.length;
1275
-
1276
- this.clear();
1277
- while (++index < length) {
1278
- var entry = entries[index];
1279
- this.set(entry[0], entry[1]);
1280
- }
1281
- }
1282
-
1283
- // Add methods to `MapCache`.
1284
- MapCache.prototype.clear = mapCacheClear;
1285
- MapCache.prototype['delete'] = mapCacheDelete;
1286
- MapCache.prototype.get = mapCacheGet;
1287
- MapCache.prototype.has = mapCacheHas;
1288
- MapCache.prototype.set = mapCacheSet;
1289
-
1290
- /**
1291
- * Appends the elements of `values` to `array`.
1292
- *
1293
- * @private
1294
- * @param {Array} array The array to modify.
1295
- * @param {Array} values The values to append.
1296
- * @returns {Array} Returns `array`.
1297
- */
1298
- function arrayPush(array, values) {
1299
- var index = -1,
1300
- length = values.length,
1301
- offset = array.length;
1302
-
1303
- while (++index < length) {
1304
- array[offset + index] = values[index];
1305
- }
1306
- return array;
1307
- }
1308
-
1309
- /** Built-in value references. */
1310
- var getPrototype = overArg(Object.getPrototypeOf, Object);
1311
-
1312
- /**
1313
- * Removes all key-value entries from the stack.
1314
- *
1315
- * @private
1316
- * @name clear
1317
- * @memberOf Stack
1318
- */
1319
- function stackClear() {
1320
- this.__data__ = new ListCache;
1321
- this.size = 0;
1322
- }
1323
-
1324
- /**
1325
- * Removes `key` and its value from the stack.
1326
- *
1327
- * @private
1328
- * @name delete
1329
- * @memberOf Stack
1330
- * @param {string} key The key of the value to remove.
1331
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1332
- */
1333
- function stackDelete(key) {
1334
- var data = this.__data__,
1335
- result = data['delete'](key);
1336
-
1337
- this.size = data.size;
1338
- return result;
1339
- }
1340
-
1341
- /**
1342
- * Gets the stack value for `key`.
1343
- *
1344
- * @private
1345
- * @name get
1346
- * @memberOf Stack
1347
- * @param {string} key The key of the value to get.
1348
- * @returns {*} Returns the entry value.
1349
- */
1350
- function stackGet(key) {
1351
- return this.__data__.get(key);
1352
- }
1353
-
1354
- /**
1355
- * Checks if a stack value for `key` exists.
1356
- *
1357
- * @private
1358
- * @name has
1359
- * @memberOf Stack
1360
- * @param {string} key The key of the entry to check.
1361
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1362
- */
1363
- function stackHas(key) {
1364
- return this.__data__.has(key);
1365
- }
1366
-
1367
- /** Used as the size to enable large array optimizations. */
1368
- var LARGE_ARRAY_SIZE = 200;
1369
-
1370
- /**
1371
- * Sets the stack `key` to `value`.
1372
- *
1373
- * @private
1374
- * @name set
1375
- * @memberOf Stack
1376
- * @param {string} key The key of the value to set.
1377
- * @param {*} value The value to set.
1378
- * @returns {Object} Returns the stack cache instance.
1379
- */
1380
- function stackSet(key, value) {
1381
- var data = this.__data__;
1382
- if (data instanceof ListCache) {
1383
- var pairs = data.__data__;
1384
- if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
1385
- pairs.push([key, value]);
1386
- this.size = ++data.size;
1387
- return this;
1388
- }
1389
- data = this.__data__ = new MapCache(pairs);
1390
- }
1391
- data.set(key, value);
1392
- this.size = data.size;
1393
- return this;
1394
- }
1395
-
1396
- /**
1397
- * Creates a stack cache object to store key-value pairs.
1398
- *
1399
- * @private
1400
- * @constructor
1401
- * @param {Array} [entries] The key-value pairs to cache.
1402
- */
1403
- function Stack(entries) {
1404
- var data = this.__data__ = new ListCache(entries);
1405
- this.size = data.size;
1406
- }
1407
-
1408
- // Add methods to `Stack`.
1409
- Stack.prototype.clear = stackClear;
1410
- Stack.prototype['delete'] = stackDelete;
1411
- Stack.prototype.get = stackGet;
1412
- Stack.prototype.has = stackHas;
1413
- Stack.prototype.set = stackSet;
1414
-
1415
- /**
1416
- * The base implementation of `_.assign` without support for multiple sources
1417
- * or `customizer` functions.
1418
- *
1419
- * @private
1420
- * @param {Object} object The destination object.
1421
- * @param {Object} source The source object.
1422
- * @returns {Object} Returns `object`.
1423
- */
1424
- function baseAssign(object, source) {
1425
- return object && copyObject(source, keys(source), object);
1426
- }
1427
-
1428
- /**
1429
- * The base implementation of `_.assignIn` without support for multiple sources
1430
- * or `customizer` functions.
1431
- *
1432
- * @private
1433
- * @param {Object} object The destination object.
1434
- * @param {Object} source The source object.
1435
- * @returns {Object} Returns `object`.
1436
- */
1437
- function baseAssignIn(object, source) {
1438
- return object && copyObject(source, keysIn(source), object);
1439
- }
1440
-
1441
- /** Detect free variable `exports`. */
1442
- var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
1443
-
1444
- /** Detect free variable `module`. */
1445
- var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
1446
-
1447
- /** Detect the popular CommonJS extension `module.exports`. */
1448
- var moduleExports = freeModule && freeModule.exports === freeExports;
1449
-
1450
- /** Built-in value references. */
1451
- var Buffer = moduleExports ? root.Buffer : undefined,
1452
- allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;
1453
-
1454
- /**
1455
- * Creates a clone of `buffer`.
1456
- *
1457
- * @private
1458
- * @param {Buffer} buffer The buffer to clone.
1459
- * @param {boolean} [isDeep] Specify a deep clone.
1460
- * @returns {Buffer} Returns the cloned buffer.
1461
- */
1462
- function cloneBuffer(buffer, isDeep) {
1463
- if (isDeep) {
1464
- return buffer.slice();
1465
- }
1466
- var length = buffer.length,
1467
- result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
1468
-
1469
- buffer.copy(result);
1470
- return result;
1471
- }
1472
-
1473
- /**
1474
- * A specialized version of `_.filter` for arrays without support for
1475
- * iteratee shorthands.
1476
- *
1477
- * @private
1478
- * @param {Array} [array] The array to iterate over.
1479
- * @param {Function} predicate The function invoked per iteration.
1480
- * @returns {Array} Returns the new filtered array.
1481
- */
1482
- function arrayFilter(array, predicate) {
1483
- var index = -1,
1484
- length = array == null ? 0 : array.length,
1485
- resIndex = 0,
1486
- result = [];
1487
-
1488
- while (++index < length) {
1489
- var value = array[index];
1490
- if (predicate(value, index, array)) {
1491
- result[resIndex++] = value;
1492
- }
1493
- }
1494
- return result;
1495
- }
1496
-
1497
- /**
1498
- * This method returns a new empty array.
1499
- *
1500
- * @static
1501
- * @memberOf _
1502
- * @since 4.13.0
1503
- * @category Util
1504
- * @returns {Array} Returns the new empty array.
1505
- * @example
1506
- *
1507
- * var arrays = _.times(2, _.stubArray);
1508
- *
1509
- * console.log(arrays);
1510
- * // => [[], []]
1511
- *
1512
- * console.log(arrays[0] === arrays[1]);
1513
- * // => false
1514
- */
1515
- function stubArray() {
1516
- return [];
1517
- }
1518
-
1519
- /** Used for built-in method references. */
1520
- var objectProto$1 = Object.prototype;
1521
-
1522
- /** Built-in value references. */
1523
- var propertyIsEnumerable = objectProto$1.propertyIsEnumerable;
1524
-
1525
- /* Built-in method references for those with the same name as other `lodash` methods. */
1526
- var nativeGetSymbols$1 = Object.getOwnPropertySymbols;
1527
-
1528
- /**
1529
- * Creates an array of the own enumerable symbols of `object`.
1530
- *
1531
- * @private
1532
- * @param {Object} object The object to query.
1533
- * @returns {Array} Returns the array of symbols.
1534
- */
1535
- var getSymbols = !nativeGetSymbols$1 ? stubArray : function(object) {
1536
- if (object == null) {
1537
- return [];
1538
- }
1539
- object = Object(object);
1540
- return arrayFilter(nativeGetSymbols$1(object), function(symbol) {
1541
- return propertyIsEnumerable.call(object, symbol);
1542
- });
1543
- };
1544
-
1545
- /**
1546
- * Copies own symbols of `source` to `object`.
1547
- *
1548
- * @private
1549
- * @param {Object} source The object to copy symbols from.
1550
- * @param {Object} [object={}] The object to copy symbols to.
1551
- * @returns {Object} Returns `object`.
1552
- */
1553
- function copySymbols(source, object) {
1554
- return copyObject(source, getSymbols(source), object);
1555
- }
1556
-
1557
- /* Built-in method references for those with the same name as other `lodash` methods. */
1558
- var nativeGetSymbols = Object.getOwnPropertySymbols;
1559
-
1560
- /**
1561
- * Creates an array of the own and inherited enumerable symbols of `object`.
1562
- *
1563
- * @private
1564
- * @param {Object} object The object to query.
1565
- * @returns {Array} Returns the array of symbols.
1566
- */
1567
- var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
1568
- var result = [];
1569
- while (object) {
1570
- arrayPush(result, getSymbols(object));
1571
- object = getPrototype(object);
1572
- }
1573
- return result;
1574
- };
1575
-
1576
- /**
1577
- * Copies own and inherited symbols of `source` to `object`.
1578
- *
1579
- * @private
1580
- * @param {Object} source The object to copy symbols from.
1581
- * @param {Object} [object={}] The object to copy symbols to.
1582
- * @returns {Object} Returns `object`.
1583
- */
1584
- function copySymbolsIn(source, object) {
1585
- return copyObject(source, getSymbolsIn(source), object);
1586
- }
1587
-
1588
- /**
1589
- * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
1590
- * `keysFunc` and `symbolsFunc` to get the enumerable property names and
1591
- * symbols of `object`.
1592
- *
1593
- * @private
1594
- * @param {Object} object The object to query.
1595
- * @param {Function} keysFunc The function to get the keys of `object`.
1596
- * @param {Function} symbolsFunc The function to get the symbols of `object`.
1597
- * @returns {Array} Returns the array of property names and symbols.
1598
- */
1599
- function baseGetAllKeys(object, keysFunc, symbolsFunc) {
1600
- var result = keysFunc(object);
1601
- return isArray$1(object) ? result : arrayPush(result, symbolsFunc(object));
1602
- }
1603
-
1604
- /**
1605
- * Creates an array of own enumerable property names and symbols of `object`.
1606
- *
1607
- * @private
1608
- * @param {Object} object The object to query.
1609
- * @returns {Array} Returns the array of property names and symbols.
1610
- */
1611
- function getAllKeys(object) {
1612
- return baseGetAllKeys(object, keys, getSymbols);
1613
- }
1614
-
1615
- /**
1616
- * Creates an array of own and inherited enumerable property names and
1617
- * symbols of `object`.
1618
- *
1619
- * @private
1620
- * @param {Object} object The object to query.
1621
- * @returns {Array} Returns the array of property names and symbols.
1622
- */
1623
- function getAllKeysIn(object) {
1624
- return baseGetAllKeys(object, keysIn, getSymbolsIn);
1625
- }
1626
-
1627
- /* Built-in method references that are verified to be native. */
1628
- var DataView = getNative(root, 'DataView');
1629
-
1630
- /* Built-in method references that are verified to be native. */
1631
- var Promise$1 = getNative(root, 'Promise');
1632
-
1633
- /* Built-in method references that are verified to be native. */
1634
- var Set = getNative(root, 'Set');
1635
-
1636
- /** `Object#toString` result references. */
1637
- var mapTag$3 = '[object Map]',
1638
- objectTag$1 = '[object Object]',
1639
- promiseTag = '[object Promise]',
1640
- setTag$3 = '[object Set]',
1641
- weakMapTag$1 = '[object WeakMap]';
1642
-
1643
- var dataViewTag$2 = '[object DataView]';
1644
-
1645
- /** Used to detect maps, sets, and weakmaps. */
1646
- var dataViewCtorString = toSource(DataView),
1647
- mapCtorString = toSource(Map),
1648
- promiseCtorString = toSource(Promise$1),
1649
- setCtorString = toSource(Set),
1650
- weakMapCtorString = toSource(WeakMap);
1651
-
1652
- /**
1653
- * Gets the `toStringTag` of `value`.
1654
- *
1655
- * @private
1656
- * @param {*} value The value to query.
1657
- * @returns {string} Returns the `toStringTag`.
1658
- */
1659
- var getTag = baseGetTag;
1660
-
1661
- // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
1662
- if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag$2) ||
1663
- (Map && getTag(new Map) != mapTag$3) ||
1664
- (Promise$1 && getTag(Promise$1.resolve()) != promiseTag) ||
1665
- (Set && getTag(new Set) != setTag$3) ||
1666
- (WeakMap && getTag(new WeakMap) != weakMapTag$1)) {
1667
- getTag = function(value) {
1668
- var result = baseGetTag(value),
1669
- Ctor = result == objectTag$1 ? value.constructor : undefined,
1670
- ctorString = Ctor ? toSource(Ctor) : '';
1671
-
1672
- if (ctorString) {
1673
- switch (ctorString) {
1674
- case dataViewCtorString: return dataViewTag$2;
1675
- case mapCtorString: return mapTag$3;
1676
- case promiseCtorString: return promiseTag;
1677
- case setCtorString: return setTag$3;
1678
- case weakMapCtorString: return weakMapTag$1;
1679
- }
1680
- }
1681
- return result;
1682
- };
1683
- }
1684
-
1685
- var getTag$1 = getTag;
1686
-
1687
- /** Used for built-in method references. */
1688
- var objectProto = Object.prototype;
1689
-
1690
- /** Used to check objects for own properties. */
1691
- var hasOwnProperty = objectProto.hasOwnProperty;
1692
-
1693
- /**
1694
- * Initializes an array clone.
1695
- *
1696
- * @private
1697
- * @param {Array} array The array to clone.
1698
- * @returns {Array} Returns the initialized clone.
1699
- */
1700
- function initCloneArray(array) {
1701
- var length = array.length,
1702
- result = new array.constructor(length);
1703
-
1704
- // Add properties assigned by `RegExp#exec`.
1705
- if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
1706
- result.index = array.index;
1707
- result.input = array.input;
1708
- }
1709
- return result;
1710
- }
1711
-
1712
- /** Built-in value references. */
1713
- var Uint8Array = root.Uint8Array;
1714
-
1715
- /**
1716
- * Creates a clone of `arrayBuffer`.
1717
- *
1718
- * @private
1719
- * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
1720
- * @returns {ArrayBuffer} Returns the cloned array buffer.
1721
- */
1722
- function cloneArrayBuffer(arrayBuffer) {
1723
- var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
1724
- new Uint8Array(result).set(new Uint8Array(arrayBuffer));
1725
- return result;
1726
- }
1727
-
1728
- /**
1729
- * Creates a clone of `dataView`.
1730
- *
1731
- * @private
1732
- * @param {Object} dataView The data view to clone.
1733
- * @param {boolean} [isDeep] Specify a deep clone.
1734
- * @returns {Object} Returns the cloned data view.
1735
- */
1736
- function cloneDataView(dataView, isDeep) {
1737
- var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
1738
- return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
1739
- }
1740
-
1741
- /** Used to match `RegExp` flags from their coerced string values. */
1742
- var reFlags = /\w*$/;
1743
-
1744
- /**
1745
- * Creates a clone of `regexp`.
1746
- *
1747
- * @private
1748
- * @param {Object} regexp The regexp to clone.
1749
- * @returns {Object} Returns the cloned regexp.
1750
- */
1751
- function cloneRegExp(regexp) {
1752
- var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
1753
- result.lastIndex = regexp.lastIndex;
1754
- return result;
1755
- }
1756
-
1757
- /** Used to convert symbols to primitives and strings. */
1758
- var symbolProto = Symbol ? Symbol.prototype : undefined,
1759
- symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
1760
-
1761
- /**
1762
- * Creates a clone of the `symbol` object.
1763
- *
1764
- * @private
1765
- * @param {Object} symbol The symbol object to clone.
1766
- * @returns {Object} Returns the cloned symbol object.
1767
- */
1768
- function cloneSymbol(symbol) {
1769
- return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
1770
- }
1771
-
1772
- /**
1773
- * Creates a clone of `typedArray`.
1774
- *
1775
- * @private
1776
- * @param {Object} typedArray The typed array to clone.
1777
- * @param {boolean} [isDeep] Specify a deep clone.
1778
- * @returns {Object} Returns the cloned typed array.
1779
- */
1780
- function cloneTypedArray(typedArray, isDeep) {
1781
- var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
1782
- return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
1783
- }
1784
-
1785
- /** `Object#toString` result references. */
1786
- var boolTag$1 = '[object Boolean]',
1787
- dateTag$1 = '[object Date]',
1788
- mapTag$2 = '[object Map]',
1789
- numberTag$1 = '[object Number]',
1790
- regexpTag$1 = '[object RegExp]',
1791
- setTag$2 = '[object Set]',
1792
- stringTag$1 = '[object String]',
1793
- symbolTag$1 = '[object Symbol]';
1794
-
1795
- var arrayBufferTag$1 = '[object ArrayBuffer]',
1796
- dataViewTag$1 = '[object DataView]',
1797
- float32Tag$1 = '[object Float32Array]',
1798
- float64Tag$1 = '[object Float64Array]',
1799
- int8Tag$1 = '[object Int8Array]',
1800
- int16Tag$1 = '[object Int16Array]',
1801
- int32Tag$1 = '[object Int32Array]',
1802
- uint8Tag$1 = '[object Uint8Array]',
1803
- uint8ClampedTag$1 = '[object Uint8ClampedArray]',
1804
- uint16Tag$1 = '[object Uint16Array]',
1805
- uint32Tag$1 = '[object Uint32Array]';
1806
-
1807
- /**
1808
- * Initializes an object clone based on its `toStringTag`.
1809
- *
1810
- * **Note:** This function only supports cloning values with tags of
1811
- * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
1812
- *
1813
- * @private
1814
- * @param {Object} object The object to clone.
1815
- * @param {string} tag The `toStringTag` of the object to clone.
1816
- * @param {boolean} [isDeep] Specify a deep clone.
1817
- * @returns {Object} Returns the initialized clone.
1818
- */
1819
- function initCloneByTag(object, tag, isDeep) {
1820
- var Ctor = object.constructor;
1821
- switch (tag) {
1822
- case arrayBufferTag$1:
1823
- return cloneArrayBuffer(object);
1824
-
1825
- case boolTag$1:
1826
- case dateTag$1:
1827
- return new Ctor(+object);
1828
-
1829
- case dataViewTag$1:
1830
- return cloneDataView(object, isDeep);
1831
-
1832
- case float32Tag$1: case float64Tag$1:
1833
- case int8Tag$1: case int16Tag$1: case int32Tag$1:
1834
- case uint8Tag$1: case uint8ClampedTag$1: case uint16Tag$1: case uint32Tag$1:
1835
- return cloneTypedArray(object, isDeep);
1836
-
1837
- case mapTag$2:
1838
- return new Ctor;
1839
-
1840
- case numberTag$1:
1841
- case stringTag$1:
1842
- return new Ctor(object);
1843
-
1844
- case regexpTag$1:
1845
- return cloneRegExp(object);
1846
-
1847
- case setTag$2:
1848
- return new Ctor;
1849
-
1850
- case symbolTag$1:
1851
- return cloneSymbol(object);
1852
- }
1853
- }
1854
-
1855
- /**
1856
- * Initializes an object clone.
1857
- *
1858
- * @private
1859
- * @param {Object} object The object to clone.
1860
- * @returns {Object} Returns the initialized clone.
1861
- */
1862
- function initCloneObject(object) {
1863
- return (typeof object.constructor == 'function' && !isPrototype(object))
1864
- ? baseCreate(getPrototype(object))
1865
- : {};
1866
- }
1867
-
1868
- /** `Object#toString` result references. */
1869
- var mapTag$1 = '[object Map]';
1870
-
1871
- /**
1872
- * The base implementation of `_.isMap` without Node.js optimizations.
1873
- *
1874
- * @private
1875
- * @param {*} value The value to check.
1876
- * @returns {boolean} Returns `true` if `value` is a map, else `false`.
1877
- */
1878
- function baseIsMap(value) {
1879
- return isObjectLike(value) && getTag$1(value) == mapTag$1;
1880
- }
1881
-
1882
- /* Node.js helper references. */
1883
- var nodeIsMap = nodeUtil && nodeUtil.isMap;
1884
-
1885
- /**
1886
- * Checks if `value` is classified as a `Map` object.
1887
- *
1888
- * @static
1889
- * @memberOf _
1890
- * @since 4.3.0
1891
- * @category Lang
1892
- * @param {*} value The value to check.
1893
- * @returns {boolean} Returns `true` if `value` is a map, else `false`.
1894
- * @example
1895
- *
1896
- * _.isMap(new Map);
1897
- * // => true
1898
- *
1899
- * _.isMap(new WeakMap);
1900
- * // => false
1901
- */
1902
- var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
1903
-
1904
- /** `Object#toString` result references. */
1905
- var setTag$1 = '[object Set]';
1906
-
1907
- /**
1908
- * The base implementation of `_.isSet` without Node.js optimizations.
1909
- *
1910
- * @private
1911
- * @param {*} value The value to check.
1912
- * @returns {boolean} Returns `true` if `value` is a set, else `false`.
1913
- */
1914
- function baseIsSet(value) {
1915
- return isObjectLike(value) && getTag$1(value) == setTag$1;
1916
- }
1917
-
1918
- /* Node.js helper references. */
1919
- var nodeIsSet = nodeUtil && nodeUtil.isSet;
1920
-
1921
- /**
1922
- * Checks if `value` is classified as a `Set` object.
1923
- *
1924
- * @static
1925
- * @memberOf _
1926
- * @since 4.3.0
1927
- * @category Lang
1928
- * @param {*} value The value to check.
1929
- * @returns {boolean} Returns `true` if `value` is a set, else `false`.
1930
- * @example
1931
- *
1932
- * _.isSet(new Set);
1933
- * // => true
1934
- *
1935
- * _.isSet(new WeakSet);
1936
- * // => false
1937
- */
1938
- var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
1939
-
1940
- /** Used to compose bitmasks for cloning. */
1941
- var CLONE_DEEP_FLAG$1 = 1,
1942
- CLONE_FLAT_FLAG = 2,
1943
- CLONE_SYMBOLS_FLAG$1 = 4;
1944
-
1945
- /** `Object#toString` result references. */
1946
- var argsTag = '[object Arguments]',
1947
- arrayTag = '[object Array]',
1948
- boolTag = '[object Boolean]',
1949
- dateTag = '[object Date]',
1950
- errorTag = '[object Error]',
1951
- funcTag = '[object Function]',
1952
- genTag = '[object GeneratorFunction]',
1953
- mapTag = '[object Map]',
1954
- numberTag = '[object Number]',
1955
- objectTag = '[object Object]',
1956
- regexpTag = '[object RegExp]',
1957
- setTag = '[object Set]',
1958
- stringTag = '[object String]',
1959
- symbolTag = '[object Symbol]',
1960
- weakMapTag = '[object WeakMap]';
1961
-
1962
- var arrayBufferTag = '[object ArrayBuffer]',
1963
- dataViewTag = '[object DataView]',
1964
- float32Tag = '[object Float32Array]',
1965
- float64Tag = '[object Float64Array]',
1966
- int8Tag = '[object Int8Array]',
1967
- int16Tag = '[object Int16Array]',
1968
- int32Tag = '[object Int32Array]',
1969
- uint8Tag = '[object Uint8Array]',
1970
- uint8ClampedTag = '[object Uint8ClampedArray]',
1971
- uint16Tag = '[object Uint16Array]',
1972
- uint32Tag = '[object Uint32Array]';
1973
-
1974
- /** Used to identify `toStringTag` values supported by `_.clone`. */
1975
- var cloneableTags = {};
1976
- cloneableTags[argsTag] = cloneableTags[arrayTag] =
1977
- cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
1978
- cloneableTags[boolTag] = cloneableTags[dateTag] =
1979
- cloneableTags[float32Tag] = cloneableTags[float64Tag] =
1980
- cloneableTags[int8Tag] = cloneableTags[int16Tag] =
1981
- cloneableTags[int32Tag] = cloneableTags[mapTag] =
1982
- cloneableTags[numberTag] = cloneableTags[objectTag] =
1983
- cloneableTags[regexpTag] = cloneableTags[setTag] =
1984
- cloneableTags[stringTag] = cloneableTags[symbolTag] =
1985
- cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
1986
- cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
1987
- cloneableTags[errorTag] = cloneableTags[funcTag] =
1988
- cloneableTags[weakMapTag] = false;
1989
-
1990
- /**
1991
- * The base implementation of `_.clone` and `_.cloneDeep` which tracks
1992
- * traversed objects.
1993
- *
1994
- * @private
1995
- * @param {*} value The value to clone.
1996
- * @param {boolean} bitmask The bitmask flags.
1997
- * 1 - Deep clone
1998
- * 2 - Flatten inherited properties
1999
- * 4 - Clone symbols
2000
- * @param {Function} [customizer] The function to customize cloning.
2001
- * @param {string} [key] The key of `value`.
2002
- * @param {Object} [object] The parent object of `value`.
2003
- * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
2004
- * @returns {*} Returns the cloned value.
2005
- */
2006
- function baseClone(value, bitmask, customizer, key, object, stack) {
2007
- var result,
2008
- isDeep = bitmask & CLONE_DEEP_FLAG$1,
2009
- isFlat = bitmask & CLONE_FLAT_FLAG,
2010
- isFull = bitmask & CLONE_SYMBOLS_FLAG$1;
2011
- if (result !== undefined) {
2012
- return result;
2013
- }
2014
- if (!isObject(value)) {
2015
- return value;
2016
- }
2017
- var isArr = isArray$1(value);
2018
- if (isArr) {
2019
- result = initCloneArray(value);
2020
- if (!isDeep) {
2021
- return copyArray(value, result);
2022
- }
2023
- } else {
2024
- var tag = getTag$1(value),
2025
- isFunc = tag == funcTag || tag == genTag;
2026
-
2027
- if (isBuffer(value)) {
2028
- return cloneBuffer(value, isDeep);
2029
- }
2030
- if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
2031
- result = (isFlat || isFunc) ? {} : initCloneObject(value);
2032
- if (!isDeep) {
2033
- return isFlat
2034
- ? copySymbolsIn(value, baseAssignIn(result, value))
2035
- : copySymbols(value, baseAssign(result, value));
2036
- }
2037
- } else {
2038
- if (!cloneableTags[tag]) {
2039
- return object ? value : {};
2040
- }
2041
- result = initCloneByTag(value, tag, isDeep);
2042
- }
2043
- }
2044
- // Check for circular references and return its corresponding clone.
2045
- stack || (stack = new Stack);
2046
- var stacked = stack.get(value);
2047
- if (stacked) {
2048
- return stacked;
2049
- }
2050
- stack.set(value, result);
2051
-
2052
- if (isSet(value)) {
2053
- value.forEach(function(subValue) {
2054
- result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
2055
- });
2056
- } else if (isMap(value)) {
2057
- value.forEach(function(subValue, key) {
2058
- result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
2059
- });
2060
- }
2061
-
2062
- var keysFunc = isFull
2063
- ? (isFlat ? getAllKeysIn : getAllKeys)
2064
- : (isFlat ? keysIn : keys);
2065
-
2066
- var props = isArr ? undefined : keysFunc(value);
2067
- arrayEach(props || value, function(subValue, key) {
2068
- if (props) {
2069
- key = subValue;
2070
- subValue = value[key];
2071
- }
2072
- // Recursively populate clone (susceptible to call stack limits).
2073
- assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
2074
- });
2075
- return result;
2076
- }
2077
-
2078
- /** Used to compose bitmasks for cloning. */
2079
- var CLONE_DEEP_FLAG = 1,
2080
- CLONE_SYMBOLS_FLAG = 4;
2081
-
2082
- /**
2083
- * This method is like `_.clone` except that it recursively clones `value`.
2084
- *
2085
- * @static
2086
- * @memberOf _
2087
- * @since 1.0.0
2088
- * @category Lang
2089
- * @param {*} value The value to recursively clone.
2090
- * @returns {*} Returns the deep cloned value.
2091
- * @see _.clone
2092
- * @example
2093
- *
2094
- * var objects = [{ 'a': 1 }, { 'b': 2 }];
2095
- *
2096
- * var deep = _.cloneDeep(objects);
2097
- * console.log(deep[0] === objects[0]);
2098
- * // => false
2099
- */
2100
- function cloneDeep(value) {
2101
- return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
2102
- }
2103
-
2104
- export { cloneDeep as c };