yummies 5.4.6 → 5.4.7

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 (290) hide show
  1. package/async.d.ts +28 -0
  2. package/async.d.ts.map +1 -0
  3. package/async.js +62 -0
  4. package/{src/common.ts → common.d.ts} +3 -14
  5. package/common.d.ts.map +1 -0
  6. package/common.js +14 -0
  7. package/complex/counter.d.ts +15 -0
  8. package/complex/counter.d.ts.map +1 -0
  9. package/complex/counter.js +17 -0
  10. package/complex/global-config.d.ts +11 -0
  11. package/complex/global-config.d.ts.map +1 -0
  12. package/complex/global-config.js +41 -0
  13. package/complex/index.d.ts +4 -0
  14. package/complex/index.d.ts.map +1 -0
  15. package/complex/modules-factory.d.ts +49 -0
  16. package/complex/modules-factory.d.ts.map +1 -0
  17. package/complex/modules-factory.js +46 -0
  18. package/cookie.d.ts +3 -0
  19. package/cookie.d.ts.map +1 -0
  20. package/cookie.js +9 -0
  21. package/css.d.ts +36 -0
  22. package/css.d.ts.map +1 -0
  23. package/css.js +20 -0
  24. package/data.d.ts +4 -0
  25. package/data.d.ts.map +1 -0
  26. package/data.js +52 -0
  27. package/date-time.d.ts +28 -0
  28. package/date-time.d.ts.map +1 -0
  29. package/date-time.js +160 -0
  30. package/device.d.ts +8 -0
  31. package/device.d.ts.map +1 -0
  32. package/device.js +21 -0
  33. package/encodings.d.ts +2 -0
  34. package/encodings.d.ts.map +1 -0
  35. package/encodings.js +267 -0
  36. package/errors.d.ts +19 -0
  37. package/errors.d.ts.map +1 -0
  38. package/errors.js +30 -0
  39. package/file.d.ts +3 -0
  40. package/file.d.ts.map +1 -0
  41. package/file.js +24 -0
  42. package/format/_exports.d.ts +5 -0
  43. package/format/_exports.d.ts.map +1 -0
  44. package/format/constants.d.ts +4 -0
  45. package/format/constants.d.ts.map +1 -0
  46. package/{src/format/constants.ts → format/constants.js} +0 -2
  47. package/format/index.d.ts +3 -0
  48. package/format/index.d.ts.map +1 -0
  49. package/{src/format/index.ts → format/index.js} +0 -1
  50. package/format/number.d.ts +36 -0
  51. package/format/number.d.ts.map +1 -0
  52. package/format/number.js +44 -0
  53. package/format/percent.d.ts +15 -0
  54. package/format/percent.d.ts.map +1 -0
  55. package/format/percent.js +23 -0
  56. package/format/skip-spaces.d.ts +5 -0
  57. package/format/skip-spaces.d.ts.map +1 -0
  58. package/format/skip-spaces.js +4 -0
  59. package/html.d.ts +44 -0
  60. package/html.d.ts.map +1 -0
  61. package/html.js +182 -0
  62. package/id.d.ts +63 -0
  63. package/id.d.ts.map +1 -0
  64. package/{src/id.ts → id.js} +6 -16
  65. package/imports.d.ts +15 -0
  66. package/imports.d.ts.map +1 -0
  67. package/imports.js +40 -0
  68. package/math.d.ts +13 -0
  69. package/math.d.ts.map +1 -0
  70. package/math.js +17 -0
  71. package/media.d.ts +20 -0
  72. package/media.d.ts.map +1 -0
  73. package/media.js +103 -0
  74. package/mobx/apply-observable.d.ts +4 -0
  75. package/mobx/apply-observable.d.ts.map +1 -0
  76. package/mobx/apply-observable.js +12 -0
  77. package/mobx/create-enhanced-atom.d.ts +11 -0
  78. package/mobx/create-enhanced-atom.d.ts.map +1 -0
  79. package/mobx/create-enhanced-atom.js +12 -0
  80. package/mobx/deep-observable-struct.d.ts +7 -0
  81. package/mobx/deep-observable-struct.d.ts.map +1 -0
  82. package/mobx/deep-observable-struct.js +57 -0
  83. package/mobx/get-mobx-administration.d.ts +6 -0
  84. package/mobx/get-mobx-administration.d.ts.map +1 -0
  85. package/mobx/get-mobx-administration.js +2 -0
  86. package/mobx/index.d.ts +6 -0
  87. package/mobx/index.d.ts.map +1 -0
  88. package/mobx/lazy-observe.d.ts +8 -0
  89. package/mobx/lazy-observe.d.ts.map +1 -0
  90. package/mobx/lazy-observe.js +43 -0
  91. package/ms.d.ts +19 -0
  92. package/ms.d.ts.map +1 -0
  93. package/ms.js +18 -0
  94. package/number.d.ts +8 -0
  95. package/number.d.ts.map +1 -0
  96. package/number.js +13 -0
  97. package/package.json +399 -3
  98. package/parser/_exports.d.ts +4 -0
  99. package/parser/_exports.d.ts.map +1 -0
  100. package/parser/index.d.ts +3 -0
  101. package/parser/index.d.ts.map +1 -0
  102. package/{src/parser/index.ts → parser/index.js} +0 -1
  103. package/parser/number.d.ts +21 -0
  104. package/parser/number.d.ts.map +1 -0
  105. package/parser/number.js +44 -0
  106. package/parser/percent.d.ts +4 -0
  107. package/parser/percent.d.ts.map +1 -0
  108. package/parser/percent.js +4 -0
  109. package/parser/string.d.ts +7 -0
  110. package/parser/string.d.ts.map +1 -0
  111. package/parser/string.js +14 -0
  112. package/price.d.ts +6 -0
  113. package/price.d.ts.map +1 -0
  114. package/price.js +17 -0
  115. package/random.d.ts +9 -0
  116. package/random.d.ts.map +1 -0
  117. package/random.js +14 -0
  118. package/react/hooks/index.d.ts +22 -0
  119. package/react/hooks/index.d.ts.map +1 -0
  120. package/react/hooks/use-abort-controller.d.ts +2 -0
  121. package/react/hooks/use-abort-controller.d.ts.map +1 -0
  122. package/react/hooks/use-abort-controller.js +11 -0
  123. package/react/hooks/use-abort-signal.d.ts +2 -0
  124. package/react/hooks/use-abort-signal.d.ts.map +1 -0
  125. package/{src/react/hooks/use-abort-signal.ts → react/hooks/use-abort-signal.js} +1 -2
  126. package/react/hooks/use-click-outside.d.ts +9 -0
  127. package/react/hooks/use-click-outside.d.ts.map +1 -0
  128. package/react/hooks/use-click-outside.js +13 -0
  129. package/react/hooks/use-constant.d.ts +9 -0
  130. package/react/hooks/use-constant.d.ts.map +1 -0
  131. package/{src/react/hooks/use-constant.ts → react/hooks/use-constant.js} +6 -9
  132. package/react/hooks/use-define-ref.d.ts +10 -0
  133. package/react/hooks/use-define-ref.d.ts.map +1 -0
  134. package/{src/react/hooks/use-define-ref.ts → react/hooks/use-define-ref.js} +7 -10
  135. package/react/hooks/use-element-ref.d.ts +2 -0
  136. package/react/hooks/use-element-ref.d.ts.map +1 -0
  137. package/react/hooks/use-element-ref.js +8 -0
  138. package/react/hooks/use-event-listener.d.ts +8 -0
  139. package/react/hooks/use-event-listener.d.ts.map +1 -0
  140. package/react/hooks/use-event-listener.js +13 -0
  141. package/react/hooks/use-event.d.ts +3 -0
  142. package/react/hooks/use-event.d.ts.map +1 -0
  143. package/react/hooks/use-event.js +19 -0
  144. package/react/hooks/use-flag.d.ts +8 -0
  145. package/react/hooks/use-flag.d.ts.map +1 -0
  146. package/react/hooks/use-flag.js +15 -0
  147. package/react/hooks/use-force-update.d.ts +2 -0
  148. package/react/hooks/use-force-update.d.ts.map +1 -0
  149. package/react/hooks/use-force-update.js +7 -0
  150. package/react/hooks/use-initial-height.d.ts +5 -0
  151. package/react/hooks/use-initial-height.d.ts.map +1 -0
  152. package/react/hooks/use-initial-height.js +11 -0
  153. package/react/hooks/use-instance.d.ts +27 -0
  154. package/react/hooks/use-instance.d.ts.map +1 -0
  155. package/{src/react/hooks/use-instance.ts → react/hooks/use-instance.js} +7 -29
  156. package/react/hooks/use-intersection-observer.d.ts +2 -0
  157. package/react/hooks/use-intersection-observer.d.ts.map +1 -0
  158. package/react/hooks/use-intersection-observer.js +10 -0
  159. package/react/hooks/use-last-defined-value.d.ts +2 -0
  160. package/react/hooks/use-last-defined-value.d.ts.map +1 -0
  161. package/react/hooks/use-last-defined-value.js +8 -0
  162. package/react/hooks/use-last-value-ref.d.ts +2 -0
  163. package/react/hooks/use-last-value-ref.d.ts.map +1 -0
  164. package/react/hooks/use-last-value-ref.js +8 -0
  165. package/react/hooks/use-life-cycle.d.ts +5 -0
  166. package/react/hooks/use-life-cycle.d.ts.map +1 -0
  167. package/react/hooks/use-life-cycle.js +10 -0
  168. package/react/hooks/use-resize-observer.d.ts +2 -0
  169. package/react/hooks/use-resize-observer.d.ts.map +1 -0
  170. package/react/hooks/use-resize-observer.js +11 -0
  171. package/react/hooks/use-sync-ref.d.ts +2 -0
  172. package/react/hooks/use-sync-ref.d.ts.map +1 -0
  173. package/react/hooks/use-sync-ref.js +6 -0
  174. package/react/hooks/use-toggle.d.ts +2 -0
  175. package/react/hooks/use-toggle.d.ts.map +1 -0
  176. package/react/hooks/use-toggle.js +6 -0
  177. package/react/hooks/use-value.d.ts +5 -0
  178. package/react/hooks/use-value.d.ts.map +1 -0
  179. package/react/hooks/use-value.js +8 -0
  180. package/react/hooks/use-visibility-state.d.ts +2 -0
  181. package/react/hooks/use-visibility-state.d.ts.map +1 -0
  182. package/react/hooks/use-visibility-state.js +14 -0
  183. package/react/index.d.ts +2 -0
  184. package/react/index.d.ts.map +1 -0
  185. package/sound.d.ts +7 -0
  186. package/sound.d.ts.map +1 -0
  187. package/sound.js +12 -0
  188. package/storage.d.ts +39 -0
  189. package/storage.d.ts.map +1 -0
  190. package/storage.js +43 -0
  191. package/text.d.ts +15 -0
  192. package/text.d.ts.map +1 -0
  193. package/text.js +48 -0
  194. package/type-guard/_exports.d.ts +86 -0
  195. package/type-guard/_exports.d.ts.map +1 -0
  196. package/type-guard/_exports.js +125 -0
  197. package/type-guard/index.d.ts +3 -0
  198. package/type-guard/index.d.ts.map +1 -0
  199. package/{src/type-guard/index.ts → type-guard/index.js} +0 -1
  200. package/utility-types.d.ts +395 -0
  201. package/utils/types.d.ts +395 -0
  202. package/utils/types.d.ts.map +1 -0
  203. package/utils/types.js +1 -0
  204. package/vibrate.d.ts +5 -0
  205. package/vibrate.d.ts.map +1 -0
  206. package/vibrate.js +8 -0
  207. package/.changeset/README.md +0 -8
  208. package/.changeset/config.json +0 -11
  209. package/.github/FUNDING.yml +0 -1
  210. package/.github/workflows/main.yml +0 -34
  211. package/.github/workflows/version-or-publish.yml +0 -45
  212. package/.nvmrc +0 -1
  213. package/.vscode/settings.json +0 -19
  214. package/CHANGELOG.md +0 -215
  215. package/CONTRIBUTING.md +0 -8
  216. package/Makefile +0 -7
  217. package/biome.json +0 -3
  218. package/commitfmt.toml +0 -18
  219. package/lefthook.yml +0 -14
  220. package/scripts/post-build.ts +0 -71
  221. package/src/async.ts +0 -86
  222. package/src/complex/counter.test.ts +0 -41
  223. package/src/complex/counter.ts +0 -40
  224. package/src/complex/global-config.ts +0 -55
  225. package/src/complex/modules-factory.ts +0 -65
  226. package/src/cookie.ts +0 -11
  227. package/src/css.ts +0 -60
  228. package/src/data.test.ts +0 -99
  229. package/src/data.ts +0 -65
  230. package/src/date-time.test.ts +0 -119
  231. package/src/date-time.ts +0 -236
  232. package/src/device.ts +0 -42
  233. package/src/encodings.ts +0 -270
  234. package/src/errors.ts +0 -40
  235. package/src/file.ts +0 -25
  236. package/src/format/number.test.ts +0 -16
  237. package/src/format/number.ts +0 -96
  238. package/src/format/percent.ts +0 -40
  239. package/src/format/skip-spaces.ts +0 -4
  240. package/src/html.ts +0 -238
  241. package/src/imports.ts +0 -52
  242. package/src/math.ts +0 -20
  243. package/src/media.ts +0 -134
  244. package/src/mobx/apply-observable.ts +0 -20
  245. package/src/mobx/create-enhanced-atom.ts +0 -28
  246. package/src/mobx/deep-observable-struct.test.ts +0 -69
  247. package/src/mobx/deep-observable-struct.ts +0 -69
  248. package/src/mobx/get-mobx-administration.ts +0 -10
  249. package/src/mobx/lazy-observe.ts +0 -59
  250. package/src/ms.ts +0 -20
  251. package/src/number.ts +0 -14
  252. package/src/parser/number.test.ts +0 -38
  253. package/src/parser/number.ts +0 -73
  254. package/src/parser/percent.ts +0 -11
  255. package/src/parser/string.ts +0 -29
  256. package/src/price.ts +0 -33
  257. package/src/random.ts +0 -27
  258. package/src/react/hooks/use-abort-controller.ts +0 -15
  259. package/src/react/hooks/use-click-outside.ts +0 -27
  260. package/src/react/hooks/use-element-ref.ts +0 -11
  261. package/src/react/hooks/use-event-listener.ts +0 -29
  262. package/src/react/hooks/use-event.ts +0 -23
  263. package/src/react/hooks/use-flag.ts +0 -27
  264. package/src/react/hooks/use-force-update.ts +0 -9
  265. package/src/react/hooks/use-initial-height.ts +0 -16
  266. package/src/react/hooks/use-intersection-observer.ts +0 -18
  267. package/src/react/hooks/use-last-defined-value.ts +0 -9
  268. package/src/react/hooks/use-last-value-ref.ts +0 -11
  269. package/src/react/hooks/use-life-cycle.ts +0 -17
  270. package/src/react/hooks/use-resize-observer.ts +0 -14
  271. package/src/react/hooks/use-sync-ref.ts +0 -7
  272. package/src/react/hooks/use-toggle.ts +0 -9
  273. package/src/react/hooks/use-value.ts +0 -10
  274. package/src/react/hooks/use-visibility-state.ts +0 -19
  275. package/src/sound.ts +0 -15
  276. package/src/storage.ts +0 -137
  277. package/src/text.test.ts +0 -91
  278. package/src/text.ts +0 -60
  279. package/src/type-guard/_exports.ts +0 -154
  280. package/src/type-guard/index.test.ts +0 -127
  281. package/src/vibrate.ts +0 -8
  282. package/tsconfig.json +0 -26
  283. package/tsconfig.test.json +0 -33
  284. package/vitest.config.ts +0 -20
  285. /package/{src/complex/index.ts → complex/index.js} +0 -0
  286. /package/{src/format/_exports.ts → format/_exports.js} +0 -0
  287. /package/{src/mobx/index.ts → mobx/index.js} +0 -0
  288. /package/{src/parser/_exports.ts → parser/_exports.js} +0 -0
  289. /package/{src/react/hooks/index.ts → react/hooks/index.js} +0 -0
  290. /package/{src/react/index.ts → react/index.js} +0 -0
package/CHANGELOG.md DELETED
@@ -1,215 +0,0 @@
1
- # yummies
2
-
3
- ## 5.4.6
4
-
5
- ### Patch Changes
6
-
7
- - [`18f0ea5`](https://github.com/js2me/yummies/commit/18f0ea588a10e07498593cf5986a1eeccc0d4eeb) Thanks [@js2me](https://github.com/js2me)! - revert back zshy
8
-
9
- ## 5.4.5
10
-
11
- ### Patch Changes
12
-
13
- - [`d2ae5f8`](https://github.com/js2me/yummies/commit/d2ae5f81a94022df0375248801df64b04ed6a862) Thanks [@js2me](https://github.com/js2me)! - try to fix utils/types exports
14
-
15
- ## 5.4.4
16
-
17
- ### Patch Changes
18
-
19
- - [`642160b`](https://github.com/js2me/yummies/commit/642160ba216ee9ba0c05b4872ded3cfe3bf61a6a) Thanks [@js2me](https://github.com/js2me)! - try to fix utils/types export
20
-
21
- ## 5.4.3
22
-
23
- ### Patch Changes
24
-
25
- - [`c7002f4`](https://github.com/js2me/yummies/commit/c7002f4212f56a6c20ab56a0133b7b5a049bca31) Thanks [@js2me](https://github.com/js2me)! - fix try to fix types and utility types exports
26
-
27
- ## 5.4.2
28
-
29
- ### Patch Changes
30
-
31
- - [`7a6cf44`](https://github.com/js2me/yummies/commit/7a6cf446a1d4de6080d209f34112b2f0807c6b4c) Thanks [@js2me](https://github.com/js2me)! - try to fix util types exports
32
-
33
- ## 5.4.1
34
-
35
- ### Patch Changes
36
-
37
- - [`15b8d1b`](https://github.com/js2me/yummies/commit/15b8d1b442ca324b8812b7ec997cc69b3e4885c6) Thanks [@js2me](https://github.com/js2me)! - fix missing css exports
38
-
39
- ## 5.4.0
40
-
41
- ### Minor Changes
42
-
43
- - [`37613c9`](https://github.com/js2me/yummies/commit/37613c9246c1908dfc5c37cafd0cffd9a7291455) Thanks [@js2me](https://github.com/js2me)! - refactor switch bundler to zshy
44
-
45
- ## 5.3.2
46
-
47
- ### Patch Changes
48
-
49
- - [`fd831ba`](https://github.com/js2me/yummies/commit/fd831ba541ac842cd39b8b2665d81d15b194282c) Thanks [@js2me](https://github.com/js2me)! - fixed bounded method for report (enhancedAtom)
50
-
51
- ## 5.3.1
52
-
53
- ### Patch Changes
54
-
55
- - [`4a37b3c`](https://github.com/js2me/yummies/commit/4a37b3c83761de9feddfa2f38683aa13951820bf) Thanks [@js2me](https://github.com/js2me)! - fixed required handler for createEnhancedAtom
56
-
57
- ## 5.3.0
58
-
59
- ### Minor Changes
60
-
61
- - [`05bc4cc`](https://github.com/js2me/yummies/commit/05bc4cc4a87b1db950b23dc5a53e793a11f6bf80) Thanks [@js2me](https://github.com/js2me)! - added `createEnhancedAtom` for mobx utilities
62
-
63
- ## 5.2.0
64
-
65
- ### Minor Changes
66
-
67
- - [`5412878`](https://github.com/js2me/yummies/commit/541287858790a1090e3f892d101979b7679e44a1) Thanks [@js2me](https://github.com/js2me)! - added `ReadonlyKeys` type"
68
-
69
- ## 5.1.0
70
-
71
- ### Minor Changes
72
-
73
- - [`0f570aa`](https://github.com/js2me/yummies/commit/0f570aa4d48bbab978a78f760ff1d42bb1baba80) Thanks [@js2me](https://github.com/js2me)! - add JSDOC for utils types
74
-
75
- ## 5.0.0
76
-
77
- ### Major Changes
78
-
79
- - [`d9c2c4e`](https://github.com/js2me/yummies/commit/d9c2c4ecae0e0aad3225fa05dd6224b525890a03) Thanks [@js2me](https://github.com/js2me)! - replaced `sanitizeHtml` lib for use (insane -> dompurify)
80
-
81
- ## 4.14.1
82
-
83
- ### Patch Changes
84
-
85
- - [`d5220ae`](https://github.com/js2me/yummies/commit/d5220aea466c099ca80ef892e62f7c83d6a3df5a) Thanks [@js2me](https://github.com/js2me)! - fix missing import for applyObservable
86
-
87
- ## 4.14.0
88
-
89
- ### Minor Changes
90
-
91
- - [`bf68b60`](https://github.com/js2me/yummies/commit/bf68b600620724334e83f8fe7a99502d79f67aaa) Thanks [@js2me](https://github.com/js2me)! - added `applyObservable` for mobx utils
92
-
93
- ## 4.13.0
94
-
95
- ### Minor Changes
96
-
97
- - [`ed2c909`](https://github.com/js2me/yummies/commit/ed2c909b90a0a048c3d04330a5e1282063454084) Thanks [@js2me](https://github.com/js2me)! - added `yummies/react` set of React hooks
98
-
99
- ## 4.12.2
100
-
101
- ### Patch Changes
102
-
103
- - [`53bd560`](https://github.com/js2me/yummies/commit/53bd560a125f12e1c0d77342aac30cd2c09e1f19) Thanks [@js2me](https://github.com/js2me)! - fixed `getMobxAdministration` bad resolve typings
104
-
105
- ## 4.12.1
106
-
107
- ### Patch Changes
108
-
109
- - [`7fed8c3`](https://github.com/js2me/yummies/commit/7fed8c3fc80a6fe242fbdd15256ffbac790b55ac) Thanks [@js2me](https://github.com/js2me)! - make context property is optional for `lazyObserve`
110
-
111
- ## 4.12.0
112
-
113
- ### Minor Changes
114
-
115
- - [`b3b73cb`](https://github.com/js2me/yummies/commit/b3b73cbd853cc92d4dff093194925359c72a4e2f) Thanks [@js2me](https://github.com/js2me)! - added mobx utilities
116
-
117
- ## 4.11.1
118
-
119
- ### Patch Changes
120
-
121
- - [`319db7a`](https://github.com/js2me/yummies/commit/319db7a7aa1437416192cc7f43946db61ab2cfb4) Thanks [@js2me](https://github.com/js2me)! - fixed format number
122
-
123
- ## 4.11.0
124
-
125
- ### Minor Changes
126
-
127
- - [`ec70c99`](https://github.com/js2me/yummies/commit/ec70c99dac0caa551848ffc2e1627a2e86fbc1ab) Thanks [@js2me](https://github.com/js2me)! - added `format.*` and `parser.*` number\string utilites
128
-
129
- ## 4.10.0
130
-
131
- ### Minor Changes
132
-
133
- - [`c4bc839`](https://github.com/js2me/yummies/commit/c4bc8399f16800225b83789d2fb5c989e7e81c4e) Thanks [@js2me](https://github.com/js2me)! - added `ExtractEnumValues` type
134
-
135
- ## 4.9.1
136
-
137
- ### Patch Changes
138
-
139
- - [`3313f7c`](https://github.com/js2me/yummies/commit/3313f7c8aa7fcdd929230e84f81b95782e483449) Thanks [@js2me](https://github.com/js2me)! - fix isRegExp type guard
140
-
141
- - [`2c674e2`](https://github.com/js2me/yummies/commit/2c674e26cf1137f174cdac81e13fdd4fd612ccbc) Thanks [@js2me](https://github.com/js2me)! - remove isNaN and isInfinite as type guard works because they crash code
142
-
143
- ## 4.9.0
144
-
145
- ### Minor Changes
146
-
147
- - [`0e77d75`](https://github.com/js2me/yummies/commit/0e77d75bac1ea494a445fd16b7096bbbd212f79b) Thanks [@js2me](https://github.com/js2me)! - update tailwind-merge to latest
148
-
149
- ## 4.8.0
150
-
151
- ### Minor Changes
152
-
153
- - [`7b5168f`](https://github.com/js2me/yummies/commit/7b5168f5fe16b37ce122ee5aa6cbc0a0dc41fae5) Thanks [@js2me](https://github.com/js2me)! - added decrement for `createCounter`
154
-
155
- ### Patch Changes
156
-
157
- - [`d5aba14`](https://github.com/js2me/yummies/commit/d5aba14d3fc40e2fe390d35b4cf0056c76e37cbc) Thanks [@js2me](https://github.com/js2me)! - rename `CounterFn` -> `Counter` (mark deprecations)
158
-
159
- ## 4.7.1
160
-
161
- ### Patch Changes
162
-
163
- - fix createCounter complex util work
164
-
165
- ## 4.7.0
166
-
167
- ### Minor Changes
168
-
169
- - [`59c85ad`](https://github.com/js2me/yummies/commit/59c85ad60a5cb8a03b501a0b8476a0bb94dc5abf) Thanks [@js2me](https://github.com/js2me)! - improve `createCounter` fn (add `value`, `counter` properties)
170
-
171
- ## 4.6.1
172
-
173
- ### Patch Changes
174
-
175
- - [`9499c77`](https://github.com/js2me/yummies/commit/9499c77f10f8f84c615321c4aea01e508b0e8740) Thanks [@js2me](https://github.com/js2me)! - fix cva typings
176
-
177
- ## 4.6.0
178
-
179
- ### Minor Changes
180
-
181
- - [`9b4f057`](https://github.com/js2me/yummies/commit/9b4f057011397891864a0168555a4a0f6f1bd577) Thanks [@js2me](https://github.com/js2me)! - export cva type VariantProps
182
-
183
- ### Patch Changes
184
-
185
- - [`589e900`](https://github.com/js2me/yummies/commit/589e9006c9224ef81fd4c4b9baf95455205a1609) Thanks [@js2me](https://github.com/js2me)! - added (html) `isPreferesDarkTheme`, `isPrefersLightTheme`
186
-
187
- ## 4.5.0
188
-
189
- ### Minor Changes
190
-
191
- - [`4adf401`](https://github.com/js2me/yummies/commit/4adf4010dd1e83589a6d4a432abdae8f59ac4b97) Thanks [@js2me](https://github.com/js2me)! - rename AllPropertiesOptional -> IsPartial, add PartialIf type
192
-
193
- ## 4.4.0
194
-
195
- ### Minor Changes
196
-
197
- - [`88b2b77`](https://github.com/js2me/yummies/commit/88b2b771b6ae8841f423eee14284c59af74381e6) Thanks [@js2me](https://github.com/js2me)! - added `round` number util
198
-
199
- ## 4.3.1
200
-
201
- ### Patch Changes
202
-
203
- - [`6804f06`](https://github.com/js2me/yummies/commit/6804f06dd510e8feecc3ee3557e8051a48ac0e0d) Thanks [@js2me](https://github.com/js2me)! - fix getErrorText fallback unknown error text after empty enhance method call
204
-
205
- ## 4.3.0
206
-
207
- ### Minor Changes
208
-
209
- - [`4736150`](https://github.com/js2me/yummies/commit/4736150eee907cfd0a075c176787db343cbe005c) Thanks [@js2me](https://github.com/js2me)! - (ci) added npm gh release publish automation
210
-
211
- ## 4.2.6
212
-
213
- ### Patch Changes
214
-
215
- - **Changelog**: https://github.com/js2me/yummies/compare/v4.2.5...v4.2.6
package/CONTRIBUTING.md DELETED
@@ -1,8 +0,0 @@
1
- # Contributing guide
2
-
3
- 1. Fork repository
4
- 2. Switch to `master` branch
5
- 3. Fix bugs or create features
6
- 4. Use command `pnpm changeset` to describe what you do
7
- 5. Commit with message using [Conventional commits](https://www.conventionalcommits.org/)
8
- 6. Open PR!
package/Makefile DELETED
@@ -1,7 +0,0 @@
1
- clean:
2
- rm -rf node_modules
3
- install:
4
- pnpm i
5
- reinstall:
6
- make clean
7
- make install
package/biome.json DELETED
@@ -1,3 +0,0 @@
1
- {
2
- "extends": ["js2me-biome-config/base.json", "js2me-biome-config/lib.json"]
3
- }
package/commitfmt.toml DELETED
@@ -1,18 +0,0 @@
1
- [lint.header]
2
- type-enum = ["chore", "ci", "feat", "fix", "refactor", "style", "test", "docs"]
3
- description-case = "lower-first"
4
- description-max-length = 72
5
- description-full-stop = true
6
- type-required = true
7
-
8
- [lint.body]
9
- max-line-length = 72
10
- case = "upper-first"
11
-
12
- [lint.footer]
13
- breaking-exclamation = true
14
-
15
- [[additional-footers]]
16
- key = "Ticket-ID"
17
- branch-pattern = "(?:.*)/(?<TICKET_ID>[A-Z0-9-]+)/?(?:.*)"
18
- value = "${{ TICKET_ID }}"
package/lefthook.yml DELETED
@@ -1,14 +0,0 @@
1
- pre-commit:
2
- parallel: true
3
- commands:
4
- lint:
5
- run: pnpm exec biome check --write --no-errors-on-unmatched --files-ignore-unknown=true --colors=off {staged_files}
6
- stage_fixed: true
7
- prepare-commit-msg:
8
- commands:
9
- format-commit-message:
10
- run: pnpm exec commitfmt
11
- pre-push:
12
- commands:
13
- check-typings:
14
- run: pnpm exec tsc --noEmit
@@ -1,71 +0,0 @@
1
- import {
2
- getInfoFromChangelog,
3
- postBuildScript,
4
- publishGhRelease,
5
- publishScript,
6
- } from "js2me-exports-post-build-script";
7
- import path from "path";
8
-
9
- postBuildScript({
10
- buildDir: "dist",
11
- rootDir: ".",
12
- srcDirName: "src",
13
- filesToCopy: ["LICENSE", "README.md", "assets"],
14
- updateVersion: process.env.PUBLISH_VERSION as "patch" | "minor" | "major" | undefined,
15
- onDone: (versionsDiff, targetPackageJson, { $ }) => {
16
- $("pnpm test");
17
- $(`cp dist/utils/types.d.ts dist/utility-types.d.ts`);
18
- $(`sed -i 's/^export type/type/' dist/utility-types.d.ts`);
19
-
20
- if (process.env.PUBLISH) {
21
- if (!process.env.CI) {
22
- $(`pnpm test`);
23
- $("pnpm changeset version");
24
- }
25
-
26
- // remove all test compiled files. TODO: find a better to ignore test files
27
- $("rm dist/**/*.test.*");
28
-
29
- const nextVersion = versionsDiff?.next ?? targetPackageJson.data.version;
30
-
31
- const publishOutput = publishScript({
32
- gitTagFormat: "<tag>",
33
- nextVersion: nextVersion,
34
- packageManager: "pnpm",
35
- commitAllCurrentChanges: true,
36
- createTag: true,
37
- safe: true,
38
- onAlreadyPublishedThisVersion: () => {
39
- console.warn(`${nextVersion} already published`);
40
- },
41
- cleanupCommand: "pnpm clean",
42
- targetPackageJson,
43
- });
44
-
45
- if (process.env.CI) {
46
- if (publishOutput?.publishedGitTag) {
47
- const { whatChangesText } = getInfoFromChangelog(
48
- nextVersion,
49
- path.resolve(targetPackageJson.locationDir, "../CHANGELOG.md"),
50
- targetPackageJson.repositoryUrl,
51
- );
52
-
53
- publishGhRelease({
54
- authToken: process.env.GITHUB_TOKEN!,
55
- body: whatChangesText,
56
- owner: targetPackageJson.ghRepoData.user,
57
- repo: targetPackageJson.ghRepoData.packageName,
58
- version: nextVersion,
59
- })
60
- .then((r) => {
61
- console.info("published new gh release", r);
62
- })
63
- .catch((err) => {
64
- console.error("failed to publish new gh release", err);
65
- process.exit(1);
66
- });
67
- }
68
- }
69
- }
70
- },
71
- });
package/src/async.ts DELETED
@@ -1,86 +0,0 @@
1
- /**
2
- * Создает промис, который будет ждать указанное количество ms, чтобы выполниться
3
- *
4
- * @param ms значение в миллисекундах
5
- * @returns Promise
6
- */
7
- export const sleep = (time: number = 0) =>
8
- new Promise((resolve) => setTimeout(resolve, time));
9
-
10
- /**
11
- * Создает промис, который будет ждать указанное количество ms, чтобы выполниться
12
- *
13
- * @deprecated используй {sleep}
14
- * @param ms значение в миллисекундах
15
- * @returns Promise
16
- */
17
- export const waitAsync = async (ms = 1000) =>
18
- new Promise((resolve) => setTimeout(resolve, ms));
19
-
20
- /**
21
- * Создает вызов requestAnimationFrame, посылая туда фукнцию {quitFn}, если она возвращает true,
22
- * тогда повторно не будет создан вызов requestAnimationFrame, иначе будут создаваться повторно
23
- * вызовы requestAnimationFrame до тем пор, пока эта функция не вернёт true
24
- *
25
- * @param quitFn - сама фукнция которая исполнится в requestAnimationFrame
26
- * @param asMicrotask - дополнительно оборачивает RAF в queueMicrotask
27
- * @returns void
28
- */
29
- export const endlessRAF = (
30
- quitFunction: () => boolean | void,
31
- asMicrotask?: boolean,
32
- ) => {
33
- if (quitFunction()) return;
34
-
35
- const raf = () =>
36
- requestAnimationFrame(() => endlessRAF(quitFunction, asMicrotask));
37
-
38
- if (asMicrotask) {
39
- queueMicrotask(raf);
40
- } else {
41
- raf();
42
- }
43
- };
44
-
45
- export function setAbortableTimeout(
46
- callback: VoidFunction,
47
- delayInMs?: number,
48
- signal?: AbortSignal,
49
- ) {
50
- let internalTimer: number | null = null;
51
-
52
- const handleAbort = () => {
53
- if (internalTimer == null) {
54
- return;
55
- }
56
- clearTimeout(internalTimer);
57
- internalTimer = null;
58
- };
59
-
60
- signal?.addEventListener('abort', handleAbort, { once: true });
61
-
62
- internalTimer = setTimeout(() => {
63
- signal?.removeEventListener('abort', handleAbort);
64
- callback();
65
- }, delayInMs);
66
- }
67
-
68
- export function setAbortableInterval(
69
- callback: VoidFunction,
70
- delayInMs?: number,
71
- signal?: AbortSignal,
72
- ) {
73
- let timer: number | null = null;
74
-
75
- const handleAbort = () => {
76
- if (timer == null) {
77
- return;
78
- }
79
- clearInterval(timer);
80
- timer = null;
81
- };
82
-
83
- signal?.addEventListener('abort', handleAbort, { once: true });
84
-
85
- timer = setInterval(callback, delayInMs);
86
- }
@@ -1,41 +0,0 @@
1
- import { describe } from 'node:test';
2
- import { expect, it } from 'vitest';
3
-
4
- import { createCounter } from './counter';
5
-
6
- describe('createCounter', () => {
7
- it('should have initial values', () => {
8
- const counter = createCounter(undefined, -1);
9
-
10
- expect(counter.counter).toBe(-1);
11
- expect(counter.value).toBe(-1);
12
- });
13
-
14
- it('should increment and update value and counter properties', () => {
15
- const counter = createCounter(undefined, -1);
16
-
17
- counter();
18
-
19
- expect(counter.counter).toBe(0);
20
- expect(counter.value).toBe(0);
21
- });
22
-
23
- it('should decrement and update value and counter properties', () => {
24
- const counter = createCounter(undefined, -1);
25
-
26
- counter.decrement();
27
-
28
- expect(counter.counter).toBe(-2);
29
- expect(counter.value).toBe(-2);
30
- });
31
-
32
- it('should increment and update processed value', () => {
33
- const counter = createCounter((counter) => `counter_${counter}_counter`);
34
-
35
- expect(counter.value).toBe(`counter_0_counter`);
36
-
37
- counter();
38
-
39
- expect(counter.value).toBe(`counter_1_counter`);
40
- });
41
- });
@@ -1,40 +0,0 @@
1
- export interface Counter<TValue = number> {
2
- (): TValue;
3
- counter: number;
4
- value: TValue;
5
- increment(): TValue;
6
- decrement(): TValue;
7
- reset(): void;
8
- }
9
-
10
- /**
11
- * @deprecated use {`Counter`}. Will be removed in next major release
12
- */
13
- export interface CounterFn<TValue = number> extends Counter<TValue> {}
14
-
15
- export const createCounter = <TValue = number>(
16
- processValue?: (value: number) => TValue,
17
- initial: number = 0,
18
- ): Counter<TValue> => {
19
- const update = (counter: number) => {
20
- fn.value = processValue?.(counter) ?? (counter as TValue);
21
- return fn.value;
22
- };
23
-
24
- const increment = () => update(++fn.counter);
25
- const decrement = () => update(--fn.counter);
26
-
27
- const fn: Counter<TValue> = increment as any;
28
-
29
- fn.increment = increment;
30
- fn.decrement = decrement;
31
-
32
- fn.reset = () => {
33
- fn.counter = initial;
34
- fn.value = processValue?.(initial) ?? (initial as TValue);
35
- };
36
-
37
- fn.reset();
38
-
39
- return fn as Counter<TValue>;
40
- };
@@ -1,55 +0,0 @@
1
- import type { AnyObject, Maybe } from '../utils/types.js';
2
-
3
- const createGlobalPoint = <TValue>(accessSymbol?: keyof any) => {
4
- if (accessSymbol == null) {
5
- let storedValue: TValue | undefined;
6
- return {
7
- get: (): TValue => storedValue!,
8
- set: (value: TValue): TValue => {
9
- storedValue = value;
10
- return value;
11
- },
12
- };
13
- }
14
-
15
- const _globalThis = globalThis as AnyObject;
16
-
17
- return {
18
- get: (): TValue => _globalThis[accessSymbol],
19
- set: (value: TValue): TValue => {
20
- _globalThis[accessSymbol] = value;
21
- return value;
22
- },
23
- };
24
- };
25
-
26
- /**
27
- * Создает глобальный конфиг, который может быть доступен в любой точке в коде
28
- */
29
- export const createGlobalConfig = <T extends AnyObject>(
30
- defaultValue: T,
31
- accessSymbol?: keyof any,
32
- ) => {
33
- const globalPoint = createGlobalPoint<T>(accessSymbol);
34
- return globalPoint.get() || globalPoint.set(defaultValue);
35
- };
36
-
37
- export const createGlobalDynamicConfig = <T extends AnyObject>(
38
- processFn: (change: Maybe<Partial<T>>, current: Maybe<T>) => T,
39
- accessSymbol?: keyof any,
40
- ) => {
41
- const globalPoint = createGlobalPoint<T | null | undefined>(accessSymbol);
42
-
43
- const getValue = () => {
44
- return globalPoint.get() ?? globalPoint.set(processFn(null, null))!;
45
- };
46
-
47
- return {
48
- get: getValue,
49
- set: globalPoint.set,
50
- update: (value: Partial<T>) => {
51
- const currentValue = getValue();
52
- Object.assign(currentValue, processFn(value, currentValue));
53
- },
54
- };
55
- };
@@ -1,65 +0,0 @@
1
- import type {
2
- AnyObject,
3
- Class,
4
- EmptyObject,
5
- IsPartial,
6
- } from '../utils/types.js';
7
-
8
- type ModuleLoaderConfig<TPredefinedDeps extends AnyObject = EmptyObject> = {
9
- factory<TInstance, TDeps extends TPredefinedDeps>(
10
- moduleClass: Class<TInstance, [TDeps]>,
11
- deps: TDeps,
12
- ): TInstance;
13
- } & (TPredefinedDeps extends EmptyObject
14
- ? { deps?: TPredefinedDeps }
15
- : { deps: TPredefinedDeps });
16
-
17
- /**
18
- * Класс `ModulesFactory` является универсальной фабрикой для создания экземпляров указанного класса с зависимостями.
19
- * Он использует объект конфигурации для определения того, как эти экземпляры создаются.
20
- *
21
- * Важное примечание - эта сущность работает только с классами конструктор которых имеет один параметр
22
- *
23
- * @template TPredefinedDeps - Тип, расширяющий `AnyObject`, представляющий предопределенные зависимости, которые использует фабрика.
24
- *
25
- * @example
26
- * ```
27
- * const factory = new ModulesFactory({
28
- * factory: (MyClass, deps) => new MyClass(deps),
29
- * deps: { someDependency: new Dependency() }
30
- * });
31
- *
32
- * const instance = factory.create(MyClass, { extraDependency: new ExtraDependency() });
33
- * ```
34
- */
35
- export class ModulesFactory<TPredefinedDeps extends AnyObject = EmptyObject> {
36
- /**
37
- * Создает новый экземпляр `ModulesFactory`.
38
- *
39
- * @param config - Объект конфигурации для фабрики, включающий функцию фабрики и необязательные зависимости.
40
- */
41
- constructor(private config: ModuleLoaderConfig<TPredefinedDeps>) {}
42
-
43
- /**
44
- * Создает экземпляр указанного класса, внедряя необходимые зависимости.
45
- *
46
- * @template TInstance - Тип создаваемого экземпляра.
47
- * @template TDeps - Тип зависимостей, необходимых для экземпляра.
48
- *
49
- * @param Constructor - Конструктор класса для создаваемого экземпляра.
50
- * @param args - Необязательные дополнительные зависимости для объединения с предопределенными зависимостями.
51
- *
52
- * @returns Экземпляр указанного класса с внедренными зависимостями.
53
- */
54
- create<TInstance, TDeps extends TPredefinedDeps = TPredefinedDeps>(
55
- Constructor: Class<TInstance, [TDeps]>,
56
- ...args: IsPartial<Omit<TDeps, keyof TPredefinedDeps>> extends true
57
- ? [extraDeps?: Omit<TDeps, keyof TPredefinedDeps>]
58
- : [extraDeps: Omit<TDeps, keyof TPredefinedDeps>]
59
- ) {
60
- return this.config.factory(Constructor, {
61
- ...this.config.deps!,
62
- ...args[0],
63
- } as any);
64
- }
65
- }
package/src/cookie.ts DELETED
@@ -1,11 +0,0 @@
1
- import type { AnyObject } from './utils/types.js';
2
-
3
- export const parseCookie = (cookiesString = document.cookie) => {
4
- return cookiesString
5
- .split(';')
6
- .map((cookieString) => cookieString.trim().split('='))
7
- .reduce<AnyObject>((acc, current) => {
8
- acc[current[0]] = current[1];
9
- return acc;
10
- }, {});
11
- };