zcw-shared 1.46.2 → 1.47.2

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 (480) hide show
  1. package/dist/functions/async/sleep.d.ts +5 -0
  2. package/dist/functions/async/sleep.js +6 -0
  3. package/dist/functions/async/sleep.js.map +1 -0
  4. package/dist/functions/async/timeout.d.ts +6 -0
  5. package/dist/functions/async/timeout.js +12 -0
  6. package/dist/functions/async/timeout.js.map +1 -0
  7. package/dist/functions/browser/computePosition.d.ts +6 -0
  8. package/dist/functions/browser/computePosition.js +49 -0
  9. package/dist/functions/browser/computePosition.js.map +1 -0
  10. package/dist/functions/browser/createSharedKeyboardCenter.d.ts +18 -0
  11. package/dist/functions/browser/createSharedKeyboardCenter.js +58 -0
  12. package/dist/functions/browser/createSharedKeyboardCenter.js.map +1 -0
  13. package/dist/functions/browser/createThrottledEventListener.d.ts +11 -0
  14. package/dist/functions/browser/createThrottledEventListener.js +51 -0
  15. package/dist/functions/browser/createThrottledEventListener.js.map +1 -0
  16. package/dist/functions/browser/demonstrateResourceLoading.d.ts +32 -0
  17. package/dist/functions/browser/demonstrateResourceLoading.js +169 -0
  18. package/dist/functions/browser/demonstrateResourceLoading.js.map +1 -0
  19. package/dist/functions/browser/detectOverflow.d.ts +12 -0
  20. package/dist/functions/browser/detectOverflow.js +17 -0
  21. package/dist/functions/browser/detectOverflow.js.map +1 -0
  22. package/dist/functions/browser/getAlignment.d.ts +2 -0
  23. package/dist/functions/browser/getAlignment.js +5 -0
  24. package/dist/functions/browser/getAlignment.js.map +1 -0
  25. package/dist/functions/browser/getBasePlacement.d.ts +2 -0
  26. package/dist/functions/browser/getBasePlacement.js +4 -0
  27. package/dist/functions/browser/getBasePlacement.js.map +1 -0
  28. package/dist/functions/browser/getCrossAxisFlip.d.ts +2 -0
  29. package/dist/functions/browser/getCrossAxisFlip.js +11 -0
  30. package/dist/functions/browser/getCrossAxisFlip.js.map +1 -0
  31. package/dist/functions/browser/getElementRect.d.ts +3 -0
  32. package/dist/functions/browser/getElementRect.js +14 -0
  33. package/dist/functions/browser/getElementRect.js.map +1 -0
  34. package/dist/functions/browser/getFlipPlacements.d.ts +2 -0
  35. package/dist/functions/browser/getFlipPlacements.js +13 -0
  36. package/dist/functions/browser/getFlipPlacements.js.map +1 -0
  37. package/dist/functions/browser/getMainAxisFlip.d.ts +2 -0
  38. package/dist/functions/browser/getMainAxisFlip.js +17 -0
  39. package/dist/functions/browser/getMainAxisFlip.js.map +1 -0
  40. package/dist/functions/browser/getRelativePosition.d.ts +3 -0
  41. package/dist/functions/browser/getRelativePosition.js +14 -0
  42. package/dist/functions/browser/getRelativePosition.js.map +1 -0
  43. package/dist/functions/browser/getViewportRect.d.ts +7 -0
  44. package/dist/functions/browser/getViewportRect.js +15 -0
  45. package/dist/functions/browser/getViewportRect.js.map +1 -0
  46. package/dist/functions/browser/isValidPlacement.d.ts +2 -0
  47. package/dist/functions/browser/isValidPlacement.js +16 -0
  48. package/dist/functions/browser/isValidPlacement.js.map +1 -0
  49. package/dist/functions/browser/pickFile.d.ts +15 -0
  50. package/dist/functions/browser/pickFile.js +48 -0
  51. package/dist/functions/browser/pickFile.js.map +1 -0
  52. package/dist/functions/build/generateExports.d.ts +26 -0
  53. package/dist/functions/build/generateExports.js +34 -0
  54. package/dist/functions/build/generateExports.js.map +1 -0
  55. package/dist/functions/core/diff/diff.d.ts +25 -0
  56. package/dist/functions/core/diff/diff.js +316 -0
  57. package/dist/functions/core/diff/diff.js.map +1 -0
  58. package/dist/functions/core/diff/vueDiff.d.ts +38 -0
  59. package/dist/functions/core/diff/vueDiff.js +333 -0
  60. package/dist/functions/core/diff/vueDiff.js.map +1 -0
  61. package/dist/functions/core/generator/generatorUtils.d.ts +16 -0
  62. package/dist/functions/core/generator/generatorUtils.js +139 -0
  63. package/dist/functions/core/generator/generatorUtils.js.map +1 -0
  64. package/dist/functions/core/type/isType.d.ts +11 -0
  65. package/dist/functions/core/type/isType.js +30 -0
  66. package/dist/functions/core/type/isType.js.map +1 -0
  67. package/dist/functions/data/array-object/chunk.d.ts +1 -0
  68. package/dist/functions/data/array-object/chunk.js +11 -0
  69. package/dist/functions/data/array-object/chunk.js.map +1 -0
  70. package/dist/functions/data/array-object/deepClone.d.ts +12 -0
  71. package/dist/functions/data/array-object/deepClone.js +131 -0
  72. package/dist/functions/data/array-object/deepClone.js.map +1 -0
  73. package/dist/functions/data/array-object/evolve.d.ts +3 -0
  74. package/dist/functions/data/array-object/evolve.js +15 -0
  75. package/dist/functions/data/array-object/evolve.js.map +1 -0
  76. package/dist/functions/data/array-object/flatten.d.ts +7 -0
  77. package/dist/functions/data/array-object/flatten.js +60 -0
  78. package/dist/functions/data/array-object/flatten.js.map +1 -0
  79. package/dist/functions/data/array-object/flattenObject.d.ts +5 -0
  80. package/dist/functions/data/array-object/flattenObject.js +102 -0
  81. package/dist/functions/data/array-object/flattenObject.js.map +1 -0
  82. package/dist/functions/data/array-object/groupBy.d.ts +1 -0
  83. package/dist/functions/data/array-object/groupBy.js +14 -0
  84. package/dist/functions/data/array-object/groupBy.js.map +1 -0
  85. package/dist/functions/data/array-object/omit.d.ts +1 -0
  86. package/dist/functions/data/array-object/omit.js +8 -0
  87. package/dist/functions/data/array-object/omit.js.map +1 -0
  88. package/dist/functions/data/array-object/pick.d.ts +1 -0
  89. package/dist/functions/data/array-object/pick.js +10 -0
  90. package/dist/functions/data/array-object/pick.js.map +1 -0
  91. package/dist/functions/data/array-object/shuffle.d.ts +1 -0
  92. package/dist/functions/data/array-object/shuffle.js +9 -0
  93. package/dist/functions/data/array-object/shuffle.js.map +1 -0
  94. package/dist/functions/data/array-object/sortBy.d.ts +1 -0
  95. package/dist/functions/data/array-object/sortBy.js +13 -0
  96. package/dist/functions/data/array-object/sortBy.js.map +1 -0
  97. package/dist/functions/data/array-object/unique.d.ts +10 -0
  98. package/dist/functions/data/array-object/unique.js +85 -0
  99. package/dist/functions/data/array-object/unique.js.map +1 -0
  100. package/dist/functions/data/date/dateRange.d.ts +1 -0
  101. package/dist/functions/data/date/dateRange.js +18 -0
  102. package/dist/functions/data/date/dateRange.js.map +1 -0
  103. package/dist/functions/data/date/formatDate.d.ts +1 -0
  104. package/dist/functions/data/date/formatDate.js +21 -0
  105. package/dist/functions/data/date/formatDate.js.map +1 -0
  106. package/dist/functions/data/date/timeAgo.d.ts +1 -0
  107. package/dist/functions/data/date/timeAgo.js +49 -0
  108. package/dist/functions/data/date/timeAgo.js.map +1 -0
  109. package/dist/functions/data/number/average.d.ts +1 -0
  110. package/dist/functions/data/number/average.js +8 -0
  111. package/dist/functions/data/number/average.js.map +1 -0
  112. package/dist/functions/data/number/clamp.d.ts +1 -0
  113. package/dist/functions/data/number/clamp.js +7 -0
  114. package/dist/functions/data/number/clamp.js.map +1 -0
  115. package/dist/functions/data/number/formatNumber.d.ts +8 -0
  116. package/dist/functions/data/number/formatNumber.js +16 -0
  117. package/dist/functions/data/number/formatNumber.js.map +1 -0
  118. package/dist/functions/data/number/median.d.ts +1 -0
  119. package/dist/functions/data/number/median.js +14 -0
  120. package/dist/functions/data/number/median.js.map +1 -0
  121. package/dist/functions/data/number/percentile.d.ts +1 -0
  122. package/dist/functions/data/number/percentile.js +18 -0
  123. package/dist/functions/data/number/percentile.js.map +1 -0
  124. package/dist/functions/data/number/random.d.ts +4 -0
  125. package/dist/functions/data/number/random.js +9 -0
  126. package/dist/functions/data/number/random.js.map +1 -0
  127. package/dist/functions/data/number/range.d.ts +1 -0
  128. package/dist/functions/data/number/range.js +18 -0
  129. package/dist/functions/data/number/range.js.map +1 -0
  130. package/dist/functions/data/number/sum.d.ts +1 -0
  131. package/dist/functions/data/number/sum.js +4 -0
  132. package/dist/functions/data/number/sum.js.map +1 -0
  133. package/dist/functions/data/randomRegion.d.ts +24 -0
  134. package/dist/functions/data/randomRegion.js +74 -0
  135. package/dist/functions/data/randomRegion.js.map +1 -0
  136. package/dist/functions/data/string/base64.d.ts +5 -0
  137. package/dist/functions/data/string/base64.js +6 -0
  138. package/dist/functions/data/string/base64.js.map +1 -0
  139. package/dist/functions/data/string/capitalize.d.ts +1 -0
  140. package/dist/functions/data/string/capitalize.js +6 -0
  141. package/dist/functions/data/string/capitalize.js.map +1 -0
  142. package/dist/functions/data/string/caseConverter.d.ts +19 -0
  143. package/dist/functions/data/string/caseConverter.js +94 -0
  144. package/dist/functions/data/string/caseConverter.js.map +1 -0
  145. package/dist/functions/data/string/desensitize.d.ts +13 -0
  146. package/dist/functions/data/string/desensitize.js +107 -0
  147. package/dist/functions/data/string/desensitize.js.map +1 -0
  148. package/dist/functions/data/string/htmlEscape.d.ts +20 -0
  149. package/dist/functions/data/string/htmlEscape.js +80 -0
  150. package/dist/functions/data/string/htmlEscape.js.map +1 -0
  151. package/dist/functions/data/string/levenshtein.d.ts +1 -0
  152. package/dist/functions/data/string/levenshtein.js +27 -0
  153. package/dist/functions/data/string/levenshtein.js.map +1 -0
  154. package/dist/functions/data/string/normalize.d.ts +8 -0
  155. package/dist/functions/data/string/normalize.js +37 -0
  156. package/dist/functions/data/string/normalize.js.map +1 -0
  157. package/dist/functions/data/string/pad.d.ts +13 -0
  158. package/dist/functions/data/string/pad.js +50 -0
  159. package/dist/functions/data/string/pad.js.map +1 -0
  160. package/dist/functions/data/string/palindrome.d.ts +3 -0
  161. package/dist/functions/data/string/palindrome.js +15 -0
  162. package/dist/functions/data/string/palindrome.js.map +1 -0
  163. package/dist/functions/data/string/similarity.d.ts +1 -0
  164. package/dist/functions/data/string/similarity.js +13 -0
  165. package/dist/functions/data/string/similarity.js.map +1 -0
  166. package/dist/functions/data/string/template.d.ts +4 -0
  167. package/dist/functions/data/string/template.js +21 -0
  168. package/dist/functions/data/string/template.js.map +1 -0
  169. package/dist/functions/data/string/testRegex.d.ts +20 -0
  170. package/dist/functions/data/string/testRegex.js +300 -0
  171. package/dist/functions/data/string/testRegex.js.map +1 -0
  172. package/dist/functions/data/string/wordCount.d.ts +5 -0
  173. package/dist/functions/data/string/wordCount.js +11 -0
  174. package/dist/functions/data/string/wordCount.js.map +1 -0
  175. package/dist/functions/data/tree/buildTree.d.ts +7 -0
  176. package/dist/functions/data/tree/buildTree.js +27 -0
  177. package/dist/functions/data/tree/buildTree.js.map +1 -0
  178. package/dist/functions/data/tree/filterTree.d.ts +4 -0
  179. package/dist/functions/data/tree/filterTree.js +21 -0
  180. package/dist/functions/data/tree/filterTree.js.map +1 -0
  181. package/dist/functions/data/tree/findNode.d.ts +4 -0
  182. package/dist/functions/data/tree/findNode.js +21 -0
  183. package/dist/functions/data/tree/findNode.js.map +1 -0
  184. package/dist/functions/data/tree/flattenTree.d.ts +6 -0
  185. package/dist/functions/data/tree/flattenTree.js +21 -0
  186. package/dist/functions/data/tree/flattenTree.js.map +1 -0
  187. package/dist/functions/file/walk.d.ts +18 -0
  188. package/dist/functions/file/walk.js +58 -0
  189. package/dist/functions/file/walk.js.map +1 -0
  190. package/dist/functions/integrations/ag-grid/generateLicense.d.ts +7 -0
  191. package/dist/functions/integrations/ag-grid/generateLicense.js +12 -0
  192. package/dist/functions/integrations/ag-grid/generateLicense.js.map +1 -0
  193. package/dist/functions/integrations/uniapp/app-plus/buildAndroidApp.d.ts +30 -0
  194. package/dist/functions/integrations/uniapp/app-plus/buildAndroidApp.js +884 -0
  195. package/dist/functions/integrations/uniapp/app-plus/buildAndroidApp.js.map +1 -0
  196. package/dist/functions/integrations/uniapp/app-plus/buildIOSApp.d.ts +31 -0
  197. package/dist/functions/integrations/uniapp/app-plus/buildIOSApp.js +900 -0
  198. package/dist/functions/integrations/uniapp/app-plus/buildIOSApp.js.map +1 -0
  199. package/dist/functions/integrations/uniapp/build.d.ts +21 -0
  200. package/dist/functions/integrations/uniapp/build.js +83 -0
  201. package/dist/functions/integrations/uniapp/build.js.map +1 -0
  202. package/dist/functions/integrations/uniapp/detectAndroidProjectStructure.d.ts +11 -0
  203. package/dist/functions/integrations/uniapp/detectAndroidProjectStructure.js +30 -0
  204. package/dist/functions/integrations/uniapp/detectAndroidProjectStructure.js.map +1 -0
  205. package/dist/functions/integrations/uniapp/detectProjectType.d.ts +20 -0
  206. package/dist/functions/integrations/uniapp/detectProjectType.js +68 -0
  207. package/dist/functions/integrations/uniapp/detectProjectType.js.map +1 -0
  208. package/dist/functions/integrations/uniapp/parseManifest.d.ts +20 -0
  209. package/dist/functions/integrations/uniapp/parseManifest.js +51 -0
  210. package/dist/functions/integrations/uniapp/parseManifest.js.map +1 -0
  211. package/dist/functions/integrations/uniapp/waitForPages.d.ts +7 -0
  212. package/dist/functions/integrations/uniapp/waitForPages.js +20 -0
  213. package/dist/functions/integrations/uniapp/waitForPages.js.map +1 -0
  214. package/dist/functions/integrations/vue/dynamicMount.d.ts +18 -0
  215. package/dist/functions/integrations/vue/dynamicMount.js +25 -0
  216. package/dist/functions/integrations/vue/dynamicMount.js.map +1 -0
  217. package/dist/functions/integrations/vue/extractColorsFromVueFile.d.ts +3 -0
  218. package/dist/functions/integrations/vue/extractColorsFromVueFile.js +18 -0
  219. package/dist/functions/integrations/vue/extractColorsFromVueFile.js.map +1 -0
  220. package/dist/functions/integrations/vue/extractColorsFromVueSection.d.ts +3 -0
  221. package/dist/functions/integrations/vue/extractColorsFromVueSection.js +53 -0
  222. package/dist/functions/integrations/vue/extractColorsFromVueSection.js.map +1 -0
  223. package/dist/functions/integrations/vue/filterSections.d.ts +2 -0
  224. package/dist/functions/integrations/vue/filterSections.js +11 -0
  225. package/dist/functions/integrations/vue/filterSections.js.map +1 -0
  226. package/dist/functions/integrations/vue/isVNode.d.ts +2 -0
  227. package/dist/functions/integrations/vue/isVNode.js +6 -0
  228. package/dist/functions/integrations/vue/isVNode.js.map +1 -0
  229. package/dist/functions/integrations/vue/isVueComponent.d.ts +2 -0
  230. package/dist/functions/integrations/vue/isVueComponent.js +6 -0
  231. package/dist/functions/integrations/vue/isVueComponent.js.map +1 -0
  232. package/dist/functions/integrations/vue/parseVueFile.d.ts +2 -0
  233. package/dist/functions/integrations/vue/parseVueFile.js +53 -0
  234. package/dist/functions/integrations/vue/parseVueFile.js.map +1 -0
  235. package/dist/functions/integrations/wechat/miniapp/downloadFile.d.ts +6 -0
  236. package/dist/functions/integrations/wechat/miniapp/downloadFile.js +39 -0
  237. package/dist/functions/integrations/wechat/miniapp/downloadFile.js.map +1 -0
  238. package/dist/functions/ios/integrateCameraGallery.d.ts +16 -0
  239. package/dist/functions/ios/integrateCameraGallery.js +95 -0
  240. package/dist/functions/ios/integrateCameraGallery.js.map +1 -0
  241. package/dist/functions/ios/integrateThirdPartyModule.d.ts +5 -0
  242. package/dist/functions/ios/integrateThirdPartyModule.js +99 -0
  243. package/dist/functions/ios/integrateThirdPartyModule.js.map +1 -1
  244. package/dist/functions/patterns/MyPromise.d.ts +32 -0
  245. package/dist/functions/patterns/MyPromise.js +254 -0
  246. package/dist/functions/patterns/MyPromise.js.map +1 -0
  247. package/dist/functions/patterns/functionBind.d.ts +4 -0
  248. package/dist/functions/patterns/functionBind.js +33 -0
  249. package/dist/functions/patterns/functionBind.js.map +1 -0
  250. package/dist/functions/patterns/myInstanceof.d.ts +5 -0
  251. package/dist/functions/patterns/myInstanceof.js +56 -0
  252. package/dist/functions/patterns/myInstanceof.js.map +1 -0
  253. package/dist/functions/patterns/myNew.d.ts +3 -0
  254. package/dist/functions/patterns/myNew.js +19 -0
  255. package/dist/functions/patterns/myNew.js.map +1 -0
  256. package/dist/functions/platform/android/buildProject.d.ts +13 -0
  257. package/dist/functions/platform/android/buildProject.js +122 -0
  258. package/dist/functions/platform/android/buildProject.js.map +1 -0
  259. package/dist/functions/platform/android/configureAppIcon.d.ts +17 -0
  260. package/dist/functions/platform/android/configureAppIcon.js +106 -0
  261. package/dist/functions/platform/android/configureAppIcon.js.map +1 -0
  262. package/dist/functions/platform/android/configureLaunchScreen.d.ts +21 -0
  263. package/dist/functions/platform/android/configureLaunchScreen.js +328 -0
  264. package/dist/functions/platform/android/configureLaunchScreen.js.map +1 -0
  265. package/dist/functions/platform/android/detectAndroidModules.d.ts +8 -0
  266. package/dist/functions/platform/android/detectAndroidModules.js +21 -0
  267. package/dist/functions/platform/android/detectAndroidModules.js.map +1 -0
  268. package/dist/functions/platform/android/integrateFacebookLogin.d.ts +12 -0
  269. package/dist/functions/platform/android/integrateFacebookLogin.js +91 -0
  270. package/dist/functions/platform/android/integrateFacebookLogin.js.map +1 -0
  271. package/dist/functions/platform/android/integrateGoogleLogin.d.ts +10 -0
  272. package/dist/functions/platform/android/integrateGoogleLogin.js +199 -0
  273. package/dist/functions/platform/android/integrateGoogleLogin.js.map +1 -0
  274. package/dist/functions/platform/android/integrateMiuiLogin.d.ts +13 -0
  275. package/dist/functions/platform/android/integrateMiuiLogin.js +115 -0
  276. package/dist/functions/platform/android/integrateMiuiLogin.js.map +1 -0
  277. package/dist/functions/platform/android/integrateQQLogin.d.ts +12 -0
  278. package/dist/functions/platform/android/integrateQQLogin.js +130 -0
  279. package/dist/functions/platform/android/integrateQQLogin.js.map +1 -0
  280. package/dist/functions/platform/android/integrateShareTrace.d.ts +10 -0
  281. package/dist/functions/platform/android/integrateShareTrace.js +181 -0
  282. package/dist/functions/platform/android/integrateShareTrace.js.map +1 -0
  283. package/dist/functions/platform/android/integrateSinaLogin.d.ts +13 -0
  284. package/dist/functions/platform/android/integrateSinaLogin.js +85 -0
  285. package/dist/functions/platform/android/integrateSinaLogin.js.map +1 -0
  286. package/dist/functions/platform/android/integrateThirdPartyModule.d.ts +46 -0
  287. package/dist/functions/platform/android/integrateThirdPartyModule.js +251 -0
  288. package/dist/functions/platform/android/integrateThirdPartyModule.js.map +1 -0
  289. package/dist/functions/platform/android/integrateUniAppNativePlugin.d.ts +22 -0
  290. package/dist/functions/platform/android/integrateUniAppNativePlugin.js +631 -0
  291. package/dist/functions/platform/android/integrateUniAppNativePlugin.js.map +1 -0
  292. package/dist/functions/platform/android/integrateUniverifyLogin.d.ts +11 -0
  293. package/dist/functions/platform/android/integrateUniverifyLogin.js +314 -0
  294. package/dist/functions/platform/android/integrateUniverifyLogin.js.map +1 -0
  295. package/dist/functions/platform/android/integrateWechatLogin.d.ts +13 -0
  296. package/dist/functions/platform/android/integrateWechatLogin.js +154 -0
  297. package/dist/functions/platform/android/integrateWechatLogin.js.map +1 -0
  298. package/dist/functions/platform/android/integrateWechatShare.d.ts +13 -0
  299. package/dist/functions/platform/android/integrateWechatShare.js +154 -0
  300. package/dist/functions/platform/android/integrateWechatShare.js.map +1 -0
  301. package/dist/functions/platform/android/modifyGradle.d.ts +28 -0
  302. package/dist/functions/platform/android/modifyGradle.js +119 -0
  303. package/dist/functions/platform/android/modifyGradle.js.map +1 -0
  304. package/dist/functions/platform/android/modifyManifest.d.ts +39 -0
  305. package/dist/functions/platform/android/modifyManifest.js +225 -0
  306. package/dist/functions/platform/android/modifyManifest.js.map +1 -0
  307. package/dist/functions/platform/android/permission.d.ts +54 -0
  308. package/dist/functions/platform/android/permission.js +85 -0
  309. package/dist/functions/platform/android/permission.js.map +1 -0
  310. package/dist/functions/platform/ios/configureAppIcon.d.ts +17 -0
  311. package/dist/functions/platform/ios/configureAppIcon.js +149 -0
  312. package/dist/functions/platform/ios/configureAppIcon.js.map +1 -0
  313. package/dist/functions/platform/ios/configureLaunchScreen.d.ts +17 -0
  314. package/dist/functions/platform/ios/configureLaunchScreen.js +150 -0
  315. package/dist/functions/platform/ios/configureLaunchScreen.js.map +1 -0
  316. package/dist/functions/platform/ios/configurePermissions.d.ts +19 -0
  317. package/dist/functions/platform/ios/configurePermissions.js +120 -0
  318. package/dist/functions/platform/ios/configurePermissions.js.map +1 -0
  319. package/dist/functions/platform/ios/integrateNativePlugin.d.ts +35 -0
  320. package/dist/functions/platform/ios/integrateNativePlugin.js +994 -0
  321. package/dist/functions/platform/ios/integrateNativePlugin.js.map +1 -0
  322. package/dist/functions/platform/ios/integrateQQShare.d.ts +14 -0
  323. package/dist/functions/platform/ios/integrateQQShare.js +132 -0
  324. package/dist/functions/platform/ios/integrateQQShare.js.map +1 -0
  325. package/dist/functions/platform/ios/integrateSinaShare.d.ts +16 -0
  326. package/dist/functions/platform/ios/integrateSinaShare.js +108 -0
  327. package/dist/functions/platform/ios/integrateSinaShare.js.map +1 -0
  328. package/dist/functions/platform/ios/integrateThirdPartyModule.d.ts +62 -0
  329. package/dist/functions/platform/ios/integrateThirdPartyModule.js +883 -0
  330. package/dist/functions/platform/ios/integrateThirdPartyModule.js.map +1 -0
  331. package/dist/functions/platform/ios/integrateWechatOauth.d.ts +14 -0
  332. package/dist/functions/platform/ios/integrateWechatOauth.js +107 -0
  333. package/dist/functions/platform/ios/integrateWechatOauth.js.map +1 -0
  334. package/dist/functions/platform/ios/integrateWechatShare.d.ts +14 -0
  335. package/dist/functions/platform/ios/integrateWechatShare.js +101 -0
  336. package/dist/functions/platform/ios/integrateWechatShare.js.map +1 -0
  337. package/dist/functions/platform/ios/modifyInfoPlistKeyValue.d.ts +2 -0
  338. package/dist/functions/platform/ios/modifyInfoPlistKeyValue.js +45 -0
  339. package/dist/functions/platform/ios/modifyInfoPlistKeyValue.js.map +1 -0
  340. package/dist/functions/platform/ios/safelyModifyProjectPbxproj.d.ts +16 -0
  341. package/dist/functions/platform/ios/safelyModifyProjectPbxproj.js +136 -0
  342. package/dist/functions/platform/ios/safelyModifyProjectPbxproj.js.map +1 -0
  343. package/dist/functions/platform/ios/useAltool.d.ts +39 -0
  344. package/dist/functions/platform/ios/useAltool.js +350 -0
  345. package/dist/functions/platform/ios/useAltool.js.map +1 -0
  346. package/dist/functions/style/buildTokens.d.ts +76 -0
  347. package/dist/functions/style/buildTokens.js +183 -0
  348. package/dist/functions/style/buildTokens.js.map +1 -0
  349. package/dist/functions/style/extractCssVariables.d.ts +16 -0
  350. package/dist/functions/style/extractCssVariables.js +256 -0
  351. package/dist/functions/style/extractCssVariables.js.map +1 -0
  352. package/dist/functions/style/generateVariables.d.ts +7 -0
  353. package/dist/functions/style/generateVariables.js +135 -0
  354. package/dist/functions/style/generateVariables.js.map +1 -0
  355. package/dist/functions/style/mixColors.d.ts +1 -0
  356. package/dist/functions/style/mixColors.js +38 -0
  357. package/dist/functions/style/mixColors.js.map +1 -0
  358. package/dist/functions/style/parseDesignTokens.d.ts +10 -0
  359. package/dist/functions/style/parseDesignTokens.js +216 -0
  360. package/dist/functions/style/parseDesignTokens.js.map +1 -0
  361. package/dist/functions/uniapp/app-plus/buildIOSApp.js +36 -0
  362. package/dist/functions/uniapp/app-plus/buildIOSApp.js.map +1 -1
  363. package/dist/functions/uniapp/camera/showCamera.d.ts +11 -0
  364. package/dist/functions/uniapp/camera/showCamera.js +22 -0
  365. package/dist/functions/uniapp/camera/showCamera.js.map +1 -0
  366. package/dist/functions/uniapp/customer-service/adapters/openCustomerServiceInMiniapp.d.ts +23 -0
  367. package/dist/functions/uniapp/customer-service/adapters/openCustomerServiceInMiniapp.js +69 -0
  368. package/dist/functions/uniapp/customer-service/adapters/openCustomerServiceInMiniapp.js.map +1 -0
  369. package/dist/functions/uniapp/customer-service/showWxCustomerService.d.ts +28 -0
  370. package/dist/functions/uniapp/customer-service/showWxCustomerService.js +25 -0
  371. package/dist/functions/uniapp/customer-service/showWxCustomerService.js.map +1 -0
  372. package/dist/functions/uniapp/file/adapters/readWriteFileInApp.d.ts +10 -0
  373. package/dist/functions/uniapp/file/adapters/readWriteFileInApp.js +97 -0
  374. package/dist/functions/uniapp/file/adapters/readWriteFileInApp.js.map +1 -0
  375. package/dist/functions/uniapp/file/adapters/readWriteFileInH5.d.ts +30 -0
  376. package/dist/functions/uniapp/file/adapters/readWriteFileInH5.js +83 -0
  377. package/dist/functions/uniapp/file/adapters/readWriteFileInH5.js.map +1 -0
  378. package/dist/functions/uniapp/file/adapters/readWriteFileInMiniapp.d.ts +10 -0
  379. package/dist/functions/uniapp/file/adapters/readWriteFileInMiniapp.js +97 -0
  380. package/dist/functions/uniapp/file/adapters/readWriteFileInMiniapp.js.map +1 -0
  381. package/dist/functions/uniapp/file/showFile.d.ts +35 -0
  382. package/dist/functions/uniapp/file/showFile.js +66 -0
  383. package/dist/functions/uniapp/file/showFile.js.map +1 -0
  384. package/dist/functions/uniapp/image/adapters/chooseImageInApp.d.ts +9 -0
  385. package/dist/functions/uniapp/image/adapters/chooseImageInApp.js +52 -0
  386. package/dist/functions/uniapp/image/adapters/chooseImageInApp.js.map +1 -0
  387. package/dist/functions/uniapp/image/adapters/chooseImageInH5.d.ts +9 -0
  388. package/dist/functions/uniapp/image/adapters/chooseImageInH5.js +52 -0
  389. package/dist/functions/uniapp/image/adapters/chooseImageInH5.js.map +1 -0
  390. package/dist/functions/uniapp/image/adapters/chooseImageInMiniapp.d.ts +9 -0
  391. package/dist/functions/uniapp/image/adapters/chooseImageInMiniapp.js +52 -0
  392. package/dist/functions/uniapp/image/adapters/chooseImageInMiniapp.js.map +1 -0
  393. package/dist/functions/uniapp/image/showImage.d.ts +11 -0
  394. package/dist/functions/uniapp/image/showImage.js +23 -0
  395. package/dist/functions/uniapp/image/showImage.js.map +1 -0
  396. package/dist/functions/uniapp/login/adapters/wechatLoginInApp.d.ts +10 -0
  397. package/dist/functions/uniapp/login/adapters/wechatLoginInApp.js +49 -0
  398. package/dist/functions/uniapp/login/adapters/wechatLoginInApp.js.map +1 -0
  399. package/dist/functions/uniapp/login/adapters/wechatLoginInMiniapp.d.ts +9 -0
  400. package/dist/functions/uniapp/login/adapters/wechatLoginInMiniapp.js +27 -0
  401. package/dist/functions/uniapp/login/adapters/wechatLoginInMiniapp.js.map +1 -0
  402. package/dist/functions/uniapp/login/showLogin.d.ts +13 -0
  403. package/dist/functions/uniapp/login/showLogin.js +43 -0
  404. package/dist/functions/uniapp/login/showLogin.js.map +1 -0
  405. package/dist/functions/uniapp/pay/adapters/wechatPayInApp.d.ts +8 -0
  406. package/dist/functions/uniapp/pay/adapters/wechatPayInApp.js +36 -0
  407. package/dist/functions/uniapp/pay/adapters/wechatPayInApp.js.map +1 -0
  408. package/dist/functions/uniapp/pay/adapters/wechatPayInH5.d.ts +13 -0
  409. package/dist/functions/uniapp/pay/adapters/wechatPayInH5.js +44 -0
  410. package/dist/functions/uniapp/pay/adapters/wechatPayInH5.js.map +1 -0
  411. package/dist/functions/uniapp/pay/adapters/wechatPayInMiniapp.d.ts +8 -0
  412. package/dist/functions/uniapp/pay/adapters/wechatPayInMiniapp.js +37 -0
  413. package/dist/functions/uniapp/pay/adapters/wechatPayInMiniapp.js.map +1 -0
  414. package/dist/functions/uniapp/pay/showPay.d.ts +18 -0
  415. package/dist/functions/uniapp/pay/showPay.js +60 -0
  416. package/dist/functions/uniapp/pay/showPay.js.map +1 -0
  417. package/dist/functions/uniapp/phone/adapters/getPhoneInMiniapp.d.ts +6 -0
  418. package/dist/functions/uniapp/phone/adapters/getPhoneInMiniapp.js +41 -0
  419. package/dist/functions/uniapp/phone/adapters/getPhoneInMiniapp.js.map +1 -0
  420. package/dist/functions/uniapp/phone/showWxPhone.d.ts +8 -0
  421. package/dist/functions/uniapp/phone/showWxPhone.js +25 -0
  422. package/dist/functions/uniapp/phone/showWxPhone.js.map +1 -0
  423. package/dist/functions/uniapp/record/adapters/recordInApp.d.ts +12 -0
  424. package/dist/functions/uniapp/record/adapters/recordInApp.js +64 -0
  425. package/dist/functions/uniapp/record/adapters/recordInApp.js.map +1 -0
  426. package/dist/functions/uniapp/record/adapters/recordInH5.d.ts +21 -0
  427. package/dist/functions/uniapp/record/adapters/recordInH5.js +82 -0
  428. package/dist/functions/uniapp/record/adapters/recordInH5.js.map +1 -0
  429. package/dist/functions/uniapp/record/adapters/recordInMiniapp.d.ts +12 -0
  430. package/dist/functions/uniapp/record/adapters/recordInMiniapp.js +64 -0
  431. package/dist/functions/uniapp/record/adapters/recordInMiniapp.js.map +1 -0
  432. package/dist/functions/uniapp/record/showRecord.d.ts +23 -0
  433. package/dist/functions/uniapp/record/showRecord.js +95 -0
  434. package/dist/functions/uniapp/record/showRecord.js.map +1 -0
  435. package/dist/functions/uniapp/scan-code/adapters/scanCodeInApp.d.ts +9 -0
  436. package/dist/functions/uniapp/scan-code/adapters/scanCodeInApp.js +30 -0
  437. package/dist/functions/uniapp/scan-code/adapters/scanCodeInApp.js.map +1 -0
  438. package/dist/functions/uniapp/scan-code/adapters/scanCodeInMiniapp.d.ts +9 -0
  439. package/dist/functions/uniapp/scan-code/adapters/scanCodeInMiniapp.js +30 -0
  440. package/dist/functions/uniapp/scan-code/adapters/scanCodeInMiniapp.js.map +1 -0
  441. package/dist/functions/uniapp/scan-code/showScanCode.d.ts +12 -0
  442. package/dist/functions/uniapp/scan-code/showScanCode.js +28 -0
  443. package/dist/functions/uniapp/scan-code/showScanCode.js.map +1 -0
  444. package/dist/functions/uniapp/subscribe-message/adapters/wechatSubscribeMessageInMiniapp.d.ts +9 -0
  445. package/dist/functions/uniapp/subscribe-message/adapters/wechatSubscribeMessageInMiniapp.js +41 -0
  446. package/dist/functions/uniapp/subscribe-message/adapters/wechatSubscribeMessageInMiniapp.js.map +1 -0
  447. package/dist/functions/uniapp/subscribe-message/showWxSubscribeMessage.d.ts +11 -0
  448. package/dist/functions/uniapp/subscribe-message/showWxSubscribeMessage.js +25 -0
  449. package/dist/functions/uniapp/subscribe-message/showWxSubscribeMessage.js.map +1 -0
  450. package/dist/functions/uniapp/user-info/wxGetUserInfo.d.ts +43 -0
  451. package/dist/functions/uniapp/user-info/wxGetUserInfo.js +55 -0
  452. package/dist/functions/uniapp/user-info/wxGetUserInfo.js.map +1 -0
  453. package/dist/functions/uniapp/video/adapters/chooseVideoInApp.d.ts +9 -0
  454. package/dist/functions/uniapp/video/adapters/chooseVideoInApp.js +31 -0
  455. package/dist/functions/uniapp/video/adapters/chooseVideoInApp.js.map +1 -0
  456. package/dist/functions/uniapp/video/adapters/chooseVideoInH5.d.ts +9 -0
  457. package/dist/functions/uniapp/video/adapters/chooseVideoInH5.js +30 -0
  458. package/dist/functions/uniapp/video/adapters/chooseVideoInH5.js.map +1 -0
  459. package/dist/functions/uniapp/video/adapters/chooseVideoInMiniapp.d.ts +9 -0
  460. package/dist/functions/uniapp/video/adapters/chooseVideoInMiniapp.js +31 -0
  461. package/dist/functions/uniapp/video/adapters/chooseVideoInMiniapp.js.map +1 -0
  462. package/dist/functions/uniapp/video/showVideo.d.ts +11 -0
  463. package/dist/functions/uniapp/video/showVideo.js +23 -0
  464. package/dist/functions/uniapp/video/showVideo.js.map +1 -0
  465. package/dist/functions/validation/parseJwtPayload.d.ts +7 -0
  466. package/dist/functions/validation/parseJwtPayload.js +33 -0
  467. package/dist/functions/validation/parseJwtPayload.js.map +1 -0
  468. package/dist/functions/validation/validate.d.ts +11 -0
  469. package/dist/functions/validation/validate.js +44 -0
  470. package/dist/functions/validation/validate.js.map +1 -0
  471. package/dist/vue-hooks/browser/useBridgeMessage.d.ts +2 -1
  472. package/dist/vue-hooks/browser/useBridgeMessage.js +13 -11
  473. package/dist/vue-hooks/browser/useBridgeMessage.js.map +1 -1
  474. package/package.json +37 -2
  475. package/references/blob.d.ts +2 -0
  476. package/references/device.d.ts +46 -0
  477. package/references/dom.d.ts +6 -0
  478. package/references/uniapp.d.ts +221 -8
  479. package/types/uniapp-ios-build.d.ts +22 -0
  480. package/types/uniapp.d.ts +298 -0
@@ -0,0 +1,131 @@
1
+ export function deepClone(value, options = {}) {
2
+ const cache = new WeakMap();
3
+ function clone(val) {
4
+ if (val === null || typeof val !== 'object') {
5
+ return val;
6
+ }
7
+ if (cache.has(val)) {
8
+ return cache.get(val);
9
+ }
10
+ if (options.customClone) {
11
+ const customResult = options.customClone(val, clone);
12
+ if (customResult !== undefined) {
13
+ return customResult;
14
+ }
15
+ }
16
+ const type = Object.prototype.toString.call(val);
17
+ if (type === '[object Date]') {
18
+ return new Date(val.getTime());
19
+ }
20
+ if (type === '[object RegExp]') {
21
+ const pattern = val.source;
22
+ const flags = val.flags;
23
+ return new RegExp(pattern, flags);
24
+ }
25
+ if (val instanceof Error) {
26
+ const errorCopy = new val.constructor(val.message);
27
+ errorCopy.stack = val.stack;
28
+ errorCopy.name = val.name;
29
+ return errorCopy;
30
+ }
31
+ if (type === '[object Map]') {
32
+ const mapCopy = new Map();
33
+ cache.set(val, mapCopy);
34
+ val.forEach((value, key) => {
35
+ mapCopy.set(clone(key), clone(value));
36
+ });
37
+ return mapCopy;
38
+ }
39
+ if (type === '[object Set]') {
40
+ const setCopy = new Set();
41
+ cache.set(val, setCopy);
42
+ val.forEach(value => {
43
+ setCopy.add(clone(value));
44
+ });
45
+ return setCopy;
46
+ }
47
+ if (type === '[object WeakMap]') {
48
+ return new WeakMap();
49
+ }
50
+ if (type === '[object WeakSet]') {
51
+ return new WeakSet();
52
+ }
53
+ if (type === '[object ArrayBuffer]') {
54
+ const buffer = val;
55
+ const copy = new ArrayBuffer(buffer.byteLength);
56
+ new Uint8Array(copy).set(new Uint8Array(buffer));
57
+ return copy;
58
+ }
59
+ if (ArrayBuffer.isView(val) && !(val instanceof DataView)) {
60
+ const typedArray = val;
61
+ const TypedArrayConstructor = typedArray.constructor;
62
+ const copy = new TypedArrayConstructor(typedArray.length);
63
+ copy.set(typedArray);
64
+ return copy;
65
+ }
66
+ if (type === '[object DataView]') {
67
+ const dataView = val;
68
+ const bufferCopy = clone(dataView.buffer);
69
+ return new DataView(bufferCopy, dataView.byteOffset, dataView.byteLength);
70
+ }
71
+ if (Array.isArray(val)) {
72
+ const arrCopy = [];
73
+ cache.set(val, arrCopy);
74
+ for (let i = 0; i < val.length; i++) {
75
+ arrCopy[i] = clone(val[i]);
76
+ }
77
+ return arrCopy;
78
+ }
79
+ let objCopy;
80
+ if (options.includePrototype) {
81
+ objCopy = Object.create(Object.getPrototypeOf(val));
82
+ }
83
+ else {
84
+ objCopy = {};
85
+ }
86
+ cache.set(val, objCopy);
87
+ for (const key in val) {
88
+ if (Object.prototype.hasOwnProperty.call(val, key)) {
89
+ objCopy[key] = clone(val[key]);
90
+ }
91
+ }
92
+ if (options.includeNonEnumerable) {
93
+ const propertyNames = Object.getOwnPropertyNames(val);
94
+ for (const key of propertyNames) {
95
+ if (!objCopy.hasOwnProperty(key)) {
96
+ const descriptor = Object.getOwnPropertyDescriptor(val, key);
97
+ if (descriptor) {
98
+ Object.defineProperty(objCopy, key, {
99
+ ...descriptor,
100
+ value: clone(descriptor.value)
101
+ });
102
+ }
103
+ }
104
+ }
105
+ }
106
+ if (options.includeSymbol) {
107
+ const symbols = Object.getOwnPropertySymbols(val);
108
+ for (const symbol of symbols) {
109
+ const descriptor = Object.getOwnPropertyDescriptor(val, symbol);
110
+ if (descriptor) {
111
+ Object.defineProperty(objCopy, symbol, {
112
+ ...descriptor,
113
+ value: clone(descriptor.value)
114
+ });
115
+ }
116
+ }
117
+ }
118
+ return objCopy;
119
+ }
120
+ return clone(value);
121
+ }
122
+ export function deepCloneJSON(value) {
123
+ return JSON.parse(JSON.stringify(value));
124
+ }
125
+ export function deepCloneStructured(value, deps) {
126
+ if (deps.structuredClone) {
127
+ return deps.structuredClone(value);
128
+ }
129
+ return deepClone(value);
130
+ }
131
+ //# sourceMappingURL=deepClone.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deepClone.js","sourceRoot":"","sources":["../../../../src/functions/data/array-object/deepClone.ts"],"names":[],"mappings":"AA0CA,MAAM,UAAU,SAAS,CAAI,KAAQ,EAAE,UAA4B,EAAE;IAEnE,MAAM,KAAK,GAAG,IAAI,OAAO,EAAY,CAAA;IAErC,SAAS,KAAK,CAAC,GAAQ;QAErB,IAAI,GAAG,KAAK,IAAI,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;YAC5C,OAAO,GAAG,CAAA;QACZ,CAAC;QAGD,IAAI,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YACnB,OAAO,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;QACvB,CAAC;QAGD,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;YACxB,MAAM,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;YACpD,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;gBAC/B,OAAO,YAA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T extends Record<string, any>>(transformations: {
2
+ [K in keyof T]?: T[K] extends (infer U)[] ? (value: T[K]) => U[] : T[K] extends Record<string, any> ? (value: T[K]) => any : (value: T[K]) => any;
3
+ }): (obj: T) => any;
@@ -0,0 +1,15 @@
1
+ export function evolve(transformations) {
2
+ return (obj) => {
3
+ if (!obj || typeof obj !== 'object')
4
+ return obj;
5
+ const result = { ...obj };
6
+ for (const key in transformations) {
7
+ if (obj.hasOwnProperty(key) && transformations[key]) {
8
+ const transform = transformations[key];
9
+ result[key] = transform(obj[key]);
10
+ }
11
+ }
12
+ return result;
13
+ };
14
+ }
15
+ //# sourceMappingURL=evolve.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"evolve.js","sourceRoot":"","sources":["../../../../src/functions/data/array-object/evolve.ts"],"names":[],"mappings":"AAaA,MAAM,UAAU,MAAM,CACpB,eAMC;IAED,OAAO,CAAC,GAAM,EAAO,EAAE;QACrB,IAAI,CAAC,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ;YAAE,OAAO,GAAG,CAAA;QAE/C,MAAM,MAAM,GAAQ,EAAE,GAAG,GAAG,EAAE,CAAA;QAE9B,KAAK,MAAM,GAAG,IAAI,eAAe,EAAE,CAAC;YAClC,IAAI,GAAG,CAAC,cAAc,CAAC,GAAG,CAAC,IAAI,eAAe,CAAC,GAAG,CAAC,EAAE,CAAC;gBACpD,MAAM,SAAS,GAAG,eAAe,CAAC,GAAG,CAAa,CAAA;gBAClD,MAAM,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAA;YACnC,CAAC;QACH,CAAC;QAED,OAAO,MAAM,CAAA;IACf,CAAC,CAAA;AACH,CAAC"}
@@ -0,0 +1,7 @@
1
+ export declare function flatten<T>(arr: any[], depth?: number): T[];
2
+ export declare function flattenReduce<T>(arr: any[], depth?: number): T[];
3
+ export declare function flattenIterative<T>(arr: any[]): T[];
4
+ export declare function flattenGenerator(arr: any[]): Generator<any>;
5
+ export declare function flattenWithGenerator<T>(arr: any[]): T[];
6
+ export declare function flattenToString(arr: any[]): number[];
7
+ export declare function flattenNative<T>(arr: any[], depth?: number): T[];
@@ -0,0 +1,60 @@
1
+ export function flatten(arr, depth = Infinity) {
2
+ const result = [];
3
+ function flattenHelper(items, currentDepth) {
4
+ for (const item of items) {
5
+ if (Array.isArray(item) && currentDepth > 0) {
6
+ flattenHelper(item, currentDepth - 1);
7
+ }
8
+ else {
9
+ result.push(item);
10
+ }
11
+ }
12
+ }
13
+ flattenHelper(arr, depth);
14
+ return result;
15
+ }
16
+ export function flattenReduce(arr, depth = Infinity) {
17
+ if (depth <= 0) {
18
+ return arr.slice();
19
+ }
20
+ return arr.reduce((acc, item) => {
21
+ if (Array.isArray(item)) {
22
+ return acc.concat(flattenReduce(item, depth - 1));
23
+ }
24
+ return acc.concat(item);
25
+ }, []);
26
+ }
27
+ export function flattenIterative(arr) {
28
+ const stack = [...arr];
29
+ const result = [];
30
+ while (stack.length) {
31
+ const item = stack.pop();
32
+ if (Array.isArray(item)) {
33
+ stack.push(...item);
34
+ }
35
+ else {
36
+ result.unshift(item);
37
+ }
38
+ }
39
+ return result;
40
+ }
41
+ export function* flattenGenerator(arr) {
42
+ for (const item of arr) {
43
+ if (Array.isArray(item)) {
44
+ yield* flattenGenerator(item);
45
+ }
46
+ else {
47
+ yield item;
48
+ }
49
+ }
50
+ }
51
+ export function flattenWithGenerator(arr) {
52
+ return [...flattenGenerator(arr)];
53
+ }
54
+ export function flattenToString(arr) {
55
+ return arr.toString().split(',').map(Number);
56
+ }
57
+ export function flattenNative(arr, depth = Infinity) {
58
+ return arr.flat(depth);
59
+ }
60
+ //# sourceMappingURL=flatten.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flatten.js","sourceRoot":"","sources":["../../../../src/functions/data/array-object/flatten.ts"],"names":[],"mappings":"AAeA,MAAM,UAAU,OAAO,CAAI,GAAU,EAAE,QAAgB,QAAQ;IAC7D,MAAM,MAA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AExB,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAA;QACrB,CAAC;aAAM,CAAC;YAEN,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;QACtB,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC;AAKD,MAAM,SAAS,CAAC,CAAC,gBAAgB,CAAC,GAAU;IAC1C,KAAK,MAAM,IAAI,IAAI,GAAG,EAAE,CAAC;QACvB,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;YACxB,KAAK,CAAC,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAA;QAC/B,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,CAAA;QACZ,CAAC;IACH,CAAC;AACH,CAAC;AAKD,MAAM,UAAU,oBAAoB,CAAI,GAAU;IAChD,OAAO,CAAC,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAA;AACnC,CAAC;AAKD,MAAM,UAAU,eAAe,CAAC,GAAU;IACxC,OAAO,GAAG,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;AAC9C,CAAC;AAKD,MAAM,UAAU,aAAa,CAAI,GAAU,EAAE,QAAgB,QAAQ;IACnE,OAAO,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;AACxB,CAAC"}
@@ -0,0 +1,5 @@
1
+ export declare function flattenObject(obj: Record<string, any>, prefix?: string): Record<string, any>;
2
+ export declare function flattenObjectWithArray(obj: Record<string, any>, prefix?: string): Record<string, any>;
3
+ export declare function unflattenObject(obj: Record<string, any>): Record<string, any>;
4
+ export declare function flattenObjectKeepArray(obj: Record<string, any>, prefix?: string): Record<string, any>;
5
+ export declare function flattenObjectDeep(obj: any, prefix?: string): Record<string, any>;
@@ -0,0 +1,102 @@
1
+ export function flattenObject(obj, prefix = '') {
2
+ const result = {};
3
+ for (const key in obj) {
4
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
5
+ const newKey = prefix ? `${prefix}.${key}` : key;
6
+ const value = obj[key];
7
+ if (value !== null && typeof value === 'object' && !Array.isArray(value)) {
8
+ Object.assign(result, flattenObject(value, newKey));
9
+ }
10
+ else {
11
+ result[newKey] = value;
12
+ }
13
+ }
14
+ }
15
+ return result;
16
+ }
17
+ export function flattenObjectWithArray(obj, prefix = '') {
18
+ const result = {};
19
+ for (const key in obj) {
20
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
21
+ const newKey = prefix ? `${prefix}[${key}]` : key;
22
+ const value = obj[key];
23
+ if (value !== null && typeof value === 'object' && !Array.isArray(value)) {
24
+ Object.assign(result, flattenObjectWithArray(value, newKey));
25
+ }
26
+ else {
27
+ result[newKey] = value;
28
+ }
29
+ }
30
+ }
31
+ return result;
32
+ }
33
+ export function unflattenObject(obj) {
34
+ const result = {};
35
+ for (const key in obj) {
36
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
37
+ const keys = key.split('.');
38
+ let current = result;
39
+ for (let i = 0; i < keys.length - 1; i++) {
40
+ const k = keys[i];
41
+ if (!(k in current)) {
42
+ current[k] = {};
43
+ }
44
+ current = current[k];
45
+ }
46
+ current[keys[keys.length - 1]] = obj[key];
47
+ }
48
+ }
49
+ return result;
50
+ }
51
+ export function flattenObjectKeepArray(obj, prefix = '') {
52
+ const result = {};
53
+ for (const key in obj) {
54
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
55
+ const newKey = prefix ? `${prefix}.${key}` : key;
56
+ const value = obj[key];
57
+ if (Array.isArray(value)) {
58
+ result[newKey] = value;
59
+ }
60
+ else if (value !== null && typeof value === 'object') {
61
+ Object.assign(result, flattenObjectKeepArray(value, newKey));
62
+ }
63
+ else {
64
+ result[newKey] = value;
65
+ }
66
+ }
67
+ }
68
+ return result;
69
+ }
70
+ export function flattenObjectDeep(obj, prefix = '') {
71
+ const result = {};
72
+ if (Array.isArray(obj)) {
73
+ obj.forEach((item, index) => {
74
+ const newKey = prefix ? `${prefix}.${index}` : String(index);
75
+ if (item !== null && typeof item === 'object') {
76
+ Object.assign(result, flattenObjectDeep(item, newKey));
77
+ }
78
+ else {
79
+ result[newKey] = item;
80
+ }
81
+ });
82
+ }
83
+ else if (obj !== null && typeof obj === 'object') {
84
+ for (const key in obj) {
85
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
86
+ const newKey = prefix ? `${prefix}.${key}` : key;
87
+ const value = obj[key];
88
+ if (value !== null && typeof value === 'object') {
89
+ Object.assign(result, flattenObjectDeep(value, newKey));
90
+ }
91
+ else {
92
+ result[newKey] = value;
93
+ }
94
+ }
95
+ }
96
+ }
97
+ else {
98
+ result[prefix] = obj;
99
+ }
100
+ return result;
101
+ }
102
+ //# sourceMappingURL=flattenObject.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flattenObject.js","sourceRoot":"","sources":["../../../../src/functions/data/array-object/flattenObject.ts"],"names":[],"mappings":"AAqBA,MAAM,UAAU,aAAa,CAC3B,GAAwB,EACxB,SAAiB,EAAE;IAEnB,MAAM,MAAM,GAAwB,EAAE,CAAA;IAEtC,KAAK,MAAM,GAAG,IAAI,GAAG,EAAE,CAAC;QACtB,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC;YACnD,MAAM,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAA;YAChD,MAAM,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,CAAA;YAEtB,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;gBAEzE,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAA;YACrD,CAAC;iBAAM,C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CAAC,MAAM,EAAE,iBAAiB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAA;gBACzD,CAAC;qBAAM,CAAC;oBACN,MAAM,CAAC,MAAM,CAAC,GAAG,KAAK,CAAA;gBACxB,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;SAAM,CAAC;QACN,MAAM,CAAC,MAAM,CAAC,GAAG,GAAG,CAAA;IACtB,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC"}
@@ -0,0 +1 @@
1
+ export declare function groupBy<T>(array: T[], keyOrFn: keyof T | ((item: T) => string | number)): Record<string, T[]>;
@@ -0,0 +1,14 @@
1
+ export function groupBy(array, keyOrFn) {
2
+ const result = {};
3
+ for (const item of array) {
4
+ const key = typeof keyOrFn === 'function'
5
+ ? String(keyOrFn(item))
6
+ : String(item[keyOrFn]);
7
+ if (!result[key]) {
8
+ result[key] = [];
9
+ }
10
+ result[key].push(item);
11
+ }
12
+ return result;
13
+ }
14
+ //# sourceMappingURL=groupBy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"groupBy.js","sourceRoot":"","sources":["../../../../src/functions/data/array-object/groupBy.ts"],"names":[],"mappings":"AAwBA,MAAM,UAAU,OAAO,CACrB,KAAU,EACV,OAAiD;IAEjD,MAAM,MAAM,GAAwB,EAAE,CAAA;IAEtC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,GAAG,GAAG,OAAO,OAAO,KAAK,UAAU;YACvC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YACvB,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAA;QAEzB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;YACjB,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,CAAA;QAClB,CAAC;QAED,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACxB,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC"}
@@ -0,0 +1 @@
1
+ export declare function omit<T extends object, K extends keyof T>(obj: T, keys: K[]): Omit<T, K>;
@@ -0,0 +1,8 @@
1
+ export function omit(obj, keys) {
2
+ const result = { ...obj };
3
+ for (const key of keys) {
4
+ delete result[key];
5
+ }
6
+ return result;
7
+ }
8
+ //# sourceMappingURL=omit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"omit.js","sourceRoot":"","sources":["../../../../src/functions/data/array-object/omit.ts"],"names":[],"mappings":"AAoBA,MAAM,UAAU,IAAI,CAClB,GAAM,EACN,IAAS;IAET,MAAM,MAAM,GAAG,EAAE,GAAG,GAAG,EAAS,CAAA;IAEhC,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,OAAO,MAAM,CAAC,GAAG,CAAC,CAAA;IACpB,CAAC;IAED,OAAO,MAAoB,CAAA;AAC7B,CAAC"}
@@ -0,0 +1 @@
1
+ export declare function pick<T extends object, K extends keyof T>(obj: T, keys: K[]): Pick<T, K>;
@@ -0,0 +1,10 @@
1
+ export function pick(obj, keys) {
2
+ const result = {};
3
+ for (const key of keys) {
4
+ if (key in obj) {
5
+ result[key] = obj[key];
6
+ }
7
+ }
8
+ return result;
9
+ }
10
+ //# sourceMappingURL=pick.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pick.js","sourceRoot":"","sources":["../../../../src/functions/data/array-object/pick.ts"],"names":[],"mappings":"AAoBA,MAAM,UAAU,IAAI,CAClB,GAAM,EACN,IAAS;IAET,MAAM,MAAM,GAAG,EAAgB,CAAA;IAE/B,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,IAAI,GAAG,IAAI,GAAG,EAAE,CAAC;YACf,MAAM,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAA;QACxB,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC"}
@@ -0,0 +1 @@
1
+ export declare function shuffle<T>(array: T[]): T[];
@@ -0,0 +1,9 @@
1
+ export function shuffle(array) {
2
+ const result = [...array];
3
+ for (let i = result.length - 1; i > 0; i--) {
4
+ const j = Math.floor(Math.random() * (i + 1));
5
+ [result[i], result[j]] = [result[j], result[i]];
6
+ }
7
+ return result;
8
+ }
9
+ //# sourceMappingURL=shuffle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shuffle.js","sourceRoot":"","sources":["../../../../src/functions/data/array-object/shuffle.ts"],"names":[],"mappings":"AAaA,MAAM,UAAU,OAAO,CAAI,KAAU;IACnC,MAAM,MAAM,GAAG,CAAC,GAAG,KAAK,CAAC,CAAA;IAEzB,KAAK,IAAI,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAC3C,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAC5C;QAAA,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;IAClD,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC"}
@@ -0,0 +1 @@
1
+ export declare function sortBy<T>(array: T[], keyOrFn: keyof T | ((item: T) => any), order?: 'asc' | 'desc'): T[];
@@ -0,0 +1,13 @@
1
+ export function sortBy(array, keyOrFn, order = 'asc') {
2
+ const sorted = [...array].sort((a, b) => {
3
+ const aValue = typeof keyOrFn === 'function' ? keyOrFn(a) : a[keyOrFn];
4
+ const bValue = typeof keyOrFn === 'function' ? keyOrFn(b) : b[keyOrFn];
5
+ if (aValue < bValue)
6
+ return order === 'asc' ? -1 : 1;
7
+ if (aValue > bValue)
8
+ return order === 'asc' ? 1 : -1;
9
+ return 0;
10
+ });
11
+ return sorted;
12
+ }
13
+ //# sourceMappingURL=sortBy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sortBy.js","sourceRoot":"","sources":["../../../../src/functions/data/array-object/sortBy.ts"],"names":[],"mappings":"AAyBA,MAAM,UAAU,MAAM,CACpB,KAAU,EACV,OAAqC,EACrC,QAAwB,KAAK;IAE7B,MAAM,MAAM,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QACtC,MAAM,MAAM,GAAG,OAAO,OAAO,KAAK,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAA;QACtE,MAAM,MAAM,GAAG,OAAO,OAAO,KAAK,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAA;QAEtE,IAAI,MAAM,GAAG,MAAM;YAAE,OAAO,KAAK,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;QACpD,IAAI,MAAM,GAAG,MAAM;YAAE,OAAO,KAAK,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;QACpD,OAAO,CAAC,CAAA;IACV,CAAC,CAAC,CAAA;IAEF,OAAO,MAAM,CAAA;AACf,CAAC"}
@@ -0,0 +1,10 @@
1
+ export declare function unique<T>(arr: T[]): T[];
2
+ export declare function uniqueLoop<T>(arr: T[]): T[];
3
+ export declare function uniqueIndexOf<T>(arr: T[]): T[];
4
+ export declare function uniqueIncludes<T>(arr: T[]): T[];
5
+ export declare function uniqueFilter<T>(arr: T[]): T[];
6
+ export declare function uniqueReduce<T>(arr: T[]): T[];
7
+ export declare function uniqueMap<T>(arr: T[]): T[];
8
+ export declare function uniqueBy<T extends Record<string, any>>(arr: T[], key: keyof T): T[];
9
+ export declare function uniqueWith<T, K>(arr: T[], fn: (item: T) => K): T[];
10
+ export declare function uniqueAndSort(arr: number[]): number[];
@@ -0,0 +1,85 @@
1
+ export function unique(arr) {
2
+ return [...new Set(arr)];
3
+ }
4
+ export function uniqueLoop(arr) {
5
+ const result = [];
6
+ for (let i = 0; i < arr.length; i++) {
7
+ let isDuplicate = false;
8
+ for (let j = 0; j < result.length; j++) {
9
+ if (arr[i] === result[j]) {
10
+ isDuplicate = true;
11
+ break;
12
+ }
13
+ }
14
+ if (!isDuplicate) {
15
+ result.push(arr[i]);
16
+ }
17
+ }
18
+ return result;
19
+ }
20
+ export function uniqueIndexOf(arr) {
21
+ const result = [];
22
+ for (let i = 0; i < arr.length; i++) {
23
+ if (result.indexOf(arr[i]) === -1) {
24
+ result.push(arr[i]);
25
+ }
26
+ }
27
+ return result;
28
+ }
29
+ export function uniqueIncludes(arr) {
30
+ const result = [];
31
+ for (const item of arr) {
32
+ if (!result.includes(item)) {
33
+ result.push(item);
34
+ }
35
+ }
36
+ return result;
37
+ }
38
+ export function uniqueFilter(arr) {
39
+ return arr.filter((item, index) => arr.indexOf(item) === index);
40
+ }
41
+ export function uniqueReduce(arr) {
42
+ return arr.reduce((acc, item) => {
43
+ if (!acc.includes(item)) {
44
+ acc.push(item);
45
+ }
46
+ return acc;
47
+ }, []);
48
+ }
49
+ export function uniqueMap(arr) {
50
+ const map = new Map();
51
+ const result = [];
52
+ for (const item of arr) {
53
+ if (!map.has(item)) {
54
+ map.set(item, true);
55
+ result.push(item);
56
+ }
57
+ }
58
+ return result;
59
+ }
60
+ export function uniqueBy(arr, key) {
61
+ const seen = new Set();
62
+ return arr.filter(item => {
63
+ const value = item[key];
64
+ if (seen.has(value)) {
65
+ return false;
66
+ }
67
+ seen.add(value);
68
+ return true;
69
+ });
70
+ }
71
+ export function uniqueWith(arr, fn) {
72
+ const seen = new Set();
73
+ return arr.filter(item => {
74
+ const key = fn(item);
75
+ if (seen.has(key)) {
76
+ return false;
77
+ }
78
+ seen.add(key);
79
+ return true;
80
+ });
81
+ }
82
+ export function uniqueAndSort(arr) {
83
+ return [...new Set(arr)].sort((a, b) => a - b);
84
+ }
85
+ //# sourceMappingURL=unique.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unique.js","sourceRoot":"","sources":["../../../../src/functions/data/array-object/unique.ts"],"names":[],"mappings":"AAcA,MAAM,UAAU,MAAM,CAAI,GAAQ;IAChC,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,CAAA;AAC1B,CAAC;AAQD,MAAM,UAAU,UAAU,CAAI,GAAQ;IACpC,MAAM,MAAM,GAAQ,EAAE,CAAA;IAEtB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACpC,IAAI,WAAW,GAAG,KAAK,CAAA;QACvB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACvC,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;gBACzB,WAAW,GAAG,IAAI,CAAA;gBAClB,MAAK;YACP,CAAC;QACH,CAAC;QACD,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA;QACrB,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC;AAOD,MAAM,UAAU,aAAa,CAAI,GAAQ;IACvC,MAAM,MAAM,GAAQ,EAAE,CAAA;IAEtB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACpC,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAA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I,CAAC,CAAA;YACnB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QACnB,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC;AAmBD,MAAM,UAAU,QAAQ,CACtB,GAAQ,EACR,GAAY;IAEZ,MAAM,IAAI,GAAG,IAAI,GAAG,EAAE,CAAA;IACtB,OAAO,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;QACvB,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAA;QACvB,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;YACpB,OAAO,KAAK,CAAA;QACd,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;QACf,OAAO,IAAI,CAAA;IACb,CAAC,CAAC,CAAA;AACJ,CAAC;AAoBD,MAAM,UAAU,UAAU,CAAO,GAAQ,EAAE,EAAkB;IAC3D,MAAM,IAAI,GAAG,IAAI,GAAG,EAAK,CAAA;IACzB,OAAO,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;QACvB,MAAM,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,CAAA;QACpB,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YAClB,OAAO,KAAK,CAAA;QACd,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;QACb,OAAO,IAAI,CAAA;IACb,CAAC,CAAC,CAAA;AACJ,CAAC;AAKD,MAAM,UAAU,aAAa,CAAC,GAAa;IACzC,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAA;AAChD,CAAC"}
@@ -0,0 +1 @@
1
+ export declare function dateRange(start: Date | string | number, end: Date | string | number, step?: number): Date[];
@@ -0,0 +1,18 @@
1
+ export function dateRange(start, end, step = 1) {
2
+ const startDate = typeof start === 'object' ? start : new Date(start);
3
+ const endDate = typeof end === 'object' ? end : new Date(end);
4
+ if (isNaN(startDate.getTime()) || isNaN(endDate.getTime())) {
5
+ throw new Error('Invalid date');
6
+ }
7
+ if (step <= 0) {
8
+ throw new Error('Step must be greater than 0');
9
+ }
10
+ const result = [];
11
+ const current = new Date(startDate);
12
+ while (current <= endDate) {
13
+ result.push(new Date(current));
14
+ current.setDate(current.getDate() + step);
15
+ }
16
+ return result;
17
+ }
18
+ //# sourceMappingURL=dateRange.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dateRange.js","sourceRoot":"","sources":["../../../../src/functions/data/date/dateRange.ts"],"names":[],"mappings":"AAoBA,MAAM,UAAU,SAAS,CACvB,KAA6B,EAC7B,GAA2B,EAC3B,OAAe,CAAC;IAEhB,MAAM,SAAS,GAAG,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,CAAA;IACrE,MAAM,OAAO,GAAG,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,CAAA;IAE7D,IAAI,KAAK,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC;QAC3D,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;IACjC,CAAC;IAED,IAAI,IAAI,IAAI,CAAC,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAA;IAChD,CAAC;IAED,MAAM,MAAM,GAAW,EAAE,CAAA;IACzB,MAAM,OAAO,GAAG,IAAI,IAAI,CAAC,SAAS,CAAC,CAAA;IAEnC,OAAO,OAAO,IAAI,OAAO,EAAE,CAAC;QAC1B,MAAM,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC,CAAA;QAC9B,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAA;IAC3C,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC"}
@@ -0,0 +1 @@
1
+ export declare function formatDate(date: Date | number | string, format?: string): string;
@@ -0,0 +1,21 @@
1
+ export function formatDate(date, format = 'YYYY-MM-DD HH:mm:ss') {
2
+ const d = typeof date === 'object' ? date : new Date(date);
3
+ if (isNaN(d.getTime())) {
4
+ throw new Error('Invalid date');
5
+ }
6
+ const pad = (num) => String(num).padStart(2, '0');
7
+ const replacements = {
8
+ 'YYYY': String(d.getFullYear()),
9
+ 'MM': pad(d.getMonth() + 1),
10
+ 'DD': pad(d.getDate()),
11
+ 'HH': pad(d.getHours()),
12
+ 'mm': pad(d.getMinutes()),
13
+ 'ss': pad(d.getSeconds())
14
+ };
15
+ let result = format;
16
+ for (const [key, value] of Object.entries(replacements)) {
17
+ result = result.replace(key, value);
18
+ }
19
+ return result;
20
+ }
21
+ //# sourceMappingURL=formatDate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatDate.js","sourceRoot":"","sources":["../../../../src/functions/data/date/formatDate.ts"],"names":[],"mappings":"AA2BA,MAAM,UAAU,UAAU,CACxB,IAA4B,EAC5B,SAAiB,qBAAqB;IAEtC,MAAM,CAAC,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,CAAA;IAE1D,IAAI,KAAK,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC;QACvB,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;IACjC,CAAC;IAED,MAAM,GAAG,GAAG,CAAC,GAAW,EAAU,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAA;IAEjE,MAAM,YAAY,GAA2B;QAC3C,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;QAC/B,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;QAC3B,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;QACtB,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;QACvB,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC;QACzB,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC;KAC1B,CAAA;IAED,IAAI,MAAM,GAAG,MAAM,CAAA;IACnB,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,CAAC;QACxD,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;IACrC,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC"}
@@ -0,0 +1 @@
1
+ export declare function timeAgo(date: Date | number | string, locale?: 'zh' | 'en'): string;