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.
- package/async.d.ts +28 -0
- package/async.d.ts.map +1 -0
- package/async.js +62 -0
- package/{src/common.ts → common.d.ts} +3 -14
- package/common.d.ts.map +1 -0
- package/common.js +14 -0
- package/complex/counter.d.ts +15 -0
- package/complex/counter.d.ts.map +1 -0
- package/complex/counter.js +17 -0
- package/complex/global-config.d.ts +11 -0
- package/complex/global-config.d.ts.map +1 -0
- package/complex/global-config.js +41 -0
- package/complex/index.d.ts +4 -0
- package/complex/index.d.ts.map +1 -0
- package/complex/modules-factory.d.ts +49 -0
- package/complex/modules-factory.d.ts.map +1 -0
- package/complex/modules-factory.js +46 -0
- package/cookie.d.ts +3 -0
- package/cookie.d.ts.map +1 -0
- package/cookie.js +9 -0
- package/css.d.ts +36 -0
- package/css.d.ts.map +1 -0
- package/css.js +20 -0
- package/data.d.ts +4 -0
- package/data.d.ts.map +1 -0
- package/data.js +52 -0
- package/date-time.d.ts +28 -0
- package/date-time.d.ts.map +1 -0
- package/date-time.js +160 -0
- package/device.d.ts +8 -0
- package/device.d.ts.map +1 -0
- package/device.js +21 -0
- package/encodings.d.ts +2 -0
- package/encodings.d.ts.map +1 -0
- package/encodings.js +267 -0
- package/errors.d.ts +19 -0
- package/errors.d.ts.map +1 -0
- package/errors.js +30 -0
- package/file.d.ts +3 -0
- package/file.d.ts.map +1 -0
- package/file.js +24 -0
- package/format/_exports.d.ts +5 -0
- package/format/_exports.d.ts.map +1 -0
- package/format/constants.d.ts +4 -0
- package/format/constants.d.ts.map +1 -0
- package/{src/format/constants.ts → format/constants.js} +0 -2
- package/format/index.d.ts +3 -0
- package/format/index.d.ts.map +1 -0
- package/{src/format/index.ts → format/index.js} +0 -1
- package/format/number.d.ts +36 -0
- package/format/number.d.ts.map +1 -0
- package/format/number.js +44 -0
- package/format/percent.d.ts +15 -0
- package/format/percent.d.ts.map +1 -0
- package/format/percent.js +23 -0
- package/format/skip-spaces.d.ts +5 -0
- package/format/skip-spaces.d.ts.map +1 -0
- package/format/skip-spaces.js +4 -0
- package/html.d.ts +44 -0
- package/html.d.ts.map +1 -0
- package/html.js +182 -0
- package/id.d.ts +63 -0
- package/id.d.ts.map +1 -0
- package/{src/id.ts → id.js} +6 -16
- package/imports.d.ts +15 -0
- package/imports.d.ts.map +1 -0
- package/imports.js +40 -0
- package/math.d.ts +13 -0
- package/math.d.ts.map +1 -0
- package/math.js +17 -0
- package/media.d.ts +20 -0
- package/media.d.ts.map +1 -0
- package/media.js +103 -0
- package/mobx/apply-observable.d.ts +4 -0
- package/mobx/apply-observable.d.ts.map +1 -0
- package/mobx/apply-observable.js +12 -0
- package/mobx/create-enhanced-atom.d.ts +11 -0
- package/mobx/create-enhanced-atom.d.ts.map +1 -0
- package/mobx/create-enhanced-atom.js +12 -0
- package/mobx/deep-observable-struct.d.ts +7 -0
- package/mobx/deep-observable-struct.d.ts.map +1 -0
- package/mobx/deep-observable-struct.js +57 -0
- package/mobx/get-mobx-administration.d.ts +6 -0
- package/mobx/get-mobx-administration.d.ts.map +1 -0
- package/mobx/get-mobx-administration.js +2 -0
- package/mobx/index.d.ts +6 -0
- package/mobx/index.d.ts.map +1 -0
- package/mobx/lazy-observe.d.ts +8 -0
- package/mobx/lazy-observe.d.ts.map +1 -0
- package/mobx/lazy-observe.js +43 -0
- package/ms.d.ts +19 -0
- package/ms.d.ts.map +1 -0
- package/ms.js +18 -0
- package/number.d.ts +8 -0
- package/number.d.ts.map +1 -0
- package/number.js +13 -0
- package/package.json +399 -3
- package/parser/_exports.d.ts +4 -0
- package/parser/_exports.d.ts.map +1 -0
- package/parser/index.d.ts +3 -0
- package/parser/index.d.ts.map +1 -0
- package/{src/parser/index.ts → parser/index.js} +0 -1
- package/parser/number.d.ts +21 -0
- package/parser/number.d.ts.map +1 -0
- package/parser/number.js +44 -0
- package/parser/percent.d.ts +4 -0
- package/parser/percent.d.ts.map +1 -0
- package/parser/percent.js +4 -0
- package/parser/string.d.ts +7 -0
- package/parser/string.d.ts.map +1 -0
- package/parser/string.js +14 -0
- package/price.d.ts +6 -0
- package/price.d.ts.map +1 -0
- package/price.js +17 -0
- package/random.d.ts +9 -0
- package/random.d.ts.map +1 -0
- package/random.js +14 -0
- package/react/hooks/index.d.ts +22 -0
- package/react/hooks/index.d.ts.map +1 -0
- package/react/hooks/use-abort-controller.d.ts +2 -0
- package/react/hooks/use-abort-controller.d.ts.map +1 -0
- package/react/hooks/use-abort-controller.js +11 -0
- package/react/hooks/use-abort-signal.d.ts +2 -0
- package/react/hooks/use-abort-signal.d.ts.map +1 -0
- package/{src/react/hooks/use-abort-signal.ts → react/hooks/use-abort-signal.js} +1 -2
- package/react/hooks/use-click-outside.d.ts +9 -0
- package/react/hooks/use-click-outside.d.ts.map +1 -0
- package/react/hooks/use-click-outside.js +13 -0
- package/react/hooks/use-constant.d.ts +9 -0
- package/react/hooks/use-constant.d.ts.map +1 -0
- package/{src/react/hooks/use-constant.ts → react/hooks/use-constant.js} +6 -9
- package/react/hooks/use-define-ref.d.ts +10 -0
- package/react/hooks/use-define-ref.d.ts.map +1 -0
- package/{src/react/hooks/use-define-ref.ts → react/hooks/use-define-ref.js} +7 -10
- package/react/hooks/use-element-ref.d.ts +2 -0
- package/react/hooks/use-element-ref.d.ts.map +1 -0
- package/react/hooks/use-element-ref.js +8 -0
- package/react/hooks/use-event-listener.d.ts +8 -0
- package/react/hooks/use-event-listener.d.ts.map +1 -0
- package/react/hooks/use-event-listener.js +13 -0
- package/react/hooks/use-event.d.ts +3 -0
- package/react/hooks/use-event.d.ts.map +1 -0
- package/react/hooks/use-event.js +19 -0
- package/react/hooks/use-flag.d.ts +8 -0
- package/react/hooks/use-flag.d.ts.map +1 -0
- package/react/hooks/use-flag.js +15 -0
- package/react/hooks/use-force-update.d.ts +2 -0
- package/react/hooks/use-force-update.d.ts.map +1 -0
- package/react/hooks/use-force-update.js +7 -0
- package/react/hooks/use-initial-height.d.ts +5 -0
- package/react/hooks/use-initial-height.d.ts.map +1 -0
- package/react/hooks/use-initial-height.js +11 -0
- package/react/hooks/use-instance.d.ts +27 -0
- package/react/hooks/use-instance.d.ts.map +1 -0
- package/{src/react/hooks/use-instance.ts → react/hooks/use-instance.js} +7 -29
- package/react/hooks/use-intersection-observer.d.ts +2 -0
- package/react/hooks/use-intersection-observer.d.ts.map +1 -0
- package/react/hooks/use-intersection-observer.js +10 -0
- package/react/hooks/use-last-defined-value.d.ts +2 -0
- package/react/hooks/use-last-defined-value.d.ts.map +1 -0
- package/react/hooks/use-last-defined-value.js +8 -0
- package/react/hooks/use-last-value-ref.d.ts +2 -0
- package/react/hooks/use-last-value-ref.d.ts.map +1 -0
- package/react/hooks/use-last-value-ref.js +8 -0
- package/react/hooks/use-life-cycle.d.ts +5 -0
- package/react/hooks/use-life-cycle.d.ts.map +1 -0
- package/react/hooks/use-life-cycle.js +10 -0
- package/react/hooks/use-resize-observer.d.ts +2 -0
- package/react/hooks/use-resize-observer.d.ts.map +1 -0
- package/react/hooks/use-resize-observer.js +11 -0
- package/react/hooks/use-sync-ref.d.ts +2 -0
- package/react/hooks/use-sync-ref.d.ts.map +1 -0
- package/react/hooks/use-sync-ref.js +6 -0
- package/react/hooks/use-toggle.d.ts +2 -0
- package/react/hooks/use-toggle.d.ts.map +1 -0
- package/react/hooks/use-toggle.js +6 -0
- package/react/hooks/use-value.d.ts +5 -0
- package/react/hooks/use-value.d.ts.map +1 -0
- package/react/hooks/use-value.js +8 -0
- package/react/hooks/use-visibility-state.d.ts +2 -0
- package/react/hooks/use-visibility-state.d.ts.map +1 -0
- package/react/hooks/use-visibility-state.js +14 -0
- package/react/index.d.ts +2 -0
- package/react/index.d.ts.map +1 -0
- package/sound.d.ts +7 -0
- package/sound.d.ts.map +1 -0
- package/sound.js +12 -0
- package/storage.d.ts +39 -0
- package/storage.d.ts.map +1 -0
- package/storage.js +43 -0
- package/text.d.ts +15 -0
- package/text.d.ts.map +1 -0
- package/text.js +48 -0
- package/type-guard/_exports.d.ts +86 -0
- package/type-guard/_exports.d.ts.map +1 -0
- package/type-guard/_exports.js +125 -0
- package/type-guard/index.d.ts +3 -0
- package/type-guard/index.d.ts.map +1 -0
- package/{src/type-guard/index.ts → type-guard/index.js} +0 -1
- package/utility-types.d.ts +395 -0
- package/utils/types.d.ts +395 -0
- package/utils/types.d.ts.map +1 -0
- package/utils/types.js +1 -0
- package/vibrate.d.ts +5 -0
- package/vibrate.d.ts.map +1 -0
- package/vibrate.js +8 -0
- package/.changeset/README.md +0 -8
- package/.changeset/config.json +0 -11
- package/.github/FUNDING.yml +0 -1
- package/.github/workflows/main.yml +0 -34
- package/.github/workflows/version-or-publish.yml +0 -45
- package/.nvmrc +0 -1
- package/.vscode/settings.json +0 -19
- package/CHANGELOG.md +0 -215
- package/CONTRIBUTING.md +0 -8
- package/Makefile +0 -7
- package/biome.json +0 -3
- package/commitfmt.toml +0 -18
- package/lefthook.yml +0 -14
- package/scripts/post-build.ts +0 -71
- package/src/async.ts +0 -86
- package/src/complex/counter.test.ts +0 -41
- package/src/complex/counter.ts +0 -40
- package/src/complex/global-config.ts +0 -55
- package/src/complex/modules-factory.ts +0 -65
- package/src/cookie.ts +0 -11
- package/src/css.ts +0 -60
- package/src/data.test.ts +0 -99
- package/src/data.ts +0 -65
- package/src/date-time.test.ts +0 -119
- package/src/date-time.ts +0 -236
- package/src/device.ts +0 -42
- package/src/encodings.ts +0 -270
- package/src/errors.ts +0 -40
- package/src/file.ts +0 -25
- package/src/format/number.test.ts +0 -16
- package/src/format/number.ts +0 -96
- package/src/format/percent.ts +0 -40
- package/src/format/skip-spaces.ts +0 -4
- package/src/html.ts +0 -238
- package/src/imports.ts +0 -52
- package/src/math.ts +0 -20
- package/src/media.ts +0 -134
- package/src/mobx/apply-observable.ts +0 -20
- package/src/mobx/create-enhanced-atom.ts +0 -28
- package/src/mobx/deep-observable-struct.test.ts +0 -69
- package/src/mobx/deep-observable-struct.ts +0 -69
- package/src/mobx/get-mobx-administration.ts +0 -10
- package/src/mobx/lazy-observe.ts +0 -59
- package/src/ms.ts +0 -20
- package/src/number.ts +0 -14
- package/src/parser/number.test.ts +0 -38
- package/src/parser/number.ts +0 -73
- package/src/parser/percent.ts +0 -11
- package/src/parser/string.ts +0 -29
- package/src/price.ts +0 -33
- package/src/random.ts +0 -27
- package/src/react/hooks/use-abort-controller.ts +0 -15
- package/src/react/hooks/use-click-outside.ts +0 -27
- package/src/react/hooks/use-element-ref.ts +0 -11
- package/src/react/hooks/use-event-listener.ts +0 -29
- package/src/react/hooks/use-event.ts +0 -23
- package/src/react/hooks/use-flag.ts +0 -27
- package/src/react/hooks/use-force-update.ts +0 -9
- package/src/react/hooks/use-initial-height.ts +0 -16
- package/src/react/hooks/use-intersection-observer.ts +0 -18
- package/src/react/hooks/use-last-defined-value.ts +0 -9
- package/src/react/hooks/use-last-value-ref.ts +0 -11
- package/src/react/hooks/use-life-cycle.ts +0 -17
- package/src/react/hooks/use-resize-observer.ts +0 -14
- package/src/react/hooks/use-sync-ref.ts +0 -7
- package/src/react/hooks/use-toggle.ts +0 -9
- package/src/react/hooks/use-value.ts +0 -10
- package/src/react/hooks/use-visibility-state.ts +0 -19
- package/src/sound.ts +0 -15
- package/src/storage.ts +0 -137
- package/src/text.test.ts +0 -91
- package/src/text.ts +0 -60
- package/src/type-guard/_exports.ts +0 -154
- package/src/type-guard/index.test.ts +0 -127
- package/src/vibrate.ts +0 -8
- package/tsconfig.json +0 -26
- package/tsconfig.test.json +0 -33
- package/vitest.config.ts +0 -20
- /package/{src/complex/index.ts → complex/index.js} +0 -0
- /package/{src/format/_exports.ts → format/_exports.js} +0 -0
- /package/{src/mobx/index.ts → mobx/index.js} +0 -0
- /package/{src/parser/_exports.ts → parser/_exports.js} +0 -0
- /package/{src/react/hooks/index.ts → react/hooks/index.js} +0 -0
- /package/{src/react/index.ts → react/index.js} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yummies",
|
|
3
|
-
"version": "5.4.
|
|
3
|
+
"version": "5.4.7",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": "js2me",
|
|
6
6
|
"license": "MIT",
|
|
@@ -53,6 +53,402 @@
|
|
|
53
53
|
"vitest": "^3.1.2"
|
|
54
54
|
},
|
|
55
55
|
"type": "module",
|
|
56
|
+
"exports": {
|
|
57
|
+
"./async": {
|
|
58
|
+
"import": "./async.js",
|
|
59
|
+
"default": "./async.js",
|
|
60
|
+
"types": "./async.d.ts"
|
|
61
|
+
},
|
|
62
|
+
"./common": {
|
|
63
|
+
"import": "./common.js",
|
|
64
|
+
"default": "./common.js",
|
|
65
|
+
"types": "./common.d.ts"
|
|
66
|
+
},
|
|
67
|
+
"./complex/counter.test": {
|
|
68
|
+
"import": "./complex/counter.test.js",
|
|
69
|
+
"default": "./complex/counter.test.js",
|
|
70
|
+
"types": "./complex/counter.test.d.ts"
|
|
71
|
+
},
|
|
72
|
+
"./complex/counter": {
|
|
73
|
+
"import": "./complex/counter.js",
|
|
74
|
+
"default": "./complex/counter.js",
|
|
75
|
+
"types": "./complex/counter.d.ts"
|
|
76
|
+
},
|
|
77
|
+
"./complex/global-config": {
|
|
78
|
+
"import": "./complex/global-config.js",
|
|
79
|
+
"default": "./complex/global-config.js",
|
|
80
|
+
"types": "./complex/global-config.d.ts"
|
|
81
|
+
},
|
|
82
|
+
"./complex": {
|
|
83
|
+
"import": "./complex/index.js",
|
|
84
|
+
"default": "./complex/index.js",
|
|
85
|
+
"types": "./complex/index.d.ts"
|
|
86
|
+
},
|
|
87
|
+
"./complex/modules-factory": {
|
|
88
|
+
"import": "./complex/modules-factory.js",
|
|
89
|
+
"default": "./complex/modules-factory.js",
|
|
90
|
+
"types": "./complex/modules-factory.d.ts"
|
|
91
|
+
},
|
|
92
|
+
"./cookie": {
|
|
93
|
+
"import": "./cookie.js",
|
|
94
|
+
"default": "./cookie.js",
|
|
95
|
+
"types": "./cookie.d.ts"
|
|
96
|
+
},
|
|
97
|
+
"./css": {
|
|
98
|
+
"import": "./css.js",
|
|
99
|
+
"default": "./css.js",
|
|
100
|
+
"types": "./css.d.ts"
|
|
101
|
+
},
|
|
102
|
+
"./data.test": {
|
|
103
|
+
"import": "./data.test.js",
|
|
104
|
+
"default": "./data.test.js",
|
|
105
|
+
"types": "./data.test.d.ts"
|
|
106
|
+
},
|
|
107
|
+
"./data": {
|
|
108
|
+
"import": "./data.js",
|
|
109
|
+
"default": "./data.js",
|
|
110
|
+
"types": "./data.d.ts"
|
|
111
|
+
},
|
|
112
|
+
"./date-time.test": {
|
|
113
|
+
"import": "./date-time.test.js",
|
|
114
|
+
"default": "./date-time.test.js",
|
|
115
|
+
"types": "./date-time.test.d.ts"
|
|
116
|
+
},
|
|
117
|
+
"./date-time": {
|
|
118
|
+
"import": "./date-time.js",
|
|
119
|
+
"default": "./date-time.js",
|
|
120
|
+
"types": "./date-time.d.ts"
|
|
121
|
+
},
|
|
122
|
+
"./device": {
|
|
123
|
+
"import": "./device.js",
|
|
124
|
+
"default": "./device.js",
|
|
125
|
+
"types": "./device.d.ts"
|
|
126
|
+
},
|
|
127
|
+
"./encodings": {
|
|
128
|
+
"import": "./encodings.js",
|
|
129
|
+
"default": "./encodings.js",
|
|
130
|
+
"types": "./encodings.d.ts"
|
|
131
|
+
},
|
|
132
|
+
"./errors": {
|
|
133
|
+
"import": "./errors.js",
|
|
134
|
+
"default": "./errors.js",
|
|
135
|
+
"types": "./errors.d.ts"
|
|
136
|
+
},
|
|
137
|
+
"./file": {
|
|
138
|
+
"import": "./file.js",
|
|
139
|
+
"default": "./file.js",
|
|
140
|
+
"types": "./file.d.ts"
|
|
141
|
+
},
|
|
142
|
+
"./format/_exports": {
|
|
143
|
+
"import": "./format/_exports.js",
|
|
144
|
+
"default": "./format/_exports.js",
|
|
145
|
+
"types": "./format/_exports.d.ts"
|
|
146
|
+
},
|
|
147
|
+
"./format/constants": {
|
|
148
|
+
"import": "./format/constants.js",
|
|
149
|
+
"default": "./format/constants.js",
|
|
150
|
+
"types": "./format/constants.d.ts"
|
|
151
|
+
},
|
|
152
|
+
"./format": {
|
|
153
|
+
"import": "./format/index.js",
|
|
154
|
+
"default": "./format/index.js",
|
|
155
|
+
"types": "./format/index.d.ts"
|
|
156
|
+
},
|
|
157
|
+
"./format/number.test": {
|
|
158
|
+
"import": "./format/number.test.js",
|
|
159
|
+
"default": "./format/number.test.js",
|
|
160
|
+
"types": "./format/number.test.d.ts"
|
|
161
|
+
},
|
|
162
|
+
"./format/number": {
|
|
163
|
+
"import": "./format/number.js",
|
|
164
|
+
"default": "./format/number.js",
|
|
165
|
+
"types": "./format/number.d.ts"
|
|
166
|
+
},
|
|
167
|
+
"./format/percent": {
|
|
168
|
+
"import": "./format/percent.js",
|
|
169
|
+
"default": "./format/percent.js",
|
|
170
|
+
"types": "./format/percent.d.ts"
|
|
171
|
+
},
|
|
172
|
+
"./format/skip-spaces": {
|
|
173
|
+
"import": "./format/skip-spaces.js",
|
|
174
|
+
"default": "./format/skip-spaces.js",
|
|
175
|
+
"types": "./format/skip-spaces.d.ts"
|
|
176
|
+
},
|
|
177
|
+
"./html": {
|
|
178
|
+
"import": "./html.js",
|
|
179
|
+
"default": "./html.js",
|
|
180
|
+
"types": "./html.d.ts"
|
|
181
|
+
},
|
|
182
|
+
"./id": {
|
|
183
|
+
"import": "./id.js",
|
|
184
|
+
"default": "./id.js",
|
|
185
|
+
"types": "./id.d.ts"
|
|
186
|
+
},
|
|
187
|
+
"./imports": {
|
|
188
|
+
"import": "./imports.js",
|
|
189
|
+
"default": "./imports.js",
|
|
190
|
+
"types": "./imports.d.ts"
|
|
191
|
+
},
|
|
192
|
+
"./math": {
|
|
193
|
+
"import": "./math.js",
|
|
194
|
+
"default": "./math.js",
|
|
195
|
+
"types": "./math.d.ts"
|
|
196
|
+
},
|
|
197
|
+
"./media": {
|
|
198
|
+
"import": "./media.js",
|
|
199
|
+
"default": "./media.js",
|
|
200
|
+
"types": "./media.d.ts"
|
|
201
|
+
},
|
|
202
|
+
"./mobx/apply-observable": {
|
|
203
|
+
"import": "./mobx/apply-observable.js",
|
|
204
|
+
"default": "./mobx/apply-observable.js",
|
|
205
|
+
"types": "./mobx/apply-observable.d.ts"
|
|
206
|
+
},
|
|
207
|
+
"./mobx/create-enhanced-atom": {
|
|
208
|
+
"import": "./mobx/create-enhanced-atom.js",
|
|
209
|
+
"default": "./mobx/create-enhanced-atom.js",
|
|
210
|
+
"types": "./mobx/create-enhanced-atom.d.ts"
|
|
211
|
+
},
|
|
212
|
+
"./mobx/deep-observable-struct.test": {
|
|
213
|
+
"import": "./mobx/deep-observable-struct.test.js",
|
|
214
|
+
"default": "./mobx/deep-observable-struct.test.js",
|
|
215
|
+
"types": "./mobx/deep-observable-struct.test.d.ts"
|
|
216
|
+
},
|
|
217
|
+
"./mobx/deep-observable-struct": {
|
|
218
|
+
"import": "./mobx/deep-observable-struct.js",
|
|
219
|
+
"default": "./mobx/deep-observable-struct.js",
|
|
220
|
+
"types": "./mobx/deep-observable-struct.d.ts"
|
|
221
|
+
},
|
|
222
|
+
"./mobx/get-mobx-administration": {
|
|
223
|
+
"import": "./mobx/get-mobx-administration.js",
|
|
224
|
+
"default": "./mobx/get-mobx-administration.js",
|
|
225
|
+
"types": "./mobx/get-mobx-administration.d.ts"
|
|
226
|
+
},
|
|
227
|
+
"./mobx": {
|
|
228
|
+
"import": "./mobx/index.js",
|
|
229
|
+
"default": "./mobx/index.js",
|
|
230
|
+
"types": "./mobx/index.d.ts"
|
|
231
|
+
},
|
|
232
|
+
"./mobx/lazy-observe": {
|
|
233
|
+
"import": "./mobx/lazy-observe.js",
|
|
234
|
+
"default": "./mobx/lazy-observe.js",
|
|
235
|
+
"types": "./mobx/lazy-observe.d.ts"
|
|
236
|
+
},
|
|
237
|
+
"./ms": {
|
|
238
|
+
"import": "./ms.js",
|
|
239
|
+
"default": "./ms.js",
|
|
240
|
+
"types": "./ms.d.ts"
|
|
241
|
+
},
|
|
242
|
+
"./number": {
|
|
243
|
+
"import": "./number.js",
|
|
244
|
+
"default": "./number.js",
|
|
245
|
+
"types": "./number.d.ts"
|
|
246
|
+
},
|
|
247
|
+
"./parser/_exports": {
|
|
248
|
+
"import": "./parser/_exports.js",
|
|
249
|
+
"default": "./parser/_exports.js",
|
|
250
|
+
"types": "./parser/_exports.d.ts"
|
|
251
|
+
},
|
|
252
|
+
"./parser": {
|
|
253
|
+
"import": "./parser/index.js",
|
|
254
|
+
"default": "./parser/index.js",
|
|
255
|
+
"types": "./parser/index.d.ts"
|
|
256
|
+
},
|
|
257
|
+
"./parser/number.test": {
|
|
258
|
+
"import": "./parser/number.test.js",
|
|
259
|
+
"default": "./parser/number.test.js",
|
|
260
|
+
"types": "./parser/number.test.d.ts"
|
|
261
|
+
},
|
|
262
|
+
"./parser/number": {
|
|
263
|
+
"import": "./parser/number.js",
|
|
264
|
+
"default": "./parser/number.js",
|
|
265
|
+
"types": "./parser/number.d.ts"
|
|
266
|
+
},
|
|
267
|
+
"./parser/percent": {
|
|
268
|
+
"import": "./parser/percent.js",
|
|
269
|
+
"default": "./parser/percent.js",
|
|
270
|
+
"types": "./parser/percent.d.ts"
|
|
271
|
+
},
|
|
272
|
+
"./parser/string": {
|
|
273
|
+
"import": "./parser/string.js",
|
|
274
|
+
"default": "./parser/string.js",
|
|
275
|
+
"types": "./parser/string.d.ts"
|
|
276
|
+
},
|
|
277
|
+
"./price": {
|
|
278
|
+
"import": "./price.js",
|
|
279
|
+
"default": "./price.js",
|
|
280
|
+
"types": "./price.d.ts"
|
|
281
|
+
},
|
|
282
|
+
"./random": {
|
|
283
|
+
"import": "./random.js",
|
|
284
|
+
"default": "./random.js",
|
|
285
|
+
"types": "./random.d.ts"
|
|
286
|
+
},
|
|
287
|
+
"./react/hooks": {
|
|
288
|
+
"import": "./react/hooks/index.js",
|
|
289
|
+
"default": "./react/hooks/index.js",
|
|
290
|
+
"types": "./react/hooks/index.d.ts"
|
|
291
|
+
},
|
|
292
|
+
"./react/hooks/use-abort-controller": {
|
|
293
|
+
"import": "./react/hooks/use-abort-controller.js",
|
|
294
|
+
"default": "./react/hooks/use-abort-controller.js",
|
|
295
|
+
"types": "./react/hooks/use-abort-controller.d.ts"
|
|
296
|
+
},
|
|
297
|
+
"./react/hooks/use-abort-signal": {
|
|
298
|
+
"import": "./react/hooks/use-abort-signal.js",
|
|
299
|
+
"default": "./react/hooks/use-abort-signal.js",
|
|
300
|
+
"types": "./react/hooks/use-abort-signal.d.ts"
|
|
301
|
+
},
|
|
302
|
+
"./react/hooks/use-click-outside": {
|
|
303
|
+
"import": "./react/hooks/use-click-outside.js",
|
|
304
|
+
"default": "./react/hooks/use-click-outside.js",
|
|
305
|
+
"types": "./react/hooks/use-click-outside.d.ts"
|
|
306
|
+
},
|
|
307
|
+
"./react/hooks/use-constant": {
|
|
308
|
+
"import": "./react/hooks/use-constant.js",
|
|
309
|
+
"default": "./react/hooks/use-constant.js",
|
|
310
|
+
"types": "./react/hooks/use-constant.d.ts"
|
|
311
|
+
},
|
|
312
|
+
"./react/hooks/use-define-ref": {
|
|
313
|
+
"import": "./react/hooks/use-define-ref.js",
|
|
314
|
+
"default": "./react/hooks/use-define-ref.js",
|
|
315
|
+
"types": "./react/hooks/use-define-ref.d.ts"
|
|
316
|
+
},
|
|
317
|
+
"./react/hooks/use-element-ref": {
|
|
318
|
+
"import": "./react/hooks/use-element-ref.js",
|
|
319
|
+
"default": "./react/hooks/use-element-ref.js",
|
|
320
|
+
"types": "./react/hooks/use-element-ref.d.ts"
|
|
321
|
+
},
|
|
322
|
+
"./react/hooks/use-event-listener": {
|
|
323
|
+
"import": "./react/hooks/use-event-listener.js",
|
|
324
|
+
"default": "./react/hooks/use-event-listener.js",
|
|
325
|
+
"types": "./react/hooks/use-event-listener.d.ts"
|
|
326
|
+
},
|
|
327
|
+
"./react/hooks/use-event": {
|
|
328
|
+
"import": "./react/hooks/use-event.js",
|
|
329
|
+
"default": "./react/hooks/use-event.js",
|
|
330
|
+
"types": "./react/hooks/use-event.d.ts"
|
|
331
|
+
},
|
|
332
|
+
"./react/hooks/use-flag": {
|
|
333
|
+
"import": "./react/hooks/use-flag.js",
|
|
334
|
+
"default": "./react/hooks/use-flag.js",
|
|
335
|
+
"types": "./react/hooks/use-flag.d.ts"
|
|
336
|
+
},
|
|
337
|
+
"./react/hooks/use-force-update": {
|
|
338
|
+
"import": "./react/hooks/use-force-update.js",
|
|
339
|
+
"default": "./react/hooks/use-force-update.js",
|
|
340
|
+
"types": "./react/hooks/use-force-update.d.ts"
|
|
341
|
+
},
|
|
342
|
+
"./react/hooks/use-initial-height": {
|
|
343
|
+
"import": "./react/hooks/use-initial-height.js",
|
|
344
|
+
"default": "./react/hooks/use-initial-height.js",
|
|
345
|
+
"types": "./react/hooks/use-initial-height.d.ts"
|
|
346
|
+
},
|
|
347
|
+
"./react/hooks/use-instance": {
|
|
348
|
+
"import": "./react/hooks/use-instance.js",
|
|
349
|
+
"default": "./react/hooks/use-instance.js",
|
|
350
|
+
"types": "./react/hooks/use-instance.d.ts"
|
|
351
|
+
},
|
|
352
|
+
"./react/hooks/use-intersection-observer": {
|
|
353
|
+
"import": "./react/hooks/use-intersection-observer.js",
|
|
354
|
+
"default": "./react/hooks/use-intersection-observer.js",
|
|
355
|
+
"types": "./react/hooks/use-intersection-observer.d.ts"
|
|
356
|
+
},
|
|
357
|
+
"./react/hooks/use-last-defined-value": {
|
|
358
|
+
"import": "./react/hooks/use-last-defined-value.js",
|
|
359
|
+
"default": "./react/hooks/use-last-defined-value.js",
|
|
360
|
+
"types": "./react/hooks/use-last-defined-value.d.ts"
|
|
361
|
+
},
|
|
362
|
+
"./react/hooks/use-last-value-ref": {
|
|
363
|
+
"import": "./react/hooks/use-last-value-ref.js",
|
|
364
|
+
"default": "./react/hooks/use-last-value-ref.js",
|
|
365
|
+
"types": "./react/hooks/use-last-value-ref.d.ts"
|
|
366
|
+
},
|
|
367
|
+
"./react/hooks/use-life-cycle": {
|
|
368
|
+
"import": "./react/hooks/use-life-cycle.js",
|
|
369
|
+
"default": "./react/hooks/use-life-cycle.js",
|
|
370
|
+
"types": "./react/hooks/use-life-cycle.d.ts"
|
|
371
|
+
},
|
|
372
|
+
"./react/hooks/use-resize-observer": {
|
|
373
|
+
"import": "./react/hooks/use-resize-observer.js",
|
|
374
|
+
"default": "./react/hooks/use-resize-observer.js",
|
|
375
|
+
"types": "./react/hooks/use-resize-observer.d.ts"
|
|
376
|
+
},
|
|
377
|
+
"./react/hooks/use-sync-ref": {
|
|
378
|
+
"import": "./react/hooks/use-sync-ref.js",
|
|
379
|
+
"default": "./react/hooks/use-sync-ref.js",
|
|
380
|
+
"types": "./react/hooks/use-sync-ref.d.ts"
|
|
381
|
+
},
|
|
382
|
+
"./react/hooks/use-toggle": {
|
|
383
|
+
"import": "./react/hooks/use-toggle.js",
|
|
384
|
+
"default": "./react/hooks/use-toggle.js",
|
|
385
|
+
"types": "./react/hooks/use-toggle.d.ts"
|
|
386
|
+
},
|
|
387
|
+
"./react/hooks/use-value": {
|
|
388
|
+
"import": "./react/hooks/use-value.js",
|
|
389
|
+
"default": "./react/hooks/use-value.js",
|
|
390
|
+
"types": "./react/hooks/use-value.d.ts"
|
|
391
|
+
},
|
|
392
|
+
"./react/hooks/use-visibility-state": {
|
|
393
|
+
"import": "./react/hooks/use-visibility-state.js",
|
|
394
|
+
"default": "./react/hooks/use-visibility-state.js",
|
|
395
|
+
"types": "./react/hooks/use-visibility-state.d.ts"
|
|
396
|
+
},
|
|
397
|
+
"./react": {
|
|
398
|
+
"import": "./react/index.js",
|
|
399
|
+
"default": "./react/index.js",
|
|
400
|
+
"types": "./react/index.d.ts"
|
|
401
|
+
},
|
|
402
|
+
"./sound": {
|
|
403
|
+
"import": "./sound.js",
|
|
404
|
+
"default": "./sound.js",
|
|
405
|
+
"types": "./sound.d.ts"
|
|
406
|
+
},
|
|
407
|
+
"./storage": {
|
|
408
|
+
"import": "./storage.js",
|
|
409
|
+
"default": "./storage.js",
|
|
410
|
+
"types": "./storage.d.ts"
|
|
411
|
+
},
|
|
412
|
+
"./text.test": {
|
|
413
|
+
"import": "./text.test.js",
|
|
414
|
+
"default": "./text.test.js",
|
|
415
|
+
"types": "./text.test.d.ts"
|
|
416
|
+
},
|
|
417
|
+
"./text": {
|
|
418
|
+
"import": "./text.js",
|
|
419
|
+
"default": "./text.js",
|
|
420
|
+
"types": "./text.d.ts"
|
|
421
|
+
},
|
|
422
|
+
"./type-guard/_exports": {
|
|
423
|
+
"import": "./type-guard/_exports.js",
|
|
424
|
+
"default": "./type-guard/_exports.js",
|
|
425
|
+
"types": "./type-guard/_exports.d.ts"
|
|
426
|
+
},
|
|
427
|
+
"./type-guard/index.test": {
|
|
428
|
+
"import": "./type-guard/index.test.js",
|
|
429
|
+
"default": "./type-guard/index.test.js",
|
|
430
|
+
"types": "./type-guard/index.test.d.ts"
|
|
431
|
+
},
|
|
432
|
+
"./type-guard": {
|
|
433
|
+
"import": "./type-guard/index.js",
|
|
434
|
+
"default": "./type-guard/index.js",
|
|
435
|
+
"types": "./type-guard/index.d.ts"
|
|
436
|
+
},
|
|
437
|
+
"./utils/types": {
|
|
438
|
+
"import": "./utils/types.js",
|
|
439
|
+
"default": "./utils/types.js",
|
|
440
|
+
"types": "./utils/types.d.ts"
|
|
441
|
+
},
|
|
442
|
+
"./vibrate": {
|
|
443
|
+
"import": "./vibrate.js",
|
|
444
|
+
"default": "./vibrate.js",
|
|
445
|
+
"types": "./vibrate.d.ts"
|
|
446
|
+
},
|
|
447
|
+
"./package.json": "./package.json"
|
|
448
|
+
},
|
|
449
|
+
"files": [
|
|
450
|
+
"*"
|
|
451
|
+
],
|
|
56
452
|
"scripts": {
|
|
57
453
|
"clean": "rm -rf dist",
|
|
58
454
|
"lint:check": "pnpm exec biome check --write --no-errors-on-unmatched --files-ignore-unknown=true",
|
|
@@ -60,8 +456,8 @@
|
|
|
60
456
|
"check": "npm run lint:check && npm run ts:check",
|
|
61
457
|
"prebuild": "npm run clean && npm run check",
|
|
62
458
|
"build:watch": "pnpm build && nodemon --watch src --ext ts --exec \"pnpm build\"",
|
|
63
|
-
"build": "tsc && tsx
|
|
64
|
-
"pub": "pnpm build
|
|
459
|
+
"build": "tsc && tsx post-build",
|
|
460
|
+
"pub": "PUBLISH=true pnpm build",
|
|
65
461
|
"pub:patch": "PUBLISH_VERSION=patch pnpm pub",
|
|
66
462
|
"pub:minor": "PUBLISH_VERSION=minor pnpm pub",
|
|
67
463
|
"pub:major": "PUBLISH_VERSION=major pnpm pub",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_exports.d.ts","sourceRoot":"","sources":["../../src/parser/_exports.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/parser/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Maybe } from '../utils/types.js';
|
|
2
|
+
export interface NumberParserSettings<TFallback = number> {
|
|
3
|
+
digits?: number;
|
|
4
|
+
fallback?: TFallback;
|
|
5
|
+
/**
|
|
6
|
+
* Round to upper boundary
|
|
7
|
+
* 5.1 -> 6
|
|
8
|
+
*/
|
|
9
|
+
ceil?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Round to bottom boundary
|
|
12
|
+
* 5.9 -> 5
|
|
13
|
+
*/
|
|
14
|
+
floor?: boolean;
|
|
15
|
+
clamped?: [min?: Maybe<number>, max?: Maybe<number>];
|
|
16
|
+
}
|
|
17
|
+
export declare const number: {
|
|
18
|
+
<TFallback = number>(input: Maybe<unknown>, userSettings?: Maybe<NumberParserSettings<TFallback>>): number | TFallback;
|
|
19
|
+
defaultSettings: NumberParserSettings<number>;
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=number.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"number.d.ts","sourceRoot":"","sources":["../../src/parser/number.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE/C,MAAM,WAAW,oBAAoB,CAAC,SAAS,GAAG,MAAM;IACtD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,GAAG,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;CACtD;AAED,eAAO,MAAM,MAAM;KAAI,SAAS,kBACvB,KAAK,CAAC,OAAO,CAAC,iBACN,KAAK,CAAC,oBAAoB,CAAC,SAAS,CAAC,CAAC,GACpD,MAAM,GAAG,SAAS;;CA+CpB,CAAC"}
|
package/parser/number.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { skipSpaces } from '../format/skip-spaces.js';
|
|
2
|
+
import { typeGuard } from '../type-guard/index.js';
|
|
3
|
+
export const number = (input, userSettings) => {
|
|
4
|
+
const settings = {
|
|
5
|
+
...number.defaultSettings,
|
|
6
|
+
...userSettings,
|
|
7
|
+
};
|
|
8
|
+
const fallback = settings?.fallback ?? 0;
|
|
9
|
+
let result;
|
|
10
|
+
if (typeGuard.isNumber(input)) {
|
|
11
|
+
result = input;
|
|
12
|
+
}
|
|
13
|
+
else if (typeGuard.isString(input)) {
|
|
14
|
+
const formattedInput = skipSpaces(input).replace(',', '.');
|
|
15
|
+
if (formattedInput === '') {
|
|
16
|
+
result = fallback;
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
result = Number(formattedInput);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
result = fallback;
|
|
24
|
+
}
|
|
25
|
+
if (typeGuard.isNumber(result)) {
|
|
26
|
+
if (settings?.clamped != null) {
|
|
27
|
+
result = Math.max(settings.clamped[0] ?? -Infinity, Math.min(result, settings.clamped[1] ?? Infinity));
|
|
28
|
+
}
|
|
29
|
+
if (settings?.ceil != null) {
|
|
30
|
+
result = Math.ceil(result);
|
|
31
|
+
}
|
|
32
|
+
if (settings?.floor != null) {
|
|
33
|
+
result = Math.floor(result);
|
|
34
|
+
}
|
|
35
|
+
if (settings?.digits != null) {
|
|
36
|
+
result = +result.toFixed(settings.digits);
|
|
37
|
+
}
|
|
38
|
+
return result;
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
return fallback;
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
number.defaultSettings = {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Maybe } from '../utils/types.js';
|
|
2
|
+
import { type NumberParserSettings } from './number.js';
|
|
3
|
+
export declare const percent: <TFallback = number>(value: Maybe<string | number>, maxValue?: Maybe<string | number>, settings?: Maybe<NumberParserSettings<TFallback>>) => number | TFallback;
|
|
4
|
+
//# sourceMappingURL=percent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"percent.d.ts","sourceRoot":"","sources":["../../src/parser/percent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAAE,KAAK,oBAAoB,EAAU,MAAM,aAAa,CAAC;AAEhE,eAAO,MAAM,OAAO,GAAI,SAAS,GAAG,MAAM,EACxC,OAAO,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,EAC7B,WAAW,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,EACjC,WAAW,KAAK,CAAC,oBAAoB,CAAC,SAAS,CAAC,CAAC,uBAGlD,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Maybe } from '../utils/types.js';
|
|
2
|
+
export interface StringParserSettings<TFallback = string> {
|
|
3
|
+
fallback?: TFallback;
|
|
4
|
+
prettyJson?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare const string: <TFallback = string>(input: Maybe<unknown>, settings?: Maybe<StringParserSettings<TFallback>>) => string | TFallback;
|
|
7
|
+
//# sourceMappingURL=string.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../src/parser/string.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE/C,MAAM,WAAW,oBAAoB,CAAC,SAAS,GAAG,MAAM;IACtD,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,eAAO,MAAM,MAAM,GAAI,SAAS,GAAG,MAAM,EACvC,OAAO,KAAK,CAAC,OAAO,CAAC,EACrB,WAAW,KAAK,CAAC,oBAAoB,CAAC,SAAS,CAAC,CAAC,KAChD,MAAM,GAAG,SAiBX,CAAC"}
|
package/parser/string.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { typeGuard } from '../type-guard/index.js';
|
|
2
|
+
export const string = (input, settings) => {
|
|
3
|
+
const fallback = settings && 'fallback' in settings ? settings.fallback : '';
|
|
4
|
+
if (input == null) {
|
|
5
|
+
return fallback;
|
|
6
|
+
}
|
|
7
|
+
if (typeGuard.isObject(input)) {
|
|
8
|
+
if (settings?.prettyJson) {
|
|
9
|
+
return JSON.stringify(input, null, 2);
|
|
10
|
+
}
|
|
11
|
+
return JSON.stringify(input);
|
|
12
|
+
}
|
|
13
|
+
return String(input);
|
|
14
|
+
};
|
package/price.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export interface PriceFormatOptions extends Partial<Omit<Intl.NumberFormatOptions, 'currency'>> {
|
|
2
|
+
withoutSymbol?: boolean;
|
|
3
|
+
customSymbol?: string;
|
|
4
|
+
}
|
|
5
|
+
export declare const formatPrice: (price: number, locale: string, currency?: string, { withoutSymbol, customSymbol, ...options }?: PriceFormatOptions) => string;
|
|
6
|
+
//# sourceMappingURL=price.d.ts.map
|
package/price.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"price.d.ts","sourceRoot":"","sources":["../src/price.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,kBACf,SAAQ,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE,UAAU,CAAC,CAAC;IAC3D,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,WAAW,GACtB,OAAO,MAAM,EACb,QAAQ,MAAM,EACd,WAAW,MAAM,EACjB,8CAA6C,kBAAuB,WAsBrE,CAAC"}
|
package/price.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export const formatPrice = (price, locale, currency, { withoutSymbol, customSymbol, ...options } = {}) => {
|
|
2
|
+
const priceFormatter = new Intl.NumberFormat(locale, {
|
|
3
|
+
style: 'currency',
|
|
4
|
+
currency,
|
|
5
|
+
minimumFractionDigits: 0,
|
|
6
|
+
currencyDisplay: 'narrowSymbol',
|
|
7
|
+
...options,
|
|
8
|
+
});
|
|
9
|
+
const zeroPrice = priceFormatter.format(0);
|
|
10
|
+
const currencySymbol = zeroPrice.replace('0', '');
|
|
11
|
+
const rawPrice = priceFormatter.format(price);
|
|
12
|
+
const priceWithoutCurrency = rawPrice.replace(currencySymbol, '');
|
|
13
|
+
if (withoutSymbol) {
|
|
14
|
+
return priceWithoutCurrency;
|
|
15
|
+
}
|
|
16
|
+
return `${priceWithoutCurrency} ${customSymbol ?? (currency === 'RUB' ? 'р' : currencySymbol)}`.replace(/\s{2,}/, ' ');
|
|
17
|
+
};
|
package/random.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const getRandomFloat: <T extends number = number>(min?: number, max?: number) => T;
|
|
2
|
+
export declare const getRandomInt: <T extends number = number>(min?: number, max?: number) => T;
|
|
3
|
+
export declare const getRandomChoice: <T>(arr: T[]) => T;
|
|
4
|
+
export declare const getRandomSizeArray: (min?: number, max?: number) => unknown[];
|
|
5
|
+
export declare const getRandomBool: () => boolean;
|
|
6
|
+
export declare const getMajorRandomBool: () => boolean;
|
|
7
|
+
export declare const getMinorRandomBool: () => boolean;
|
|
8
|
+
export declare const getFrequencyValue: (frequency: number) => boolean;
|
|
9
|
+
//# sourceMappingURL=random.d.ts.map
|
package/random.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"random.d.ts","sourceRoot":"","sources":["../src/random.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,MAAM,GAAG,MAAM,EACtD,YAAO,EACP,YAAO,KACN,CAA6C,CAAC;AAEjD,eAAO,MAAM,YAAY,GAAI,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,YAAO,EAAE,YAAO,KAAG,CACH,CAAC;AAEzE,eAAO,MAAM,eAAe,GAAI,CAAC,EAAE,KAAK,CAAC,EAAE,KAAG,CACR,CAAC;AAEvC,eAAO,MAAM,kBAAkB,GAAI,YAAO,EAAE,YAAQ,cACO,CAAC;AAE5D,eAAO,MAAM,aAAa,eAAiC,CAAC;AAE5D,eAAO,MAAM,kBAAkB,eAE9B,CAAC;AAEF,eAAO,MAAM,kBAAkB,eAE9B,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,WAAW,MAAM,YAElD,CAAC"}
|
package/random.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const getRandomFloat = (min = 0, max = 1) => (Math.random() * (max - min) + min);
|
|
2
|
+
export const getRandomInt = (min = 0, max = 1) => min === max ? min : Math.round(getRandomFloat(min, max));
|
|
3
|
+
export const getRandomChoice = (arr) => arr[getRandomInt(0, arr.length - 1)];
|
|
4
|
+
export const getRandomSizeArray = (min = 0, max = 10) => Array.from({ length: getRandomInt(min, max) }).fill(null);
|
|
5
|
+
export const getRandomBool = () => getRandomInt(0, 1) === 1;
|
|
6
|
+
export const getMajorRandomBool = () => {
|
|
7
|
+
return getRandomInt(0, 10) <= 6;
|
|
8
|
+
};
|
|
9
|
+
export const getMinorRandomBool = () => {
|
|
10
|
+
return !getMajorRandomBool();
|
|
11
|
+
};
|
|
12
|
+
export const getFrequencyValue = (frequency) => {
|
|
13
|
+
return Math.random() < frequency;
|
|
14
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export * from './use-abort-controller.js';
|
|
2
|
+
export * from './use-abort-signal.js';
|
|
3
|
+
export * from './use-click-outside.js';
|
|
4
|
+
export * from './use-constant.js';
|
|
5
|
+
export * from './use-define-ref.js';
|
|
6
|
+
export * from './use-element-ref.js';
|
|
7
|
+
export * from './use-event.js';
|
|
8
|
+
export * from './use-event-listener.js';
|
|
9
|
+
export * from './use-flag.js';
|
|
10
|
+
export * from './use-force-update.js';
|
|
11
|
+
export * from './use-initial-height.js';
|
|
12
|
+
export * from './use-instance.js';
|
|
13
|
+
export * from './use-intersection-observer.js';
|
|
14
|
+
export * from './use-last-defined-value.js';
|
|
15
|
+
export * from './use-last-value-ref.js';
|
|
16
|
+
export * from './use-life-cycle.js';
|
|
17
|
+
export * from './use-resize-observer.js';
|
|
18
|
+
export * from './use-sync-ref.js';
|
|
19
|
+
export * from './use-toggle.js';
|
|
20
|
+
export * from './use-value.js';
|
|
21
|
+
export * from './use-visibility-state.js';
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/react/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,2BAA2B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-abort-controller.d.ts","sourceRoot":"","sources":["../../../src/react/hooks/use-abort-controller.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,kBAAkB,uBAU9B,CAAC"}
|