yummies 5.4.6 → 5.4.8
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.cjs +70 -0
- package/async.d.cts +28 -0
- package/async.d.cts.map +1 -0
- package/async.d.ts +28 -0
- package/async.d.ts.map +1 -0
- package/async.js +62 -0
- package/common.cjs +18 -0
- package/common.d.cts +15 -0
- package/common.d.cts.map +1 -0
- package/common.d.ts +15 -0
- package/common.d.ts.map +1 -0
- package/common.js +14 -0
- package/complex/counter.cjs +21 -0
- package/complex/counter.d.cts +15 -0
- package/complex/counter.d.cts.map +1 -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.cjs +46 -0
- package/complex/global-config.d.cts +11 -0
- package/complex/global-config.d.cts.map +1 -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.cjs +19 -0
- package/complex/index.d.cts +4 -0
- package/complex/index.d.cts.map +1 -0
- package/complex/index.d.ts +4 -0
- package/complex/index.d.ts.map +1 -0
- package/complex/index.js +3 -0
- package/complex/modules-factory.cjs +50 -0
- package/complex/modules-factory.d.cts +49 -0
- package/complex/modules-factory.d.cts.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.cjs +13 -0
- package/cookie.d.cts +3 -0
- package/cookie.d.cts.map +1 -0
- package/cookie.d.ts +3 -0
- package/cookie.d.ts.map +1 -0
- package/cookie.js +9 -0
- package/css.cjs +28 -0
- package/css.d.cts +36 -0
- package/css.d.cts.map +1 -0
- package/css.d.ts +36 -0
- package/css.d.ts.map +1 -0
- package/css.js +20 -0
- package/data.cjs +58 -0
- package/data.d.cts +4 -0
- package/data.d.cts.map +1 -0
- package/data.d.ts +4 -0
- package/data.d.ts.map +1 -0
- package/data.js +52 -0
- package/date-time.cjs +171 -0
- package/date-time.d.cts +28 -0
- package/date-time.d.cts.map +1 -0
- package/date-time.d.ts +28 -0
- package/date-time.d.ts.map +1 -0
- package/date-time.js +160 -0
- package/device.cjs +28 -0
- package/device.d.cts +8 -0
- package/device.d.cts.map +1 -0
- package/device.d.ts +8 -0
- package/device.d.ts.map +1 -0
- package/device.js +21 -0
- package/encodings.cjs +270 -0
- package/encodings.d.cts +2 -0
- package/encodings.d.cts.map +1 -0
- package/encodings.d.ts +2 -0
- package/encodings.d.ts.map +1 -0
- package/encodings.js +267 -0
- package/errors.cjs +34 -0
- package/errors.d.cts +19 -0
- package/errors.d.cts.map +1 -0
- package/errors.d.ts +19 -0
- package/errors.d.ts.map +1 -0
- package/errors.js +30 -0
- package/file.cjs +29 -0
- package/file.d.cts +3 -0
- package/file.d.cts.map +1 -0
- package/file.d.ts +3 -0
- package/file.d.ts.map +1 -0
- package/file.js +24 -0
- package/format/_exports.cjs +20 -0
- package/format/_exports.d.cts +5 -0
- package/format/_exports.d.cts.map +1 -0
- package/format/_exports.d.ts +5 -0
- package/format/_exports.d.ts.map +1 -0
- package/format/_exports.js +4 -0
- package/format/constants.cjs +6 -0
- package/format/constants.d.cts +4 -0
- package/format/constants.d.cts.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.cjs +40 -0
- package/format/index.d.cts +3 -0
- package/format/index.d.cts.map +1 -0
- package/format/index.d.ts +3 -0
- package/format/index.d.ts.map +1 -0
- package/{src/format/index.ts → format/index.js} +1 -2
- package/format/number.cjs +48 -0
- package/format/number.d.cts +36 -0
- package/format/number.d.cts.map +1 -0
- package/format/number.d.ts +36 -0
- package/format/number.d.ts.map +1 -0
- package/format/number.js +44 -0
- package/format/percent.cjs +27 -0
- package/format/percent.d.cts +15 -0
- package/format/percent.d.cts.map +1 -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.cjs +8 -0
- package/format/skip-spaces.d.cts +5 -0
- package/format/skip-spaces.d.cts.map +1 -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.cjs +202 -0
- package/html.d.cts +44 -0
- package/html.d.cts.map +1 -0
- package/html.d.ts +44 -0
- package/html.d.ts.map +1 -0
- package/html.js +182 -0
- package/id.cjs +76 -0
- package/id.d.cts +63 -0
- package/id.d.cts.map +1 -0
- package/id.d.ts +63 -0
- package/id.d.ts.map +1 -0
- package/{src/id.ts → id.js} +6 -16
- package/imports.cjs +45 -0
- package/imports.d.cts +15 -0
- package/imports.d.cts.map +1 -0
- package/imports.d.ts +15 -0
- package/imports.d.ts.map +1 -0
- package/imports.js +40 -0
- package/math.cjs +23 -0
- package/math.d.cts +13 -0
- package/math.d.cts.map +1 -0
- package/math.d.ts +13 -0
- package/math.d.ts.map +1 -0
- package/math.js +17 -0
- package/media.cjs +115 -0
- package/media.d.cts +20 -0
- package/media.d.cts.map +1 -0
- package/media.d.ts +20 -0
- package/media.d.ts.map +1 -0
- package/media.js +103 -0
- package/mobx/apply-observable.cjs +16 -0
- package/mobx/apply-observable.d.cts +4 -0
- package/mobx/apply-observable.d.cts.map +1 -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.cjs +16 -0
- package/mobx/create-enhanced-atom.d.cts +11 -0
- package/mobx/create-enhanced-atom.d.cts.map +1 -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.cjs +61 -0
- package/mobx/deep-observable-struct.d.cts +7 -0
- package/mobx/deep-observable-struct.d.cts.map +1 -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.cjs +6 -0
- package/mobx/get-mobx-administration.d.cts +6 -0
- package/mobx/get-mobx-administration.d.cts.map +1 -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.cjs +21 -0
- package/mobx/index.d.cts +6 -0
- package/mobx/index.d.cts.map +1 -0
- package/mobx/index.d.ts +6 -0
- package/mobx/index.d.ts.map +1 -0
- package/mobx/index.js +5 -0
- package/mobx/lazy-observe.cjs +47 -0
- package/mobx/lazy-observe.d.cts +8 -0
- package/mobx/lazy-observe.d.cts.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.cjs +22 -0
- package/ms.d.cts +19 -0
- package/ms.d.cts.map +1 -0
- package/ms.d.ts +19 -0
- package/ms.d.ts.map +1 -0
- package/ms.js +18 -0
- package/number.cjs +16 -0
- package/number.d.cts +8 -0
- package/number.d.cts.map +1 -0
- package/number.d.ts +8 -0
- package/number.d.ts.map +1 -0
- package/number.js +13 -0
- package/package.json +163 -5
- package/parser/_exports.cjs +19 -0
- package/parser/_exports.d.cts +4 -0
- package/parser/_exports.d.cts.map +1 -0
- package/parser/_exports.d.ts +4 -0
- package/parser/_exports.d.ts.map +1 -0
- package/parser/_exports.js +3 -0
- package/parser/index.cjs +40 -0
- package/parser/index.d.cts +3 -0
- package/parser/index.d.cts.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} +1 -2
- package/parser/number.cjs +48 -0
- package/parser/number.d.cts +21 -0
- package/parser/number.d.cts.map +1 -0
- package/parser/number.d.ts +21 -0
- package/parser/number.d.ts.map +1 -0
- package/parser/number.js +44 -0
- package/parser/percent.cjs +8 -0
- package/parser/percent.d.cts +4 -0
- package/parser/percent.d.cts.map +1 -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.cjs +18 -0
- package/parser/string.d.cts +7 -0
- package/parser/string.d.cts.map +1 -0
- package/parser/string.d.ts +7 -0
- package/parser/string.d.ts.map +1 -0
- package/parser/string.js +14 -0
- package/price.cjs +21 -0
- package/price.d.cts +6 -0
- package/price.d.cts.map +1 -0
- package/price.d.ts +6 -0
- package/price.d.ts.map +1 -0
- package/price.js +17 -0
- package/random.cjs +25 -0
- package/random.d.cts +9 -0
- package/random.d.cts.map +1 -0
- package/random.d.ts +9 -0
- package/random.d.ts.map +1 -0
- package/random.js +14 -0
- package/react/hooks/index.cjs +37 -0
- package/react/hooks/index.d.cts +22 -0
- package/react/hooks/index.d.cts.map +1 -0
- package/react/hooks/index.d.ts +22 -0
- package/react/hooks/index.d.ts.map +1 -0
- package/react/hooks/index.js +21 -0
- package/react/hooks/use-abort-controller.cjs +15 -0
- package/react/hooks/use-abort-controller.d.cts +2 -0
- package/react/hooks/use-abort-controller.d.cts.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.cjs +8 -0
- package/react/hooks/use-abort-signal.d.cts +2 -0
- package/react/hooks/use-abort-signal.d.cts.map +1 -0
- package/react/hooks/use-abort-signal.d.ts +2 -0
- package/react/hooks/use-abort-signal.d.ts.map +1 -0
- package/react/hooks/use-abort-signal.js +4 -0
- package/react/hooks/use-click-outside.cjs +17 -0
- package/react/hooks/use-click-outside.d.cts +9 -0
- package/react/hooks/use-click-outside.d.cts.map +1 -0
- 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.cjs +19 -0
- package/react/hooks/use-constant.d.cts +9 -0
- package/react/hooks/use-constant.d.cts.map +1 -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.cjs +19 -0
- package/react/hooks/use-define-ref.d.cts +10 -0
- package/react/hooks/use-define-ref.d.cts.map +1 -0
- 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.cjs +12 -0
- package/react/hooks/use-element-ref.d.cts +2 -0
- package/react/hooks/use-element-ref.d.cts.map +1 -0
- 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.cjs +17 -0
- package/react/hooks/use-event-listener.d.cts +8 -0
- package/react/hooks/use-event-listener.d.cts.map +1 -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.cjs +23 -0
- package/react/hooks/use-event.d.cts +3 -0
- package/react/hooks/use-event.d.cts.map +1 -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.cjs +19 -0
- package/react/hooks/use-flag.d.cts +8 -0
- package/react/hooks/use-flag.d.cts.map +1 -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.cjs +11 -0
- package/react/hooks/use-force-update.d.cts +2 -0
- package/react/hooks/use-force-update.d.cts.map +1 -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.cjs +15 -0
- package/react/hooks/use-initial-height.d.cts +5 -0
- package/react/hooks/use-initial-height.d.cts.map +1 -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.cjs +31 -0
- package/react/hooks/use-instance.d.cts +27 -0
- package/react/hooks/use-instance.d.cts.map +1 -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} +9 -31
- package/react/hooks/use-intersection-observer.cjs +14 -0
- package/react/hooks/use-intersection-observer.d.cts +2 -0
- package/react/hooks/use-intersection-observer.d.cts.map +1 -0
- 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.cjs +12 -0
- package/react/hooks/use-last-defined-value.d.cts +2 -0
- package/react/hooks/use-last-defined-value.d.cts.map +1 -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.cjs +12 -0
- package/react/hooks/use-last-value-ref.d.cts +2 -0
- package/react/hooks/use-last-value-ref.d.cts.map +1 -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.cjs +14 -0
- package/react/hooks/use-life-cycle.d.cts +5 -0
- package/react/hooks/use-life-cycle.d.cts.map +1 -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.cjs +15 -0
- package/react/hooks/use-resize-observer.d.cts +2 -0
- package/react/hooks/use-resize-observer.d.cts.map +1 -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.cjs +10 -0
- package/react/hooks/use-sync-ref.d.cts +2 -0
- package/react/hooks/use-sync-ref.d.cts.map +1 -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.cjs +10 -0
- package/react/hooks/use-toggle.d.cts +2 -0
- package/react/hooks/use-toggle.d.cts.map +1 -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.cjs +12 -0
- package/react/hooks/use-value.d.cts +5 -0
- package/react/hooks/use-value.d.cts.map +1 -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.cjs +18 -0
- package/react/hooks/use-visibility-state.d.cts +2 -0
- package/react/hooks/use-visibility-state.d.cts.map +1 -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.cjs +17 -0
- package/react/index.d.cts +2 -0
- package/react/index.d.cts.map +1 -0
- package/react/index.d.ts +2 -0
- package/react/index.d.ts.map +1 -0
- package/react/index.js +1 -0
- package/sound.cjs +16 -0
- package/sound.d.cts +7 -0
- package/sound.d.cts.map +1 -0
- package/sound.d.ts +7 -0
- package/sound.d.ts.map +1 -0
- package/sound.js +12 -0
- package/storage.cjs +48 -0
- package/storage.d.cts +39 -0
- package/storage.d.cts.map +1 -0
- package/storage.d.ts +39 -0
- package/storage.d.ts.map +1 -0
- package/storage.js +43 -0
- package/text.cjs +53 -0
- package/text.d.cts +15 -0
- package/text.d.cts.map +1 -0
- package/text.d.ts +15 -0
- package/text.d.ts.map +1 -0
- package/text.js +48 -0
- package/type-guard/_exports.cjs +129 -0
- package/type-guard/_exports.d.cts +86 -0
- package/type-guard/_exports.d.cts.map +1 -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.cjs +40 -0
- package/type-guard/index.d.cts +3 -0
- package/type-guard/index.d.cts.map +1 -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} +1 -2
- package/utility-types.d.ts +396 -0
- package/utils/types.cjs +2 -0
- package/utils/types.d.cts +395 -0
- package/utils/types.d.cts.map +1 -0
- package/utils/types.d.ts +395 -0
- package/utils/types.d.ts.map +1 -0
- package/utils/types.js +1 -0
- package/vibrate.cjs +12 -0
- package/vibrate.d.cts +5 -0
- package/vibrate.d.cts.map +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/common.ts +0 -26
- 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/index.ts +0 -3
- 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/_exports.ts +0 -4
- 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/index.ts +0 -5
- package/src/mobx/lazy-observe.ts +0 -59
- package/src/ms.ts +0 -20
- package/src/number.ts +0 -14
- package/src/parser/_exports.ts +0 -3
- 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/index.ts +0 -21
- package/src/react/hooks/use-abort-controller.ts +0 -15
- package/src/react/hooks/use-abort-signal.ts +0 -5
- 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/react/index.ts +0 -1
- 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/encodings.ts
DELETED
|
@@ -1,270 +0,0 @@
|
|
|
1
|
-
import type { AnyObject } from './utils/types.js';
|
|
2
|
-
|
|
3
|
-
const DMap: AnyObject = {
|
|
4
|
-
0: 0,
|
|
5
|
-
1: 1,
|
|
6
|
-
2: 2,
|
|
7
|
-
3: 3,
|
|
8
|
-
4: 4,
|
|
9
|
-
5: 5,
|
|
10
|
-
6: 6,
|
|
11
|
-
7: 7,
|
|
12
|
-
8: 8,
|
|
13
|
-
9: 9,
|
|
14
|
-
10: 10,
|
|
15
|
-
11: 11,
|
|
16
|
-
12: 12,
|
|
17
|
-
13: 13,
|
|
18
|
-
14: 14,
|
|
19
|
-
15: 15,
|
|
20
|
-
16: 16,
|
|
21
|
-
17: 17,
|
|
22
|
-
18: 18,
|
|
23
|
-
19: 19,
|
|
24
|
-
20: 20,
|
|
25
|
-
21: 21,
|
|
26
|
-
22: 22,
|
|
27
|
-
23: 23,
|
|
28
|
-
24: 24,
|
|
29
|
-
25: 25,
|
|
30
|
-
26: 26,
|
|
31
|
-
27: 27,
|
|
32
|
-
28: 28,
|
|
33
|
-
29: 29,
|
|
34
|
-
30: 30,
|
|
35
|
-
31: 31,
|
|
36
|
-
32: 32,
|
|
37
|
-
33: 33,
|
|
38
|
-
34: 34,
|
|
39
|
-
35: 35,
|
|
40
|
-
36: 36,
|
|
41
|
-
37: 37,
|
|
42
|
-
38: 38,
|
|
43
|
-
39: 39,
|
|
44
|
-
40: 40,
|
|
45
|
-
41: 41,
|
|
46
|
-
42: 42,
|
|
47
|
-
43: 43,
|
|
48
|
-
44: 44,
|
|
49
|
-
45: 45,
|
|
50
|
-
46: 46,
|
|
51
|
-
47: 47,
|
|
52
|
-
48: 48,
|
|
53
|
-
49: 49,
|
|
54
|
-
50: 50,
|
|
55
|
-
51: 51,
|
|
56
|
-
52: 52,
|
|
57
|
-
53: 53,
|
|
58
|
-
54: 54,
|
|
59
|
-
55: 55,
|
|
60
|
-
56: 56,
|
|
61
|
-
57: 57,
|
|
62
|
-
58: 58,
|
|
63
|
-
59: 59,
|
|
64
|
-
60: 60,
|
|
65
|
-
61: 61,
|
|
66
|
-
62: 62,
|
|
67
|
-
63: 63,
|
|
68
|
-
64: 64,
|
|
69
|
-
65: 65,
|
|
70
|
-
66: 66,
|
|
71
|
-
67: 67,
|
|
72
|
-
68: 68,
|
|
73
|
-
69: 69,
|
|
74
|
-
70: 70,
|
|
75
|
-
71: 71,
|
|
76
|
-
72: 72,
|
|
77
|
-
73: 73,
|
|
78
|
-
74: 74,
|
|
79
|
-
75: 75,
|
|
80
|
-
76: 76,
|
|
81
|
-
77: 77,
|
|
82
|
-
78: 78,
|
|
83
|
-
79: 79,
|
|
84
|
-
80: 80,
|
|
85
|
-
81: 81,
|
|
86
|
-
82: 82,
|
|
87
|
-
83: 83,
|
|
88
|
-
84: 84,
|
|
89
|
-
85: 85,
|
|
90
|
-
86: 86,
|
|
91
|
-
87: 87,
|
|
92
|
-
88: 88,
|
|
93
|
-
89: 89,
|
|
94
|
-
90: 90,
|
|
95
|
-
91: 91,
|
|
96
|
-
92: 92,
|
|
97
|
-
93: 93,
|
|
98
|
-
94: 94,
|
|
99
|
-
95: 95,
|
|
100
|
-
96: 96,
|
|
101
|
-
97: 97,
|
|
102
|
-
98: 98,
|
|
103
|
-
99: 99,
|
|
104
|
-
100: 100,
|
|
105
|
-
101: 101,
|
|
106
|
-
102: 102,
|
|
107
|
-
103: 103,
|
|
108
|
-
104: 104,
|
|
109
|
-
105: 105,
|
|
110
|
-
106: 106,
|
|
111
|
-
107: 107,
|
|
112
|
-
108: 108,
|
|
113
|
-
109: 109,
|
|
114
|
-
110: 110,
|
|
115
|
-
111: 111,
|
|
116
|
-
112: 112,
|
|
117
|
-
113: 113,
|
|
118
|
-
114: 114,
|
|
119
|
-
115: 115,
|
|
120
|
-
116: 116,
|
|
121
|
-
117: 117,
|
|
122
|
-
118: 118,
|
|
123
|
-
119: 119,
|
|
124
|
-
120: 120,
|
|
125
|
-
121: 121,
|
|
126
|
-
122: 122,
|
|
127
|
-
123: 123,
|
|
128
|
-
124: 124,
|
|
129
|
-
125: 125,
|
|
130
|
-
126: 126,
|
|
131
|
-
127: 127,
|
|
132
|
-
1027: 129,
|
|
133
|
-
8225: 135,
|
|
134
|
-
1046: 198,
|
|
135
|
-
8222: 132,
|
|
136
|
-
1047: 199,
|
|
137
|
-
1168: 165,
|
|
138
|
-
1048: 200,
|
|
139
|
-
1113: 154,
|
|
140
|
-
1049: 201,
|
|
141
|
-
1045: 197,
|
|
142
|
-
1050: 202,
|
|
143
|
-
1028: 170,
|
|
144
|
-
160: 160,
|
|
145
|
-
1040: 192,
|
|
146
|
-
1051: 203,
|
|
147
|
-
164: 164,
|
|
148
|
-
166: 166,
|
|
149
|
-
167: 167,
|
|
150
|
-
169: 169,
|
|
151
|
-
171: 171,
|
|
152
|
-
172: 172,
|
|
153
|
-
173: 173,
|
|
154
|
-
174: 174,
|
|
155
|
-
1053: 205,
|
|
156
|
-
176: 176,
|
|
157
|
-
177: 177,
|
|
158
|
-
1114: 156,
|
|
159
|
-
181: 181,
|
|
160
|
-
182: 182,
|
|
161
|
-
183: 183,
|
|
162
|
-
8221: 148,
|
|
163
|
-
187: 187,
|
|
164
|
-
1029: 189,
|
|
165
|
-
1056: 208,
|
|
166
|
-
1057: 209,
|
|
167
|
-
1058: 210,
|
|
168
|
-
8364: 136,
|
|
169
|
-
1112: 188,
|
|
170
|
-
1115: 158,
|
|
171
|
-
1059: 211,
|
|
172
|
-
1060: 212,
|
|
173
|
-
1030: 178,
|
|
174
|
-
1061: 213,
|
|
175
|
-
1062: 214,
|
|
176
|
-
1063: 215,
|
|
177
|
-
1116: 157,
|
|
178
|
-
1064: 216,
|
|
179
|
-
1065: 217,
|
|
180
|
-
1031: 175,
|
|
181
|
-
1066: 218,
|
|
182
|
-
1067: 219,
|
|
183
|
-
1068: 220,
|
|
184
|
-
1069: 221,
|
|
185
|
-
1070: 222,
|
|
186
|
-
1032: 163,
|
|
187
|
-
8226: 149,
|
|
188
|
-
1071: 223,
|
|
189
|
-
1072: 224,
|
|
190
|
-
8482: 153,
|
|
191
|
-
1073: 225,
|
|
192
|
-
8240: 137,
|
|
193
|
-
1118: 162,
|
|
194
|
-
1074: 226,
|
|
195
|
-
1110: 179,
|
|
196
|
-
8230: 133,
|
|
197
|
-
1075: 227,
|
|
198
|
-
1033: 138,
|
|
199
|
-
1076: 228,
|
|
200
|
-
1077: 229,
|
|
201
|
-
8211: 150,
|
|
202
|
-
1078: 230,
|
|
203
|
-
1119: 159,
|
|
204
|
-
1079: 231,
|
|
205
|
-
1042: 194,
|
|
206
|
-
1080: 232,
|
|
207
|
-
1034: 140,
|
|
208
|
-
1025: 168,
|
|
209
|
-
1081: 233,
|
|
210
|
-
1082: 234,
|
|
211
|
-
8212: 151,
|
|
212
|
-
1083: 235,
|
|
213
|
-
1169: 180,
|
|
214
|
-
1084: 236,
|
|
215
|
-
1052: 204,
|
|
216
|
-
1085: 237,
|
|
217
|
-
1035: 142,
|
|
218
|
-
1086: 238,
|
|
219
|
-
1087: 239,
|
|
220
|
-
1088: 240,
|
|
221
|
-
1089: 241,
|
|
222
|
-
1090: 242,
|
|
223
|
-
1036: 141,
|
|
224
|
-
1041: 193,
|
|
225
|
-
1091: 243,
|
|
226
|
-
1092: 244,
|
|
227
|
-
8224: 134,
|
|
228
|
-
1093: 245,
|
|
229
|
-
8470: 185,
|
|
230
|
-
1094: 246,
|
|
231
|
-
1054: 206,
|
|
232
|
-
1095: 247,
|
|
233
|
-
1096: 248,
|
|
234
|
-
8249: 139,
|
|
235
|
-
1097: 249,
|
|
236
|
-
1098: 250,
|
|
237
|
-
1044: 196,
|
|
238
|
-
1099: 251,
|
|
239
|
-
1111: 191,
|
|
240
|
-
1055: 207,
|
|
241
|
-
1100: 252,
|
|
242
|
-
1038: 161,
|
|
243
|
-
8220: 147,
|
|
244
|
-
1101: 253,
|
|
245
|
-
8250: 155,
|
|
246
|
-
1102: 254,
|
|
247
|
-
8216: 145,
|
|
248
|
-
1103: 255,
|
|
249
|
-
1043: 195,
|
|
250
|
-
1105: 184,
|
|
251
|
-
1039: 143,
|
|
252
|
-
1026: 128,
|
|
253
|
-
1106: 144,
|
|
254
|
-
8218: 130,
|
|
255
|
-
1107: 131,
|
|
256
|
-
8217: 146,
|
|
257
|
-
1108: 186,
|
|
258
|
-
1109: 190,
|
|
259
|
-
};
|
|
260
|
-
|
|
261
|
-
export function unicodeToWin1251(s: string) {
|
|
262
|
-
const L = [];
|
|
263
|
-
for (let i = 0; i < s.length; i++) {
|
|
264
|
-
const ord = s.charCodeAt(i);
|
|
265
|
-
if (!(ord in DMap))
|
|
266
|
-
throw new Error(`Character ${s.charAt(i)} isn't supported by win1251!`);
|
|
267
|
-
L.push(String.fromCharCode(DMap[ord]));
|
|
268
|
-
}
|
|
269
|
-
return L.join('');
|
|
270
|
-
}
|
package/src/errors.ts
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { typeGuard } from './type-guard/index.js';
|
|
2
|
-
import type { Maybe } from './utils/types.js';
|
|
3
|
-
|
|
4
|
-
type GetErrorTextEnhancer = (error: any) => string;
|
|
5
|
-
type GetErrorTextFormatErrorFn = (error: Error) => string;
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Universal function for transforming any errors into readable error text
|
|
9
|
-
*
|
|
10
|
-
* This function can be enhanced with custom handlers using:
|
|
11
|
-
* - `getErrorText.unknownErrorText`
|
|
12
|
-
* - `getErrorText.formatError`
|
|
13
|
-
* - `getErrorText.enhance`
|
|
14
|
-
*/
|
|
15
|
-
export const getErrorText = (error: unknown) => {
|
|
16
|
-
if (!error) {
|
|
17
|
-
return getErrorText.unknownErrorText;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
if (typeGuard.isString(error)) {
|
|
21
|
-
return error || getErrorText.unknownErrorText;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
if (error instanceof Error) {
|
|
25
|
-
return (
|
|
26
|
-
(getErrorText.formatError?.(error) ?? error.message) ||
|
|
27
|
-
getErrorText.unknownErrorText
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
if (getErrorText.enhance) {
|
|
32
|
-
return getErrorText.enhance(error) ?? getErrorText.unknownErrorText;
|
|
33
|
-
} else {
|
|
34
|
-
return getErrorText.unknownErrorText;
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
getErrorText.unknownErrorText = '';
|
|
39
|
-
getErrorText.formatError = null as Maybe<GetErrorTextFormatErrorFn>;
|
|
40
|
-
getErrorText.enhance = null as Maybe<GetErrorTextEnhancer>;
|
package/src/file.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export const getBase64FromFile = (file: File) => {
|
|
2
|
-
return new Promise<string>((resolve, reject) => {
|
|
3
|
-
const reader = new FileReader();
|
|
4
|
-
reader.readAsDataURL(file);
|
|
5
|
-
reader.onload = () => {
|
|
6
|
-
resolve(reader.result!.toString());
|
|
7
|
-
};
|
|
8
|
-
reader.onerror = (error) => {
|
|
9
|
-
reject(error);
|
|
10
|
-
};
|
|
11
|
-
});
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export const getTextFromFile = (file: File, encoding?: string) => {
|
|
15
|
-
return new Promise<string>((resolve, reject) => {
|
|
16
|
-
const reader = new FileReader();
|
|
17
|
-
reader.readAsText(file, encoding);
|
|
18
|
-
reader.onload = () => {
|
|
19
|
-
resolve(reader.result!.toString());
|
|
20
|
-
};
|
|
21
|
-
reader.onerror = (error) => {
|
|
22
|
-
reject(error);
|
|
23
|
-
};
|
|
24
|
-
});
|
|
25
|
-
};
|
package/src/format/_exports.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { describe, expect, test } from 'vitest';
|
|
2
|
-
|
|
3
|
-
import { number } from './number';
|
|
4
|
-
|
|
5
|
-
describe('format.number', () => {
|
|
6
|
-
test('[BUG] Infinite formatting of the number 23162 with an empty delimiter', () => {
|
|
7
|
-
expect(number(23_162, { digits: 4, cutZeros: true, delimiter: '' })).toBe(
|
|
8
|
-
'23162',
|
|
9
|
-
);
|
|
10
|
-
});
|
|
11
|
-
test('Formatting the number 23162', () => {
|
|
12
|
-
expect(number(23_162, { digits: 4, cutZeros: true, delimiter: '_' })).toBe(
|
|
13
|
-
'23_162',
|
|
14
|
-
);
|
|
15
|
-
});
|
|
16
|
-
});
|
package/src/format/number.ts
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { number as toNumber } from '../parser/number.js';
|
|
2
|
-
import { typeGuard } from '../type-guard/index.js';
|
|
3
|
-
import type { Maybe } from '../utils/types.js';
|
|
4
|
-
|
|
5
|
-
import { NO_VALUE } from './constants.js';
|
|
6
|
-
|
|
7
|
-
export interface NumberFormatSettings {
|
|
8
|
-
delimiter?: string;
|
|
9
|
-
/**
|
|
10
|
-
* digitsOnlyForFloat - Show digits after decimal point only if they are not zeros after converting to number.
|
|
11
|
-
* Example: "0.00" -> "0", "0.10" -> "0.1", but "0.003" -> "0.003"
|
|
12
|
-
*
|
|
13
|
-
* @default true
|
|
14
|
-
*/
|
|
15
|
-
digitsOnlyForFloat?: boolean;
|
|
16
|
-
/**
|
|
17
|
-
* Text which will be returned if the value is undefined, null, NaN, Infinity or empty string.
|
|
18
|
-
* Example: "–" will be returned if the value is undefined and emptyText is "–".
|
|
19
|
-
*/
|
|
20
|
-
emptyText?: string;
|
|
21
|
-
/**
|
|
22
|
-
* Text to append to the end of the formatted number.
|
|
23
|
-
* Example: if value is 1000 and postfix is "₽", result will be "1 000₽".
|
|
24
|
-
*/
|
|
25
|
-
postfix?: string;
|
|
26
|
-
/**
|
|
27
|
-
* Fixed number of digits after the decimal point (number.toFixed() method)
|
|
28
|
-
* If set to false, the truncation is ignored!
|
|
29
|
-
*/
|
|
30
|
-
digits?: number | false;
|
|
31
|
-
/**
|
|
32
|
-
* Remove trailing zeros from the end of the number
|
|
33
|
-
* Example: 0.010000000000000000000000000000000000000000000 -> 0.01
|
|
34
|
-
*/
|
|
35
|
-
cutZeros?: boolean;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export const number = (
|
|
39
|
-
rawValue: Maybe<string | number>,
|
|
40
|
-
userSettings?: Maybe<NumberFormatSettings>,
|
|
41
|
-
): string => {
|
|
42
|
-
const settings = {
|
|
43
|
-
...number.defaultSettings,
|
|
44
|
-
...userSettings,
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
const digits = settings.digits ?? 0;
|
|
48
|
-
const cutZeros = settings?.cutZeros ?? false;
|
|
49
|
-
const delimiter = settings.delimiter ?? ' ';
|
|
50
|
-
const postfix = settings.postfix ?? '';
|
|
51
|
-
const emptyText = settings.emptyText ?? NO_VALUE;
|
|
52
|
-
const digitsOnlyForFloat = settings.digitsOnlyForFloat ?? true;
|
|
53
|
-
|
|
54
|
-
let value: Maybe<number>;
|
|
55
|
-
|
|
56
|
-
if (typeGuard.isString(rawValue)) {
|
|
57
|
-
value = toNumber(value, { fallback: undefined });
|
|
58
|
-
} else {
|
|
59
|
-
value = rawValue;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
if (typeGuard.isNumber(value)) {
|
|
63
|
-
let raw: string = `${value}`;
|
|
64
|
-
|
|
65
|
-
if (digits !== false) {
|
|
66
|
-
raw = value.toFixed(digits);
|
|
67
|
-
}
|
|
68
|
-
if (cutZeros) {
|
|
69
|
-
raw = `${+raw}`;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
const [integerPart, decimalPart] = raw.split('.', 2);
|
|
73
|
-
|
|
74
|
-
let formattedIntegerPart = integerPart;
|
|
75
|
-
let formattedDecimalPart = '';
|
|
76
|
-
|
|
77
|
-
if (decimalPart && (!digitsOnlyForFloat || !/^0+$/.test(decimalPart))) {
|
|
78
|
-
formattedDecimalPart = `.${decimalPart}`;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
const rgx = /(\d+)(\d{3})/;
|
|
82
|
-
|
|
83
|
-
while (rgx.test(formattedIntegerPart) && delimiter) {
|
|
84
|
-
formattedIntegerPart = formattedIntegerPart.replace(
|
|
85
|
-
rgx,
|
|
86
|
-
`$1${delimiter}$2`,
|
|
87
|
-
);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
return formattedIntegerPart + formattedDecimalPart + postfix;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
return emptyText;
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
number.defaultSettings = {} as NumberFormatSettings;
|
package/src/format/percent.ts
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { type NumberParserSettings, number } from '../parser/number.js';
|
|
2
|
-
import { typeGuard } from '../type-guard/index.js';
|
|
3
|
-
import type { Maybe } from '../utils/types.js';
|
|
4
|
-
|
|
5
|
-
import { NO_VALUE } from './constants.js';
|
|
6
|
-
|
|
7
|
-
export interface PercentFormatSettings
|
|
8
|
-
extends Omit<NumberParserSettings, 'fallback'> {
|
|
9
|
-
divider?: string;
|
|
10
|
-
delimiter?: string;
|
|
11
|
-
symbol?: string;
|
|
12
|
-
emptyText?: string;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* 100 -> 100%
|
|
17
|
-
* 99.123214412 -> 99.12%
|
|
18
|
-
* 99.123214412 -> 99,12%
|
|
19
|
-
*/
|
|
20
|
-
export const percent = (
|
|
21
|
-
value: Maybe<number | string>,
|
|
22
|
-
settings?: PercentFormatSettings,
|
|
23
|
-
) => {
|
|
24
|
-
const numericValue = number(value, {
|
|
25
|
-
...settings,
|
|
26
|
-
digits: settings?.digits ?? 2,
|
|
27
|
-
fallback: Number.NaN,
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
if (typeGuard.isNumber(numericValue)) {
|
|
31
|
-
const divider = settings?.divider ?? '.';
|
|
32
|
-
|
|
33
|
-
const formattedPercent =
|
|
34
|
-
divider === '.' ? numericValue : `${numericValue}`.replace('.', divider);
|
|
35
|
-
|
|
36
|
-
return `${formattedPercent}${settings?.delimiter ?? ''}${settings?.symbol ?? '%'}`;
|
|
37
|
-
} else {
|
|
38
|
-
return settings?.emptyText ?? NO_VALUE;
|
|
39
|
-
}
|
|
40
|
-
};
|