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
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.lazyObserve = void 0;
|
|
4
|
+
const mobx_1 = require("mobx");
|
|
5
|
+
const lazyObserve = ({ context, property, onStart, onEnd, endDelay = 0, }) => {
|
|
6
|
+
let timeoutId;
|
|
7
|
+
let metaData;
|
|
8
|
+
const properties = Array.isArray(property) ? property : [property];
|
|
9
|
+
let isObserving = false;
|
|
10
|
+
const start = () => {
|
|
11
|
+
if (isObserving) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
isObserving = true;
|
|
15
|
+
if (timeoutId) {
|
|
16
|
+
clearTimeout(timeoutId);
|
|
17
|
+
timeoutId = undefined;
|
|
18
|
+
}
|
|
19
|
+
metaData = onStart();
|
|
20
|
+
};
|
|
21
|
+
const cleanup = () => {
|
|
22
|
+
if (!isObserving) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
if (timeoutId) {
|
|
26
|
+
clearTimeout(timeoutId);
|
|
27
|
+
timeoutId = undefined;
|
|
28
|
+
}
|
|
29
|
+
timeoutId = setTimeout(() => {
|
|
30
|
+
onEnd(metaData, cleanup);
|
|
31
|
+
timeoutId = undefined;
|
|
32
|
+
metaData = undefined;
|
|
33
|
+
}, endDelay);
|
|
34
|
+
};
|
|
35
|
+
properties.forEach((property) => {
|
|
36
|
+
if (context) {
|
|
37
|
+
(0, mobx_1.onBecomeObserved)(context, property, start);
|
|
38
|
+
(0, mobx_1.onBecomeUnobserved)(context, property, cleanup);
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
(0, mobx_1.onBecomeObserved)(property, start);
|
|
42
|
+
(0, mobx_1.onBecomeUnobserved)(property, cleanup);
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
return cleanup;
|
|
46
|
+
};
|
|
47
|
+
exports.lazyObserve = lazyObserve;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const lazyObserve: <TMetaData = void>({ context, property, onStart, onEnd, endDelay, }: {
|
|
2
|
+
context?: any;
|
|
3
|
+
property: any | any[];
|
|
4
|
+
onStart: () => TMetaData;
|
|
5
|
+
onEnd: (metaData: TMetaData, cleanupFn: VoidFunction) => void;
|
|
6
|
+
endDelay?: number;
|
|
7
|
+
}) => () => void;
|
|
8
|
+
//# sourceMappingURL=lazy-observe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lazy-observe.d.ts","sourceRoot":"","sources":["../../src/mobx/lazy-observe.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,GAAI,SAAS,GAAG,IAAI,EAAE,kDAM3C;IACD,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,QAAQ,EAAE,GAAG,GAAG,GAAG,EAAE,CAAC;IACtB,OAAO,EAAE,MAAM,SAAS,CAAC;IACzB,KAAK,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,KAAK,IAAI,CAAC;IAC9D,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,eA4CA,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const lazyObserve: <TMetaData = void>({ context, property, onStart, onEnd, endDelay, }: {
|
|
2
|
+
context?: any;
|
|
3
|
+
property: any | any[];
|
|
4
|
+
onStart: () => TMetaData;
|
|
5
|
+
onEnd: (metaData: TMetaData, cleanupFn: VoidFunction) => void;
|
|
6
|
+
endDelay?: number;
|
|
7
|
+
}) => () => void;
|
|
8
|
+
//# sourceMappingURL=lazy-observe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lazy-observe.d.ts","sourceRoot":"","sources":["../../src/mobx/lazy-observe.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,GAAI,SAAS,GAAG,IAAI,EAAE,kDAM3C;IACD,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,QAAQ,EAAE,GAAG,GAAG,GAAG,EAAE,CAAC;IACtB,OAAO,EAAE,MAAM,SAAS,CAAC;IACzB,KAAK,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,KAAK,IAAI,CAAC;IAC9D,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,eA4CA,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { onBecomeObserved, onBecomeUnobserved } from 'mobx';
|
|
2
|
+
export const lazyObserve = ({ context, property, onStart, onEnd, endDelay = 0, }) => {
|
|
3
|
+
let timeoutId;
|
|
4
|
+
let metaData;
|
|
5
|
+
const properties = Array.isArray(property) ? property : [property];
|
|
6
|
+
let isObserving = false;
|
|
7
|
+
const start = () => {
|
|
8
|
+
if (isObserving) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
isObserving = true;
|
|
12
|
+
if (timeoutId) {
|
|
13
|
+
clearTimeout(timeoutId);
|
|
14
|
+
timeoutId = undefined;
|
|
15
|
+
}
|
|
16
|
+
metaData = onStart();
|
|
17
|
+
};
|
|
18
|
+
const cleanup = () => {
|
|
19
|
+
if (!isObserving) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
if (timeoutId) {
|
|
23
|
+
clearTimeout(timeoutId);
|
|
24
|
+
timeoutId = undefined;
|
|
25
|
+
}
|
|
26
|
+
timeoutId = setTimeout(() => {
|
|
27
|
+
onEnd(metaData, cleanup);
|
|
28
|
+
timeoutId = undefined;
|
|
29
|
+
metaData = undefined;
|
|
30
|
+
}, endDelay);
|
|
31
|
+
};
|
|
32
|
+
properties.forEach((property) => {
|
|
33
|
+
if (context) {
|
|
34
|
+
onBecomeObserved(context, property, start);
|
|
35
|
+
onBecomeUnobserved(context, property, cleanup);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
onBecomeObserved(property, start);
|
|
39
|
+
onBecomeUnobserved(property, cleanup);
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
return cleanup;
|
|
43
|
+
};
|
package/ms.cjs
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ms = exports.unitsToMs = void 0;
|
|
4
|
+
exports.unitsToMs = {
|
|
5
|
+
ms: 1,
|
|
6
|
+
sec: 1000,
|
|
7
|
+
min: 1000 * 60,
|
|
8
|
+
hour: 1000 * 60 * 60,
|
|
9
|
+
day: 1000 * 60 * 60 * 24,
|
|
10
|
+
week: 1000 * 60 * 60 * 24 * 7,
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Переводит значение в юнитах в миллисекунды
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* ms(1, 'min') // 60_000
|
|
18
|
+
* ms(30, 'sec') // 30_000
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
const ms = (value, unit = 'ms') => value * exports.unitsToMs[unit];
|
|
22
|
+
exports.ms = ms;
|
package/ms.d.cts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const unitsToMs: {
|
|
2
|
+
readonly ms: 1;
|
|
3
|
+
readonly sec: 1000;
|
|
4
|
+
readonly min: number;
|
|
5
|
+
readonly hour: number;
|
|
6
|
+
readonly day: number;
|
|
7
|
+
readonly week: number;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Переводит значение в юнитах в миллисекунды
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* ms(1, 'min') // 60_000
|
|
15
|
+
* ms(30, 'sec') // 30_000
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare const ms: (value: number, unit?: keyof typeof unitsToMs) => number;
|
|
19
|
+
//# sourceMappingURL=ms.d.ts.map
|
package/ms.d.cts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ms.d.ts","sourceRoot":"","sources":["../src/ms.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS;;;;;;;CAOZ,CAAC;AAEX;;;;;;;;GAQG;AACH,eAAO,MAAM,EAAE,GAAI,OAAO,MAAM,EAAE,OAAM,MAAM,OAAO,SAAgB,WAC5C,CAAC"}
|
package/ms.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const unitsToMs: {
|
|
2
|
+
readonly ms: 1;
|
|
3
|
+
readonly sec: 1000;
|
|
4
|
+
readonly min: number;
|
|
5
|
+
readonly hour: number;
|
|
6
|
+
readonly day: number;
|
|
7
|
+
readonly week: number;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Переводит значение в юнитах в миллисекунды
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* ms(1, 'min') // 60_000
|
|
15
|
+
* ms(30, 'sec') // 30_000
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare const ms: (value: number, unit?: keyof typeof unitsToMs) => number;
|
|
19
|
+
//# sourceMappingURL=ms.d.ts.map
|
package/ms.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ms.d.ts","sourceRoot":"","sources":["../src/ms.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS;;;;;;;CAOZ,CAAC;AAEX;;;;;;;;GAQG;AACH,eAAO,MAAM,EAAE,GAAI,OAAO,MAAM,EAAE,OAAM,MAAM,OAAO,SAAgB,WAC5C,CAAC"}
|
package/ms.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export const unitsToMs = {
|
|
2
|
+
ms: 1,
|
|
3
|
+
sec: 1000,
|
|
4
|
+
min: 1000 * 60,
|
|
5
|
+
hour: 1000 * 60 * 60,
|
|
6
|
+
day: 1000 * 60 * 60 * 24,
|
|
7
|
+
week: 1000 * 60 * 60 * 24 * 7,
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Переводит значение в юнитах в миллисекунды
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* ms(1, 'min') // 60_000
|
|
15
|
+
* ms(30, 'sec') // 30_000
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export const ms = (value, unit = 'ms') => value * unitsToMs[unit];
|
package/number.cjs
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.round = round;
|
|
4
|
+
/**
|
|
5
|
+
* Works like `parseFloat(number.toFixed(4))` but performance better
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* round(191.212999999999999999999999, 4) // 191.213
|
|
9
|
+
*/
|
|
10
|
+
function round(value, decimalPlaces = 0) {
|
|
11
|
+
if (!decimalPlaces) {
|
|
12
|
+
return Math.round(value);
|
|
13
|
+
}
|
|
14
|
+
const factor = 10 ** decimalPlaces;
|
|
15
|
+
return Math.round(value * factor) / factor;
|
|
16
|
+
}
|
package/number.d.cts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Works like `parseFloat(number.toFixed(4))` but performance better
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* round(191.212999999999999999999999, 4) // 191.213
|
|
6
|
+
*/
|
|
7
|
+
export declare function round(value: number, decimalPlaces?: number): number;
|
|
8
|
+
//# sourceMappingURL=number.d.ts.map
|
package/number.d.cts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"number.d.ts","sourceRoot":"","sources":["../src/number.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,aAAa,GAAE,MAAU,GAAG,MAAM,CAOtE"}
|
package/number.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Works like `parseFloat(number.toFixed(4))` but performance better
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* round(191.212999999999999999999999, 4) // 191.213
|
|
6
|
+
*/
|
|
7
|
+
export declare function round(value: number, decimalPlaces?: number): number;
|
|
8
|
+
//# sourceMappingURL=number.d.ts.map
|
package/number.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"number.d.ts","sourceRoot":"","sources":["../src/number.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,aAAa,GAAE,MAAU,GAAG,MAAM,CAOtE"}
|
package/number.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Works like `parseFloat(number.toFixed(4))` but performance better
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* round(191.212999999999999999999999, 4) // 191.213
|
|
6
|
+
*/
|
|
7
|
+
export function round(value, decimalPlaces = 0) {
|
|
8
|
+
if (!decimalPlaces) {
|
|
9
|
+
return Math.round(value);
|
|
10
|
+
}
|
|
11
|
+
const factor = 10 ** decimalPlaces;
|
|
12
|
+
return Math.round(value * factor) / factor;
|
|
13
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yummies",
|
|
3
|
-
"version": "5.4.
|
|
3
|
+
"version": "5.4.8",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": "js2me",
|
|
6
6
|
"license": "MIT",
|
|
@@ -43,16 +43,174 @@
|
|
|
43
43
|
"@vitest/coverage-istanbul": "^3.1.2",
|
|
44
44
|
"commitfmt": "^1.0.4",
|
|
45
45
|
"js2me-biome-config": "^1.0.3",
|
|
46
|
-
"
|
|
46
|
+
"sborshik": "^1.0.5",
|
|
47
47
|
"jsdom": "^26.1.0",
|
|
48
48
|
"lefthook": "^1.11.16",
|
|
49
49
|
"nodemon": "^3.1.9",
|
|
50
50
|
"rimraf": "^6.0.1",
|
|
51
51
|
"tsx": "^4.20.5",
|
|
52
52
|
"typescript": "^5.8.3",
|
|
53
|
-
"vitest": "^3.1.2"
|
|
53
|
+
"vitest": "^3.1.2",
|
|
54
|
+
"zshy": "^0.4.2"
|
|
54
55
|
},
|
|
55
56
|
"type": "module",
|
|
57
|
+
"files": [
|
|
58
|
+
"*"
|
|
59
|
+
],
|
|
60
|
+
"exports": {
|
|
61
|
+
"./package.json": "./package.json",
|
|
62
|
+
"./complex": {
|
|
63
|
+
"types": "./complex/index.d.cts",
|
|
64
|
+
"import": "./complex/index.js",
|
|
65
|
+
"require": "./complex/index.cjs"
|
|
66
|
+
},
|
|
67
|
+
"./format": {
|
|
68
|
+
"types": "./format/index.d.cts",
|
|
69
|
+
"import": "./format/index.js",
|
|
70
|
+
"require": "./format/index.cjs"
|
|
71
|
+
},
|
|
72
|
+
"./mobx": {
|
|
73
|
+
"types": "./mobx/index.d.cts",
|
|
74
|
+
"import": "./mobx/index.js",
|
|
75
|
+
"require": "./mobx/index.cjs"
|
|
76
|
+
},
|
|
77
|
+
"./parser": {
|
|
78
|
+
"types": "./parser/index.d.cts",
|
|
79
|
+
"import": "./parser/index.js",
|
|
80
|
+
"require": "./parser/index.cjs"
|
|
81
|
+
},
|
|
82
|
+
"./react": {
|
|
83
|
+
"types": "./react/index.d.cts",
|
|
84
|
+
"import": "./react/index.js",
|
|
85
|
+
"require": "./react/index.cjs"
|
|
86
|
+
},
|
|
87
|
+
"./type-guard": {
|
|
88
|
+
"types": "./type-guard/index.d.cts",
|
|
89
|
+
"import": "./type-guard/index.js",
|
|
90
|
+
"require": "./type-guard/index.cjs"
|
|
91
|
+
},
|
|
92
|
+
"./utils/types": {
|
|
93
|
+
"types": "./utils/types.d.cts",
|
|
94
|
+
"import": "./utils/types.js",
|
|
95
|
+
"require": "./utils/types.cjs"
|
|
96
|
+
},
|
|
97
|
+
"./async": {
|
|
98
|
+
"types": "./async.d.cts",
|
|
99
|
+
"import": "./async.js",
|
|
100
|
+
"require": "./async.cjs"
|
|
101
|
+
},
|
|
102
|
+
"./common": {
|
|
103
|
+
"types": "./common.d.cts",
|
|
104
|
+
"import": "./common.js",
|
|
105
|
+
"require": "./common.cjs"
|
|
106
|
+
},
|
|
107
|
+
"./cookie": {
|
|
108
|
+
"types": "./cookie.d.cts",
|
|
109
|
+
"import": "./cookie.js",
|
|
110
|
+
"require": "./cookie.cjs"
|
|
111
|
+
},
|
|
112
|
+
"./css": {
|
|
113
|
+
"types": "./css.d.cts",
|
|
114
|
+
"import": "./css.js",
|
|
115
|
+
"require": "./css.cjs"
|
|
116
|
+
},
|
|
117
|
+
"./data": {
|
|
118
|
+
"types": "./data.d.cts",
|
|
119
|
+
"import": "./data.js",
|
|
120
|
+
"require": "./data.cjs"
|
|
121
|
+
},
|
|
122
|
+
"./date-time": {
|
|
123
|
+
"types": "./date-time.d.cts",
|
|
124
|
+
"import": "./date-time.js",
|
|
125
|
+
"require": "./date-time.cjs"
|
|
126
|
+
},
|
|
127
|
+
"./device": {
|
|
128
|
+
"types": "./device.d.cts",
|
|
129
|
+
"import": "./device.js",
|
|
130
|
+
"require": "./device.cjs"
|
|
131
|
+
},
|
|
132
|
+
"./encodings": {
|
|
133
|
+
"types": "./encodings.d.cts",
|
|
134
|
+
"import": "./encodings.js",
|
|
135
|
+
"require": "./encodings.cjs"
|
|
136
|
+
},
|
|
137
|
+
"./errors": {
|
|
138
|
+
"types": "./errors.d.cts",
|
|
139
|
+
"import": "./errors.js",
|
|
140
|
+
"require": "./errors.cjs"
|
|
141
|
+
},
|
|
142
|
+
"./file": {
|
|
143
|
+
"types": "./file.d.cts",
|
|
144
|
+
"import": "./file.js",
|
|
145
|
+
"require": "./file.cjs"
|
|
146
|
+
},
|
|
147
|
+
"./html": {
|
|
148
|
+
"types": "./html.d.cts",
|
|
149
|
+
"import": "./html.js",
|
|
150
|
+
"require": "./html.cjs"
|
|
151
|
+
},
|
|
152
|
+
"./id": {
|
|
153
|
+
"types": "./id.d.cts",
|
|
154
|
+
"import": "./id.js",
|
|
155
|
+
"require": "./id.cjs"
|
|
156
|
+
},
|
|
157
|
+
"./imports": {
|
|
158
|
+
"types": "./imports.d.cts",
|
|
159
|
+
"import": "./imports.js",
|
|
160
|
+
"require": "./imports.cjs"
|
|
161
|
+
},
|
|
162
|
+
"./math": {
|
|
163
|
+
"types": "./math.d.cts",
|
|
164
|
+
"import": "./math.js",
|
|
165
|
+
"require": "./math.cjs"
|
|
166
|
+
},
|
|
167
|
+
"./media": {
|
|
168
|
+
"types": "./media.d.cts",
|
|
169
|
+
"import": "./media.js",
|
|
170
|
+
"require": "./media.cjs"
|
|
171
|
+
},
|
|
172
|
+
"./ms": {
|
|
173
|
+
"types": "./ms.d.cts",
|
|
174
|
+
"import": "./ms.js",
|
|
175
|
+
"require": "./ms.cjs"
|
|
176
|
+
},
|
|
177
|
+
"./number": {
|
|
178
|
+
"types": "./number.d.cts",
|
|
179
|
+
"import": "./number.js",
|
|
180
|
+
"require": "./number.cjs"
|
|
181
|
+
},
|
|
182
|
+
"./price": {
|
|
183
|
+
"types": "./price.d.cts",
|
|
184
|
+
"import": "./price.js",
|
|
185
|
+
"require": "./price.cjs"
|
|
186
|
+
},
|
|
187
|
+
"./random": {
|
|
188
|
+
"types": "./random.d.cts",
|
|
189
|
+
"import": "./random.js",
|
|
190
|
+
"require": "./random.cjs"
|
|
191
|
+
},
|
|
192
|
+
"./sound": {
|
|
193
|
+
"types": "./sound.d.cts",
|
|
194
|
+
"import": "./sound.js",
|
|
195
|
+
"require": "./sound.cjs"
|
|
196
|
+
},
|
|
197
|
+
"./storage": {
|
|
198
|
+
"types": "./storage.d.cts",
|
|
199
|
+
"import": "./storage.js",
|
|
200
|
+
"require": "./storage.cjs"
|
|
201
|
+
},
|
|
202
|
+
"./text": {
|
|
203
|
+
"types": "./text.d.cts",
|
|
204
|
+
"import": "./text.js",
|
|
205
|
+
"require": "./text.cjs"
|
|
206
|
+
},
|
|
207
|
+
"./vibrate": {
|
|
208
|
+
"types": "./vibrate.d.cts",
|
|
209
|
+
"import": "./vibrate.js",
|
|
210
|
+
"require": "./vibrate.cjs"
|
|
211
|
+
},
|
|
212
|
+
"./utility-types": "./utility-types.d.ts"
|
|
213
|
+
},
|
|
56
214
|
"scripts": {
|
|
57
215
|
"clean": "rm -rf dist",
|
|
58
216
|
"lint:check": "pnpm exec biome check --write --no-errors-on-unmatched --files-ignore-unknown=true",
|
|
@@ -60,8 +218,8 @@
|
|
|
60
218
|
"check": "npm run lint:check && npm run ts:check",
|
|
61
219
|
"prebuild": "npm run clean && npm run check",
|
|
62
220
|
"build:watch": "pnpm build && nodemon --watch src --ext ts --exec \"pnpm build\"",
|
|
63
|
-
"build": "
|
|
64
|
-
"pub": "pnpm build &&
|
|
221
|
+
"build": "zshy && sborshik fill-dist && tsx scripts/generate-utility-types-file",
|
|
222
|
+
"pub": "pnpm build && sborshik publish --openDistDir",
|
|
65
223
|
"pub:patch": "PUBLISH_VERSION=patch pnpm pub",
|
|
66
224
|
"pub:minor": "PUBLISH_VERSION=minor pnpm pub",
|
|
67
225
|
"pub:major": "PUBLISH_VERSION=major pnpm pub",
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./number.cjs"), exports);
|
|
18
|
+
__exportStar(require("./percent.cjs"), exports);
|
|
19
|
+
__exportStar(require("./string.cjs"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_exports.d.ts","sourceRoot":"","sources":["../../src/parser/_exports.ts"],"names":[],"mappings":"AAAA,6BAA4B;AAC5B,8BAA6B;AAC7B,6BAA4B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_exports.d.ts","sourceRoot":"","sources":["../../src/parser/_exports.ts"],"names":[],"mappings":"AAAA,4BAA4B;AAC5B,6BAA6B;AAC7B,4BAA4B"}
|
package/parser/index.cjs
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.parser = void 0;
|
|
37
|
+
// This way is more treeshakable than collecting
|
|
38
|
+
// it into one exportable object export const parser
|
|
39
|
+
const parser = __importStar(require("./_exports.cjs"));
|
|
40
|
+
exports.parser = parser;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/parser/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,uBAAsB;AAExC,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/parser/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,sBAAsB;AAExC,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.number = void 0;
|
|
4
|
+
const skip_spaces_js_1 = require("../format/skip-spaces.cjs");
|
|
5
|
+
const index_js_1 = require("../type-guard/index.cjs");
|
|
6
|
+
const number = (input, userSettings) => {
|
|
7
|
+
const settings = {
|
|
8
|
+
...exports.number.defaultSettings,
|
|
9
|
+
...userSettings,
|
|
10
|
+
};
|
|
11
|
+
const fallback = settings?.fallback ?? 0;
|
|
12
|
+
let result;
|
|
13
|
+
if (index_js_1.typeGuard.isNumber(input)) {
|
|
14
|
+
result = input;
|
|
15
|
+
}
|
|
16
|
+
else if (index_js_1.typeGuard.isString(input)) {
|
|
17
|
+
const formattedInput = (0, skip_spaces_js_1.skipSpaces)(input).replace(',', '.');
|
|
18
|
+
if (formattedInput === '') {
|
|
19
|
+
result = fallback;
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
result = Number(formattedInput);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
result = fallback;
|
|
27
|
+
}
|
|
28
|
+
if (index_js_1.typeGuard.isNumber(result)) {
|
|
29
|
+
if (settings?.clamped != null) {
|
|
30
|
+
result = Math.max(settings.clamped[0] ?? -Infinity, Math.min(result, settings.clamped[1] ?? Infinity));
|
|
31
|
+
}
|
|
32
|
+
if (settings?.ceil != null) {
|
|
33
|
+
result = Math.ceil(result);
|
|
34
|
+
}
|
|
35
|
+
if (settings?.floor != null) {
|
|
36
|
+
result = Math.floor(result);
|
|
37
|
+
}
|
|
38
|
+
if (settings?.digits != null) {
|
|
39
|
+
result = +result.toFixed(settings.digits);
|
|
40
|
+
}
|
|
41
|
+
return result;
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
return fallback;
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
exports.number = number;
|
|
48
|
+
exports.number.defaultSettings = {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Maybe } from "../utils/types.cjs";
|
|
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,2BAA0B;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"}
|