yummies 5.4.5 → 5.4.6
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/.changeset/README.md +8 -0
- package/.changeset/config.json +11 -0
- package/.github/FUNDING.yml +1 -0
- package/.github/workflows/main.yml +34 -0
- package/.github/workflows/version-or-publish.yml +45 -0
- package/.nvmrc +1 -0
- package/.vscode/settings.json +19 -0
- package/CHANGELOG.md +215 -0
- package/CONTRIBUTING.md +8 -0
- package/Makefile +7 -0
- package/assets/logo.png +0 -0
- package/assets/logo.pxz +0 -0
- package/biome.json +3 -0
- package/commitfmt.toml +18 -0
- package/lefthook.yml +14 -0
- package/package.json +3 -389
- package/scripts/post-build.ts +71 -0
- package/src/async.ts +86 -0
- package/src/common.ts +26 -0
- package/src/complex/counter.test.ts +41 -0
- package/src/complex/counter.ts +40 -0
- package/src/complex/global-config.ts +55 -0
- package/src/complex/index.ts +3 -0
- package/src/complex/modules-factory.ts +65 -0
- package/src/cookie.ts +11 -0
- package/src/css.ts +60 -0
- package/src/data.test.ts +99 -0
- package/src/data.ts +65 -0
- package/src/date-time.test.ts +119 -0
- package/src/date-time.ts +236 -0
- package/src/device.ts +42 -0
- package/src/encodings.ts +270 -0
- package/src/errors.ts +40 -0
- package/src/file.ts +25 -0
- package/src/format/_exports.ts +4 -0
- package/{dist/format/constants.js → src/format/constants.ts} +2 -0
- package/{dist/format/index.js → src/format/index.ts} +2 -1
- package/src/format/number.test.ts +16 -0
- package/src/format/number.ts +96 -0
- package/src/format/percent.ts +40 -0
- package/src/format/skip-spaces.ts +4 -0
- package/src/html.ts +238 -0
- package/{dist/id.js → src/id.ts} +16 -6
- package/src/imports.ts +52 -0
- package/src/math.ts +20 -0
- package/src/media.ts +134 -0
- package/src/mobx/apply-observable.ts +20 -0
- package/src/mobx/create-enhanced-atom.ts +28 -0
- package/src/mobx/deep-observable-struct.test.ts +69 -0
- package/src/mobx/deep-observable-struct.ts +69 -0
- package/src/mobx/get-mobx-administration.ts +10 -0
- package/src/mobx/index.ts +5 -0
- package/src/mobx/lazy-observe.ts +59 -0
- package/src/ms.ts +20 -0
- package/src/number.ts +14 -0
- package/src/parser/_exports.ts +3 -0
- package/{dist/parser/index.js → src/parser/index.ts} +2 -1
- package/src/parser/number.test.ts +38 -0
- package/src/parser/number.ts +73 -0
- package/src/parser/percent.ts +11 -0
- package/src/parser/string.ts +29 -0
- package/src/price.ts +33 -0
- package/src/random.ts +27 -0
- package/src/react/hooks/index.ts +21 -0
- package/src/react/hooks/use-abort-controller.ts +15 -0
- package/src/react/hooks/use-abort-signal.ts +5 -0
- package/src/react/hooks/use-click-outside.ts +27 -0
- package/{dist/react/hooks/use-constant.js → src/react/hooks/use-constant.ts} +9 -6
- package/{dist/react/hooks/use-define-ref.js → src/react/hooks/use-define-ref.ts} +10 -7
- package/src/react/hooks/use-element-ref.ts +11 -0
- package/src/react/hooks/use-event-listener.ts +29 -0
- package/src/react/hooks/use-event.ts +23 -0
- package/src/react/hooks/use-flag.ts +27 -0
- package/src/react/hooks/use-force-update.ts +9 -0
- package/src/react/hooks/use-initial-height.ts +16 -0
- package/{dist/react/hooks/use-instance.js → src/react/hooks/use-instance.ts} +31 -9
- package/src/react/hooks/use-intersection-observer.ts +18 -0
- package/src/react/hooks/use-last-defined-value.ts +9 -0
- package/src/react/hooks/use-last-value-ref.ts +11 -0
- package/src/react/hooks/use-life-cycle.ts +17 -0
- package/src/react/hooks/use-resize-observer.ts +14 -0
- package/src/react/hooks/use-sync-ref.ts +7 -0
- package/src/react/hooks/use-toggle.ts +9 -0
- package/src/react/hooks/use-value.ts +10 -0
- package/src/react/hooks/use-visibility-state.ts +19 -0
- package/src/react/index.ts +1 -0
- package/src/sound.ts +15 -0
- package/src/storage.ts +137 -0
- package/src/text.test.ts +91 -0
- package/src/text.ts +60 -0
- package/src/type-guard/_exports.ts +154 -0
- package/src/type-guard/index.test.ts +127 -0
- package/{dist/type-guard/index.js → src/type-guard/index.ts} +2 -1
- package/src/vibrate.ts +8 -0
- package/tsconfig.json +26 -0
- package/tsconfig.test.json +33 -0
- package/vitest.config.ts +20 -0
- package/dist/async.cjs +0 -70
- package/dist/async.d.cts +0 -28
- package/dist/async.d.cts.map +0 -1
- package/dist/async.d.ts +0 -28
- package/dist/async.d.ts.map +0 -1
- package/dist/async.js +0 -62
- package/dist/common.cjs +0 -18
- package/dist/common.d.cts +0 -15
- package/dist/common.d.cts.map +0 -1
- package/dist/common.d.ts +0 -15
- package/dist/common.d.ts.map +0 -1
- package/dist/common.js +0 -14
- package/dist/complex/counter.cjs +0 -21
- package/dist/complex/counter.d.cts +0 -15
- package/dist/complex/counter.d.cts.map +0 -1
- package/dist/complex/counter.d.ts +0 -15
- package/dist/complex/counter.d.ts.map +0 -1
- package/dist/complex/counter.js +0 -17
- package/dist/complex/global-config.cjs +0 -46
- package/dist/complex/global-config.d.cts +0 -11
- package/dist/complex/global-config.d.cts.map +0 -1
- package/dist/complex/global-config.d.ts +0 -11
- package/dist/complex/global-config.d.ts.map +0 -1
- package/dist/complex/global-config.js +0 -41
- package/dist/complex/index.cjs +0 -19
- package/dist/complex/index.d.cts +0 -4
- package/dist/complex/index.d.cts.map +0 -1
- package/dist/complex/index.d.ts +0 -4
- package/dist/complex/index.d.ts.map +0 -1
- package/dist/complex/index.js +0 -3
- package/dist/complex/modules-factory.cjs +0 -50
- package/dist/complex/modules-factory.d.cts +0 -49
- package/dist/complex/modules-factory.d.cts.map +0 -1
- package/dist/complex/modules-factory.d.ts +0 -49
- package/dist/complex/modules-factory.d.ts.map +0 -1
- package/dist/complex/modules-factory.js +0 -46
- package/dist/cookie.cjs +0 -13
- package/dist/cookie.d.cts +0 -3
- package/dist/cookie.d.cts.map +0 -1
- package/dist/cookie.d.ts +0 -3
- package/dist/cookie.d.ts.map +0 -1
- package/dist/cookie.js +0 -9
- package/dist/css.cjs +0 -28
- package/dist/css.d.cts +0 -36
- package/dist/css.d.cts.map +0 -1
- package/dist/css.d.ts +0 -36
- package/dist/css.d.ts.map +0 -1
- package/dist/css.js +0 -20
- package/dist/data.cjs +0 -58
- package/dist/data.d.cts +0 -4
- package/dist/data.d.cts.map +0 -1
- package/dist/data.d.ts +0 -4
- package/dist/data.d.ts.map +0 -1
- package/dist/data.js +0 -52
- package/dist/date-time.cjs +0 -171
- package/dist/date-time.d.cts +0 -28
- package/dist/date-time.d.cts.map +0 -1
- package/dist/date-time.d.ts +0 -28
- package/dist/date-time.d.ts.map +0 -1
- package/dist/date-time.js +0 -160
- package/dist/device.cjs +0 -28
- package/dist/device.d.cts +0 -8
- package/dist/device.d.cts.map +0 -1
- package/dist/device.d.ts +0 -8
- package/dist/device.d.ts.map +0 -1
- package/dist/device.js +0 -21
- package/dist/encodings.cjs +0 -270
- package/dist/encodings.d.cts +0 -2
- package/dist/encodings.d.cts.map +0 -1
- package/dist/encodings.d.ts +0 -2
- package/dist/encodings.d.ts.map +0 -1
- package/dist/encodings.js +0 -267
- package/dist/errors.cjs +0 -34
- package/dist/errors.d.cts +0 -19
- package/dist/errors.d.cts.map +0 -1
- package/dist/errors.d.ts +0 -19
- package/dist/errors.d.ts.map +0 -1
- package/dist/errors.js +0 -30
- package/dist/file.cjs +0 -29
- package/dist/file.d.cts +0 -3
- package/dist/file.d.cts.map +0 -1
- package/dist/file.d.ts +0 -3
- package/dist/file.d.ts.map +0 -1
- package/dist/file.js +0 -24
- package/dist/format/_exports.cjs +0 -20
- package/dist/format/_exports.d.cts +0 -5
- package/dist/format/_exports.d.cts.map +0 -1
- package/dist/format/_exports.d.ts +0 -5
- package/dist/format/_exports.d.ts.map +0 -1
- package/dist/format/_exports.js +0 -4
- package/dist/format/constants.cjs +0 -6
- package/dist/format/constants.d.cts +0 -4
- package/dist/format/constants.d.cts.map +0 -1
- package/dist/format/constants.d.ts +0 -4
- package/dist/format/constants.d.ts.map +0 -1
- package/dist/format/index.cjs +0 -40
- package/dist/format/index.d.cts +0 -3
- package/dist/format/index.d.cts.map +0 -1
- package/dist/format/index.d.ts +0 -3
- package/dist/format/index.d.ts.map +0 -1
- package/dist/format/number.cjs +0 -48
- package/dist/format/number.d.cts +0 -36
- package/dist/format/number.d.cts.map +0 -1
- package/dist/format/number.d.ts +0 -36
- package/dist/format/number.d.ts.map +0 -1
- package/dist/format/number.js +0 -44
- package/dist/format/percent.cjs +0 -27
- package/dist/format/percent.d.cts +0 -15
- package/dist/format/percent.d.cts.map +0 -1
- package/dist/format/percent.d.ts +0 -15
- package/dist/format/percent.d.ts.map +0 -1
- package/dist/format/percent.js +0 -23
- package/dist/format/skip-spaces.cjs +0 -8
- package/dist/format/skip-spaces.d.cts +0 -5
- package/dist/format/skip-spaces.d.cts.map +0 -1
- package/dist/format/skip-spaces.d.ts +0 -5
- package/dist/format/skip-spaces.d.ts.map +0 -1
- package/dist/format/skip-spaces.js +0 -4
- package/dist/html.cjs +0 -202
- package/dist/html.d.cts +0 -44
- package/dist/html.d.cts.map +0 -1
- package/dist/html.d.ts +0 -44
- package/dist/html.d.ts.map +0 -1
- package/dist/html.js +0 -182
- package/dist/id.cjs +0 -76
- package/dist/id.d.cts +0 -63
- package/dist/id.d.cts.map +0 -1
- package/dist/id.d.ts +0 -63
- package/dist/id.d.ts.map +0 -1
- package/dist/imports.cjs +0 -45
- package/dist/imports.d.cts +0 -15
- package/dist/imports.d.cts.map +0 -1
- package/dist/imports.d.ts +0 -15
- package/dist/imports.d.ts.map +0 -1
- package/dist/imports.js +0 -40
- package/dist/math.cjs +0 -23
- package/dist/math.d.cts +0 -13
- package/dist/math.d.cts.map +0 -1
- package/dist/math.d.ts +0 -13
- package/dist/math.d.ts.map +0 -1
- package/dist/math.js +0 -17
- package/dist/media.cjs +0 -115
- package/dist/media.d.cts +0 -20
- package/dist/media.d.cts.map +0 -1
- package/dist/media.d.ts +0 -20
- package/dist/media.d.ts.map +0 -1
- package/dist/media.js +0 -103
- package/dist/mobx/apply-observable.cjs +0 -16
- package/dist/mobx/apply-observable.d.cts +0 -4
- package/dist/mobx/apply-observable.d.cts.map +0 -1
- package/dist/mobx/apply-observable.d.ts +0 -4
- package/dist/mobx/apply-observable.d.ts.map +0 -1
- package/dist/mobx/apply-observable.js +0 -12
- package/dist/mobx/create-enhanced-atom.cjs +0 -16
- package/dist/mobx/create-enhanced-atom.d.cts +0 -11
- package/dist/mobx/create-enhanced-atom.d.cts.map +0 -1
- package/dist/mobx/create-enhanced-atom.d.ts +0 -11
- package/dist/mobx/create-enhanced-atom.d.ts.map +0 -1
- package/dist/mobx/create-enhanced-atom.js +0 -12
- package/dist/mobx/deep-observable-struct.cjs +0 -61
- package/dist/mobx/deep-observable-struct.d.cts +0 -7
- package/dist/mobx/deep-observable-struct.d.cts.map +0 -1
- package/dist/mobx/deep-observable-struct.d.ts +0 -7
- package/dist/mobx/deep-observable-struct.d.ts.map +0 -1
- package/dist/mobx/deep-observable-struct.js +0 -57
- package/dist/mobx/get-mobx-administration.cjs +0 -6
- package/dist/mobx/get-mobx-administration.d.cts +0 -6
- package/dist/mobx/get-mobx-administration.d.cts.map +0 -1
- package/dist/mobx/get-mobx-administration.d.ts +0 -6
- package/dist/mobx/get-mobx-administration.d.ts.map +0 -1
- package/dist/mobx/get-mobx-administration.js +0 -2
- package/dist/mobx/index.cjs +0 -21
- package/dist/mobx/index.d.cts +0 -6
- package/dist/mobx/index.d.cts.map +0 -1
- package/dist/mobx/index.d.ts +0 -6
- package/dist/mobx/index.d.ts.map +0 -1
- package/dist/mobx/index.js +0 -5
- package/dist/mobx/lazy-observe.cjs +0 -47
- package/dist/mobx/lazy-observe.d.cts +0 -8
- package/dist/mobx/lazy-observe.d.cts.map +0 -1
- package/dist/mobx/lazy-observe.d.ts +0 -8
- package/dist/mobx/lazy-observe.d.ts.map +0 -1
- package/dist/mobx/lazy-observe.js +0 -43
- package/dist/ms.cjs +0 -22
- package/dist/ms.d.cts +0 -19
- package/dist/ms.d.cts.map +0 -1
- package/dist/ms.d.ts +0 -19
- package/dist/ms.d.ts.map +0 -1
- package/dist/ms.js +0 -18
- package/dist/number.cjs +0 -16
- package/dist/number.d.cts +0 -8
- package/dist/number.d.cts.map +0 -1
- package/dist/number.d.ts +0 -8
- package/dist/number.d.ts.map +0 -1
- package/dist/number.js +0 -13
- package/dist/parser/_exports.cjs +0 -19
- package/dist/parser/_exports.d.cts +0 -4
- package/dist/parser/_exports.d.cts.map +0 -1
- package/dist/parser/_exports.d.ts +0 -4
- package/dist/parser/_exports.d.ts.map +0 -1
- package/dist/parser/_exports.js +0 -3
- package/dist/parser/index.cjs +0 -40
- package/dist/parser/index.d.cts +0 -3
- package/dist/parser/index.d.cts.map +0 -1
- package/dist/parser/index.d.ts +0 -3
- package/dist/parser/index.d.ts.map +0 -1
- package/dist/parser/number.cjs +0 -48
- package/dist/parser/number.d.cts +0 -21
- package/dist/parser/number.d.cts.map +0 -1
- package/dist/parser/number.d.ts +0 -21
- package/dist/parser/number.d.ts.map +0 -1
- package/dist/parser/number.js +0 -44
- package/dist/parser/percent.cjs +0 -8
- package/dist/parser/percent.d.cts +0 -4
- package/dist/parser/percent.d.cts.map +0 -1
- package/dist/parser/percent.d.ts +0 -4
- package/dist/parser/percent.d.ts.map +0 -1
- package/dist/parser/percent.js +0 -4
- package/dist/parser/string.cjs +0 -18
- package/dist/parser/string.d.cts +0 -7
- package/dist/parser/string.d.cts.map +0 -1
- package/dist/parser/string.d.ts +0 -7
- package/dist/parser/string.d.ts.map +0 -1
- package/dist/parser/string.js +0 -14
- package/dist/price.cjs +0 -21
- package/dist/price.d.cts +0 -6
- package/dist/price.d.cts.map +0 -1
- package/dist/price.d.ts +0 -6
- package/dist/price.d.ts.map +0 -1
- package/dist/price.js +0 -17
- package/dist/random.cjs +0 -25
- package/dist/random.d.cts +0 -9
- package/dist/random.d.cts.map +0 -1
- package/dist/random.d.ts +0 -9
- package/dist/random.d.ts.map +0 -1
- package/dist/random.js +0 -14
- package/dist/react/hooks/index.cjs +0 -37
- package/dist/react/hooks/index.d.cts +0 -22
- package/dist/react/hooks/index.d.cts.map +0 -1
- package/dist/react/hooks/index.d.ts +0 -22
- package/dist/react/hooks/index.d.ts.map +0 -1
- package/dist/react/hooks/index.js +0 -21
- package/dist/react/hooks/use-abort-controller.cjs +0 -15
- package/dist/react/hooks/use-abort-controller.d.cts +0 -2
- package/dist/react/hooks/use-abort-controller.d.cts.map +0 -1
- package/dist/react/hooks/use-abort-controller.d.ts +0 -2
- package/dist/react/hooks/use-abort-controller.d.ts.map +0 -1
- package/dist/react/hooks/use-abort-controller.js +0 -11
- package/dist/react/hooks/use-abort-signal.cjs +0 -8
- package/dist/react/hooks/use-abort-signal.d.cts +0 -2
- package/dist/react/hooks/use-abort-signal.d.cts.map +0 -1
- package/dist/react/hooks/use-abort-signal.d.ts +0 -2
- package/dist/react/hooks/use-abort-signal.d.ts.map +0 -1
- package/dist/react/hooks/use-abort-signal.js +0 -4
- package/dist/react/hooks/use-click-outside.cjs +0 -17
- package/dist/react/hooks/use-click-outside.d.cts +0 -9
- package/dist/react/hooks/use-click-outside.d.cts.map +0 -1
- package/dist/react/hooks/use-click-outside.d.ts +0 -9
- package/dist/react/hooks/use-click-outside.d.ts.map +0 -1
- package/dist/react/hooks/use-click-outside.js +0 -13
- package/dist/react/hooks/use-constant.cjs +0 -19
- package/dist/react/hooks/use-constant.d.cts +0 -9
- package/dist/react/hooks/use-constant.d.cts.map +0 -1
- package/dist/react/hooks/use-constant.d.ts +0 -9
- package/dist/react/hooks/use-constant.d.ts.map +0 -1
- package/dist/react/hooks/use-define-ref.cjs +0 -19
- package/dist/react/hooks/use-define-ref.d.cts +0 -10
- package/dist/react/hooks/use-define-ref.d.cts.map +0 -1
- package/dist/react/hooks/use-define-ref.d.ts +0 -10
- package/dist/react/hooks/use-define-ref.d.ts.map +0 -1
- package/dist/react/hooks/use-element-ref.cjs +0 -12
- package/dist/react/hooks/use-element-ref.d.cts +0 -2
- package/dist/react/hooks/use-element-ref.d.cts.map +0 -1
- package/dist/react/hooks/use-element-ref.d.ts +0 -2
- package/dist/react/hooks/use-element-ref.d.ts.map +0 -1
- package/dist/react/hooks/use-element-ref.js +0 -8
- package/dist/react/hooks/use-event-listener.cjs +0 -17
- package/dist/react/hooks/use-event-listener.d.cts +0 -8
- package/dist/react/hooks/use-event-listener.d.cts.map +0 -1
- package/dist/react/hooks/use-event-listener.d.ts +0 -8
- package/dist/react/hooks/use-event-listener.d.ts.map +0 -1
- package/dist/react/hooks/use-event-listener.js +0 -13
- package/dist/react/hooks/use-event.cjs +0 -23
- package/dist/react/hooks/use-event.d.cts +0 -3
- package/dist/react/hooks/use-event.d.cts.map +0 -1
- package/dist/react/hooks/use-event.d.ts +0 -3
- package/dist/react/hooks/use-event.d.ts.map +0 -1
- package/dist/react/hooks/use-event.js +0 -19
- package/dist/react/hooks/use-flag.cjs +0 -19
- package/dist/react/hooks/use-flag.d.cts +0 -8
- package/dist/react/hooks/use-flag.d.cts.map +0 -1
- package/dist/react/hooks/use-flag.d.ts +0 -8
- package/dist/react/hooks/use-flag.d.ts.map +0 -1
- package/dist/react/hooks/use-flag.js +0 -15
- package/dist/react/hooks/use-force-update.cjs +0 -11
- package/dist/react/hooks/use-force-update.d.cts +0 -2
- package/dist/react/hooks/use-force-update.d.cts.map +0 -1
- package/dist/react/hooks/use-force-update.d.ts +0 -2
- package/dist/react/hooks/use-force-update.d.ts.map +0 -1
- package/dist/react/hooks/use-force-update.js +0 -7
- package/dist/react/hooks/use-initial-height.cjs +0 -15
- package/dist/react/hooks/use-initial-height.d.cts +0 -5
- package/dist/react/hooks/use-initial-height.d.cts.map +0 -1
- package/dist/react/hooks/use-initial-height.d.ts +0 -5
- package/dist/react/hooks/use-initial-height.d.ts.map +0 -1
- package/dist/react/hooks/use-initial-height.js +0 -11
- package/dist/react/hooks/use-instance.cjs +0 -31
- package/dist/react/hooks/use-instance.d.cts +0 -27
- package/dist/react/hooks/use-instance.d.cts.map +0 -1
- package/dist/react/hooks/use-instance.d.ts +0 -27
- package/dist/react/hooks/use-instance.d.ts.map +0 -1
- package/dist/react/hooks/use-intersection-observer.cjs +0 -14
- package/dist/react/hooks/use-intersection-observer.d.cts +0 -2
- package/dist/react/hooks/use-intersection-observer.d.cts.map +0 -1
- package/dist/react/hooks/use-intersection-observer.d.ts +0 -2
- package/dist/react/hooks/use-intersection-observer.d.ts.map +0 -1
- package/dist/react/hooks/use-intersection-observer.js +0 -10
- package/dist/react/hooks/use-last-defined-value.cjs +0 -12
- package/dist/react/hooks/use-last-defined-value.d.cts +0 -2
- package/dist/react/hooks/use-last-defined-value.d.cts.map +0 -1
- package/dist/react/hooks/use-last-defined-value.d.ts +0 -2
- package/dist/react/hooks/use-last-defined-value.d.ts.map +0 -1
- package/dist/react/hooks/use-last-defined-value.js +0 -8
- package/dist/react/hooks/use-last-value-ref.cjs +0 -12
- package/dist/react/hooks/use-last-value-ref.d.cts +0 -2
- package/dist/react/hooks/use-last-value-ref.d.cts.map +0 -1
- package/dist/react/hooks/use-last-value-ref.d.ts +0 -2
- package/dist/react/hooks/use-last-value-ref.d.ts.map +0 -1
- package/dist/react/hooks/use-last-value-ref.js +0 -8
- package/dist/react/hooks/use-life-cycle.cjs +0 -14
- package/dist/react/hooks/use-life-cycle.d.cts +0 -5
- package/dist/react/hooks/use-life-cycle.d.cts.map +0 -1
- package/dist/react/hooks/use-life-cycle.d.ts +0 -5
- package/dist/react/hooks/use-life-cycle.d.ts.map +0 -1
- package/dist/react/hooks/use-life-cycle.js +0 -10
- package/dist/react/hooks/use-resize-observer.cjs +0 -15
- package/dist/react/hooks/use-resize-observer.d.cts +0 -2
- package/dist/react/hooks/use-resize-observer.d.cts.map +0 -1
- package/dist/react/hooks/use-resize-observer.d.ts +0 -2
- package/dist/react/hooks/use-resize-observer.d.ts.map +0 -1
- package/dist/react/hooks/use-resize-observer.js +0 -11
- package/dist/react/hooks/use-sync-ref.cjs +0 -10
- package/dist/react/hooks/use-sync-ref.d.cts +0 -2
- package/dist/react/hooks/use-sync-ref.d.cts.map +0 -1
- package/dist/react/hooks/use-sync-ref.d.ts +0 -2
- package/dist/react/hooks/use-sync-ref.d.ts.map +0 -1
- package/dist/react/hooks/use-sync-ref.js +0 -6
- package/dist/react/hooks/use-toggle.cjs +0 -10
- package/dist/react/hooks/use-toggle.d.cts +0 -2
- package/dist/react/hooks/use-toggle.d.cts.map +0 -1
- package/dist/react/hooks/use-toggle.d.ts +0 -2
- package/dist/react/hooks/use-toggle.d.ts.map +0 -1
- package/dist/react/hooks/use-toggle.js +0 -6
- package/dist/react/hooks/use-value.cjs +0 -12
- package/dist/react/hooks/use-value.d.cts +0 -5
- package/dist/react/hooks/use-value.d.cts.map +0 -1
- package/dist/react/hooks/use-value.d.ts +0 -5
- package/dist/react/hooks/use-value.d.ts.map +0 -1
- package/dist/react/hooks/use-value.js +0 -8
- package/dist/react/hooks/use-visibility-state.cjs +0 -18
- package/dist/react/hooks/use-visibility-state.d.cts +0 -2
- package/dist/react/hooks/use-visibility-state.d.cts.map +0 -1
- package/dist/react/hooks/use-visibility-state.d.ts +0 -2
- package/dist/react/hooks/use-visibility-state.d.ts.map +0 -1
- package/dist/react/hooks/use-visibility-state.js +0 -14
- package/dist/react/index.cjs +0 -17
- package/dist/react/index.d.cts +0 -2
- package/dist/react/index.d.cts.map +0 -1
- package/dist/react/index.d.ts +0 -2
- package/dist/react/index.d.ts.map +0 -1
- package/dist/react/index.js +0 -1
- package/dist/sound.cjs +0 -16
- package/dist/sound.d.cts +0 -7
- package/dist/sound.d.cts.map +0 -1
- package/dist/sound.d.ts +0 -7
- package/dist/sound.d.ts.map +0 -1
- package/dist/sound.js +0 -12
- package/dist/storage.cjs +0 -48
- package/dist/storage.d.cts +0 -39
- package/dist/storage.d.cts.map +0 -1
- package/dist/storage.d.ts +0 -39
- package/dist/storage.d.ts.map +0 -1
- package/dist/storage.js +0 -43
- package/dist/text.cjs +0 -53
- package/dist/text.d.cts +0 -15
- package/dist/text.d.cts.map +0 -1
- package/dist/text.d.ts +0 -15
- package/dist/text.d.ts.map +0 -1
- package/dist/text.js +0 -48
- package/dist/type-guard/_exports.cjs +0 -129
- package/dist/type-guard/_exports.d.cts +0 -86
- package/dist/type-guard/_exports.d.cts.map +0 -1
- package/dist/type-guard/_exports.d.ts +0 -86
- package/dist/type-guard/_exports.d.ts.map +0 -1
- package/dist/type-guard/_exports.js +0 -125
- package/dist/type-guard/index.cjs +0 -40
- package/dist/type-guard/index.d.cts +0 -3
- package/dist/type-guard/index.d.cts.map +0 -1
- package/dist/type-guard/index.d.ts +0 -3
- package/dist/type-guard/index.d.ts.map +0 -1
- package/dist/utils/types.cjs +0 -2
- package/dist/utils/types.d.cts +0 -395
- package/dist/utils/types.d.cts.map +0 -1
- package/dist/utils/types.d.ts +0 -395
- package/dist/utils/types.d.ts.map +0 -1
- package/dist/utils/types.js +0 -1
- package/dist/vibrate.cjs +0 -12
- package/dist/vibrate.d.cts +0 -5
- package/dist/vibrate.d.cts.map +0 -1
- package/dist/vibrate.d.ts +0 -5
- package/dist/vibrate.d.ts.map +0 -1
- package/dist/vibrate.js +0 -8
- package/utility-types.d.ts +0 -395
- package/utils/types.cjs +0 -2
- package/utils/types.d.cts +0 -395
- package/utils/types.d.cts.map +0 -1
- package/utils/types.d.ts +0 -395
- package/utils/types.d.ts.map +0 -1
- package/utils/types.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"global-config.d.ts","sourceRoot":"","sources":["../../src/complex/global-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,0BAA0B;AAyB1D;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAAI,CAAC,SAAS,SAAS,EACpD,cAAc,CAAC,EACf,eAAe,MAAM,GAAG,MAIzB,CAAC;AAEF,eAAO,MAAM,yBAAyB,GAAI,CAAC,SAAS,SAAS,EAC3D,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,EAC9D,eAAe,MAAM,GAAG;;;oBAWN,OAAO,CAAC,CAAC,CAAC;CAK7B,CAAC"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
const createGlobalPoint = (accessSymbol) => {
|
|
2
|
-
if (accessSymbol == null) {
|
|
3
|
-
let storedValue;
|
|
4
|
-
return {
|
|
5
|
-
get: () => storedValue,
|
|
6
|
-
set: (value) => {
|
|
7
|
-
storedValue = value;
|
|
8
|
-
return value;
|
|
9
|
-
},
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
const _globalThis = globalThis;
|
|
13
|
-
return {
|
|
14
|
-
get: () => _globalThis[accessSymbol],
|
|
15
|
-
set: (value) => {
|
|
16
|
-
_globalThis[accessSymbol] = value;
|
|
17
|
-
return value;
|
|
18
|
-
},
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* Создает глобальный конфиг, который может быть доступен в любой точке в коде
|
|
23
|
-
*/
|
|
24
|
-
export const createGlobalConfig = (defaultValue, accessSymbol) => {
|
|
25
|
-
const globalPoint = createGlobalPoint(accessSymbol);
|
|
26
|
-
return globalPoint.get() || globalPoint.set(defaultValue);
|
|
27
|
-
};
|
|
28
|
-
export const createGlobalDynamicConfig = (processFn, accessSymbol) => {
|
|
29
|
-
const globalPoint = createGlobalPoint(accessSymbol);
|
|
30
|
-
const getValue = () => {
|
|
31
|
-
return globalPoint.get() ?? globalPoint.set(processFn(null, null));
|
|
32
|
-
};
|
|
33
|
-
return {
|
|
34
|
-
get: getValue,
|
|
35
|
-
set: globalPoint.set,
|
|
36
|
-
update: (value) => {
|
|
37
|
-
const currentValue = getValue();
|
|
38
|
-
Object.assign(currentValue, processFn(value, currentValue));
|
|
39
|
-
},
|
|
40
|
-
};
|
|
41
|
-
};
|
package/dist/complex/index.cjs
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
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("./counter.cjs"), exports);
|
|
18
|
-
__exportStar(require("./global-config.cjs"), exports);
|
|
19
|
-
__exportStar(require("./modules-factory.cjs"), exports);
|
package/dist/complex/index.d.cts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/complex/index.ts"],"names":[],"mappings":"AAAA,8BAA6B;AAC7B,oCAAmC;AACnC,sCAAqC"}
|
package/dist/complex/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/complex/index.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,mCAAmC;AACnC,qCAAqC"}
|
package/dist/complex/index.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ModulesFactory = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Класс `ModulesFactory` является универсальной фабрикой для создания экземпляров указанного класса с зависимостями.
|
|
6
|
-
* Он использует объект конфигурации для определения того, как эти экземпляры создаются.
|
|
7
|
-
*
|
|
8
|
-
* Важное примечание - эта сущность работает только с классами конструктор которых имеет один параметр
|
|
9
|
-
*
|
|
10
|
-
* @template TPredefinedDeps - Тип, расширяющий `AnyObject`, представляющий предопределенные зависимости, которые использует фабрика.
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* ```
|
|
14
|
-
* const factory = new ModulesFactory({
|
|
15
|
-
* factory: (MyClass, deps) => new MyClass(deps),
|
|
16
|
-
* deps: { someDependency: new Dependency() }
|
|
17
|
-
* });
|
|
18
|
-
*
|
|
19
|
-
* const instance = factory.create(MyClass, { extraDependency: new ExtraDependency() });
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
class ModulesFactory {
|
|
23
|
-
config;
|
|
24
|
-
/**
|
|
25
|
-
* Создает новый экземпляр `ModulesFactory`.
|
|
26
|
-
*
|
|
27
|
-
* @param config - Объект конфигурации для фабрики, включающий функцию фабрики и необязательные зависимости.
|
|
28
|
-
*/
|
|
29
|
-
constructor(config) {
|
|
30
|
-
this.config = config;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Создает экземпляр указанного класса, внедряя необходимые зависимости.
|
|
34
|
-
*
|
|
35
|
-
* @template TInstance - Тип создаваемого экземпляра.
|
|
36
|
-
* @template TDeps - Тип зависимостей, необходимых для экземпляра.
|
|
37
|
-
*
|
|
38
|
-
* @param Constructor - Конструктор класса для создаваемого экземпляра.
|
|
39
|
-
* @param args - Необязательные дополнительные зависимости для объединения с предопределенными зависимостями.
|
|
40
|
-
*
|
|
41
|
-
* @returns Экземпляр указанного класса с внедренными зависимостями.
|
|
42
|
-
*/
|
|
43
|
-
create(Constructor, ...args) {
|
|
44
|
-
return this.config.factory(Constructor, {
|
|
45
|
-
...this.config.deps,
|
|
46
|
-
...args[0],
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
exports.ModulesFactory = ModulesFactory;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import type { AnyObject, Class, EmptyObject, IsPartial } from "../utils/types.cjs";
|
|
2
|
-
type ModuleLoaderConfig<TPredefinedDeps extends AnyObject = EmptyObject> = {
|
|
3
|
-
factory<TInstance, TDeps extends TPredefinedDeps>(moduleClass: Class<TInstance, [TDeps]>, deps: TDeps): TInstance;
|
|
4
|
-
} & (TPredefinedDeps extends EmptyObject ? {
|
|
5
|
-
deps?: TPredefinedDeps;
|
|
6
|
-
} : {
|
|
7
|
-
deps: TPredefinedDeps;
|
|
8
|
-
});
|
|
9
|
-
/**
|
|
10
|
-
* Класс `ModulesFactory` является универсальной фабрикой для создания экземпляров указанного класса с зависимостями.
|
|
11
|
-
* Он использует объект конфигурации для определения того, как эти экземпляры создаются.
|
|
12
|
-
*
|
|
13
|
-
* Важное примечание - эта сущность работает только с классами конструктор которых имеет один параметр
|
|
14
|
-
*
|
|
15
|
-
* @template TPredefinedDeps - Тип, расширяющий `AnyObject`, представляющий предопределенные зависимости, которые использует фабрика.
|
|
16
|
-
*
|
|
17
|
-
* @example
|
|
18
|
-
* ```
|
|
19
|
-
* const factory = new ModulesFactory({
|
|
20
|
-
* factory: (MyClass, deps) => new MyClass(deps),
|
|
21
|
-
* deps: { someDependency: new Dependency() }
|
|
22
|
-
* });
|
|
23
|
-
*
|
|
24
|
-
* const instance = factory.create(MyClass, { extraDependency: new ExtraDependency() });
|
|
25
|
-
* ```
|
|
26
|
-
*/
|
|
27
|
-
export declare class ModulesFactory<TPredefinedDeps extends AnyObject = EmptyObject> {
|
|
28
|
-
private config;
|
|
29
|
-
/**
|
|
30
|
-
* Создает новый экземпляр `ModulesFactory`.
|
|
31
|
-
*
|
|
32
|
-
* @param config - Объект конфигурации для фабрики, включающий функцию фабрики и необязательные зависимости.
|
|
33
|
-
*/
|
|
34
|
-
constructor(config: ModuleLoaderConfig<TPredefinedDeps>);
|
|
35
|
-
/**
|
|
36
|
-
* Создает экземпляр указанного класса, внедряя необходимые зависимости.
|
|
37
|
-
*
|
|
38
|
-
* @template TInstance - Тип создаваемого экземпляра.
|
|
39
|
-
* @template TDeps - Тип зависимостей, необходимых для экземпляра.
|
|
40
|
-
*
|
|
41
|
-
* @param Constructor - Конструктор класса для создаваемого экземпляра.
|
|
42
|
-
* @param args - Необязательные дополнительные зависимости для объединения с предопределенными зависимостями.
|
|
43
|
-
*
|
|
44
|
-
* @returns Экземпляр указанного класса с внедренными зависимостями.
|
|
45
|
-
*/
|
|
46
|
-
create<TInstance, TDeps extends TPredefinedDeps = TPredefinedDeps>(Constructor: Class<TInstance, [TDeps]>, ...args: IsPartial<Omit<TDeps, keyof TPredefinedDeps>> extends true ? [extraDeps?: Omit<TDeps, keyof TPredefinedDeps>] : [extraDeps: Omit<TDeps, keyof TPredefinedDeps>]): TInstance;
|
|
47
|
-
}
|
|
48
|
-
export {};
|
|
49
|
-
//# sourceMappingURL=modules-factory.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"modules-factory.d.ts","sourceRoot":"","sources":["../../src/complex/modules-factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,KAAK,EACL,WAAW,EACX,SAAS,EACV,2BAA0B;AAE3B,KAAK,kBAAkB,CAAC,eAAe,SAAS,SAAS,GAAG,WAAW,IAAI;IACzE,OAAO,CAAC,SAAS,EAAE,KAAK,SAAS,eAAe,EAC9C,WAAW,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,CAAC,EACtC,IAAI,EAAE,KAAK,GACV,SAAS,CAAC;CACd,GAAG,CAAC,eAAe,SAAS,WAAW,GACpC;IAAE,IAAI,CAAC,EAAE,eAAe,CAAA;CAAE,GAC1B;IAAE,IAAI,EAAE,eAAe,CAAA;CAAE,CAAC,CAAC;AAE/B;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,cAAc,CAAC,eAAe,SAAS,SAAS,GAAG,WAAW;IAM7D,OAAO,CAAC,MAAM;IAL1B;;;;OAIG;gBACiB,MAAM,EAAE,kBAAkB,CAAC,eAAe,CAAC;IAE/D;;;;;;;;;;OAUG;IACH,MAAM,CAAC,SAAS,EAAE,KAAK,SAAS,eAAe,GAAG,eAAe,EAC/D,WAAW,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,CAAC,EACtC,GAAG,IAAI,EAAE,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,eAAe,CAAC,CAAC,SAAS,IAAI,GAC/D,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,eAAe,CAAC,CAAC,GAChD,CAAC,SAAS,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,eAAe,CAAC,CAAC;CAOtD"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import type { AnyObject, Class, EmptyObject, IsPartial } from "../utils/types.js";
|
|
2
|
-
type ModuleLoaderConfig<TPredefinedDeps extends AnyObject = EmptyObject> = {
|
|
3
|
-
factory<TInstance, TDeps extends TPredefinedDeps>(moduleClass: Class<TInstance, [TDeps]>, deps: TDeps): TInstance;
|
|
4
|
-
} & (TPredefinedDeps extends EmptyObject ? {
|
|
5
|
-
deps?: TPredefinedDeps;
|
|
6
|
-
} : {
|
|
7
|
-
deps: TPredefinedDeps;
|
|
8
|
-
});
|
|
9
|
-
/**
|
|
10
|
-
* Класс `ModulesFactory` является универсальной фабрикой для создания экземпляров указанного класса с зависимостями.
|
|
11
|
-
* Он использует объект конфигурации для определения того, как эти экземпляры создаются.
|
|
12
|
-
*
|
|
13
|
-
* Важное примечание - эта сущность работает только с классами конструктор которых имеет один параметр
|
|
14
|
-
*
|
|
15
|
-
* @template TPredefinedDeps - Тип, расширяющий `AnyObject`, представляющий предопределенные зависимости, которые использует фабрика.
|
|
16
|
-
*
|
|
17
|
-
* @example
|
|
18
|
-
* ```
|
|
19
|
-
* const factory = new ModulesFactory({
|
|
20
|
-
* factory: (MyClass, deps) => new MyClass(deps),
|
|
21
|
-
* deps: { someDependency: new Dependency() }
|
|
22
|
-
* });
|
|
23
|
-
*
|
|
24
|
-
* const instance = factory.create(MyClass, { extraDependency: new ExtraDependency() });
|
|
25
|
-
* ```
|
|
26
|
-
*/
|
|
27
|
-
export declare class ModulesFactory<TPredefinedDeps extends AnyObject = EmptyObject> {
|
|
28
|
-
private config;
|
|
29
|
-
/**
|
|
30
|
-
* Создает новый экземпляр `ModulesFactory`.
|
|
31
|
-
*
|
|
32
|
-
* @param config - Объект конфигурации для фабрики, включающий функцию фабрики и необязательные зависимости.
|
|
33
|
-
*/
|
|
34
|
-
constructor(config: ModuleLoaderConfig<TPredefinedDeps>);
|
|
35
|
-
/**
|
|
36
|
-
* Создает экземпляр указанного класса, внедряя необходимые зависимости.
|
|
37
|
-
*
|
|
38
|
-
* @template TInstance - Тип создаваемого экземпляра.
|
|
39
|
-
* @template TDeps - Тип зависимостей, необходимых для экземпляра.
|
|
40
|
-
*
|
|
41
|
-
* @param Constructor - Конструктор класса для создаваемого экземпляра.
|
|
42
|
-
* @param args - Необязательные дополнительные зависимости для объединения с предопределенными зависимостями.
|
|
43
|
-
*
|
|
44
|
-
* @returns Экземпляр указанного класса с внедренными зависимостями.
|
|
45
|
-
*/
|
|
46
|
-
create<TInstance, TDeps extends TPredefinedDeps = TPredefinedDeps>(Constructor: Class<TInstance, [TDeps]>, ...args: IsPartial<Omit<TDeps, keyof TPredefinedDeps>> extends true ? [extraDeps?: Omit<TDeps, keyof TPredefinedDeps>] : [extraDeps: Omit<TDeps, keyof TPredefinedDeps>]): TInstance;
|
|
47
|
-
}
|
|
48
|
-
export {};
|
|
49
|
-
//# sourceMappingURL=modules-factory.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"modules-factory.d.ts","sourceRoot":"","sources":["../../src/complex/modules-factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,KAAK,EACL,WAAW,EACX,SAAS,EACV,0BAA0B;AAE3B,KAAK,kBAAkB,CAAC,eAAe,SAAS,SAAS,GAAG,WAAW,IAAI;IACzE,OAAO,CAAC,SAAS,EAAE,KAAK,SAAS,eAAe,EAC9C,WAAW,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,CAAC,EACtC,IAAI,EAAE,KAAK,GACV,SAAS,CAAC;CACd,GAAG,CAAC,eAAe,SAAS,WAAW,GACpC;IAAE,IAAI,CAAC,EAAE,eAAe,CAAA;CAAE,GAC1B;IAAE,IAAI,EAAE,eAAe,CAAA;CAAE,CAAC,CAAC;AAE/B;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,cAAc,CAAC,eAAe,SAAS,SAAS,GAAG,WAAW;IAM7D,OAAO,CAAC,MAAM;IAL1B;;;;OAIG;gBACiB,MAAM,EAAE,kBAAkB,CAAC,eAAe,CAAC;IAE/D;;;;;;;;;;OAUG;IACH,MAAM,CAAC,SAAS,EAAE,KAAK,SAAS,eAAe,GAAG,eAAe,EAC/D,WAAW,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,CAAC,EACtC,GAAG,IAAI,EAAE,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,eAAe,CAAC,CAAC,SAAS,IAAI,GAC/D,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,eAAe,CAAC,CAAC,GAChD,CAAC,SAAS,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,eAAe,CAAC,CAAC;CAOtD"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Класс `ModulesFactory` является универсальной фабрикой для создания экземпляров указанного класса с зависимостями.
|
|
3
|
-
* Он использует объект конфигурации для определения того, как эти экземпляры создаются.
|
|
4
|
-
*
|
|
5
|
-
* Важное примечание - эта сущность работает только с классами конструктор которых имеет один параметр
|
|
6
|
-
*
|
|
7
|
-
* @template TPredefinedDeps - Тип, расширяющий `AnyObject`, представляющий предопределенные зависимости, которые использует фабрика.
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* ```
|
|
11
|
-
* const factory = new ModulesFactory({
|
|
12
|
-
* factory: (MyClass, deps) => new MyClass(deps),
|
|
13
|
-
* deps: { someDependency: new Dependency() }
|
|
14
|
-
* });
|
|
15
|
-
*
|
|
16
|
-
* const instance = factory.create(MyClass, { extraDependency: new ExtraDependency() });
|
|
17
|
-
* ```
|
|
18
|
-
*/
|
|
19
|
-
export class ModulesFactory {
|
|
20
|
-
config;
|
|
21
|
-
/**
|
|
22
|
-
* Создает новый экземпляр `ModulesFactory`.
|
|
23
|
-
*
|
|
24
|
-
* @param config - Объект конфигурации для фабрики, включающий функцию фабрики и необязательные зависимости.
|
|
25
|
-
*/
|
|
26
|
-
constructor(config) {
|
|
27
|
-
this.config = config;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Создает экземпляр указанного класса, внедряя необходимые зависимости.
|
|
31
|
-
*
|
|
32
|
-
* @template TInstance - Тип создаваемого экземпляра.
|
|
33
|
-
* @template TDeps - Тип зависимостей, необходимых для экземпляра.
|
|
34
|
-
*
|
|
35
|
-
* @param Constructor - Конструктор класса для создаваемого экземпляра.
|
|
36
|
-
* @param args - Необязательные дополнительные зависимости для объединения с предопределенными зависимостями.
|
|
37
|
-
*
|
|
38
|
-
* @returns Экземпляр указанного класса с внедренными зависимостями.
|
|
39
|
-
*/
|
|
40
|
-
create(Constructor, ...args) {
|
|
41
|
-
return this.config.factory(Constructor, {
|
|
42
|
-
...this.config.deps,
|
|
43
|
-
...args[0],
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
}
|
package/dist/cookie.cjs
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.parseCookie = void 0;
|
|
4
|
-
const parseCookie = (cookiesString = document.cookie) => {
|
|
5
|
-
return cookiesString
|
|
6
|
-
.split(';')
|
|
7
|
-
.map((cookieString) => cookieString.trim().split('='))
|
|
8
|
-
.reduce((acc, current) => {
|
|
9
|
-
acc[current[0]] = current[1];
|
|
10
|
-
return acc;
|
|
11
|
-
}, {});
|
|
12
|
-
};
|
|
13
|
-
exports.parseCookie = parseCookie;
|
package/dist/cookie.d.cts
DELETED
package/dist/cookie.d.cts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cookie.d.ts","sourceRoot":"","sources":["../src/cookie.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,0BAAyB;AAElD,eAAO,MAAM,WAAW,GAAI,sBAA+B,cAQ1D,CAAC"}
|
package/dist/cookie.d.ts
DELETED
package/dist/cookie.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cookie.d.ts","sourceRoot":"","sources":["../src/cookie.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,yBAAyB;AAElD,eAAO,MAAM,WAAW,GAAI,sBAA+B,cAQ1D,CAAC"}
|
package/dist/cookie.js
DELETED
package/dist/css.cjs
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.cva = exports.cx = exports.toRem = void 0;
|
|
7
|
-
const class_variance_authority_1 = require("class-variance-authority");
|
|
8
|
-
const clsx_1 = __importDefault(require("clsx"));
|
|
9
|
-
const tailwind_merge_1 = require("tailwind-merge");
|
|
10
|
-
/**
|
|
11
|
-
* Перевод значения в пикселях в rem строковое
|
|
12
|
-
*/
|
|
13
|
-
const toRem = (px, remValue = 16) => `${px / remValue}rem`;
|
|
14
|
-
exports.toRem = toRem;
|
|
15
|
-
/**
|
|
16
|
-
* classNames/clsx но с примесями tailwind-merge
|
|
17
|
-
*/
|
|
18
|
-
const cx = (...args) => (0, tailwind_merge_1.twMerge)((0, clsx_1.default)(...args));
|
|
19
|
-
exports.cx = cx;
|
|
20
|
-
/**
|
|
21
|
-
* Class Variance Authority но с примесями tailwind-merge
|
|
22
|
-
*
|
|
23
|
-
* https://cva.style/docs
|
|
24
|
-
*/
|
|
25
|
-
exports.cva = ((...args) => {
|
|
26
|
-
const schema = (0, class_variance_authority_1.cva)(...args);
|
|
27
|
-
return (...inputArgs) => (0, tailwind_merge_1.twMerge)(schema(...inputArgs));
|
|
28
|
-
});
|
package/dist/css.d.cts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import clsx, { type ClassValue } from 'clsx';
|
|
2
|
-
type ClassProp = {
|
|
3
|
-
class?: ClassValue;
|
|
4
|
-
className?: ClassValue;
|
|
5
|
-
};
|
|
6
|
-
type StringToBoolean<T> = T extends 'true' | 'false' ? boolean : T;
|
|
7
|
-
/**
|
|
8
|
-
* Перевод значения в пикселях в rem строковое
|
|
9
|
-
*/
|
|
10
|
-
export declare const toRem: (px: number, remValue?: number) => string;
|
|
11
|
-
/**
|
|
12
|
-
* classNames/clsx но с примесями tailwind-merge
|
|
13
|
-
*/
|
|
14
|
-
export declare const cx: (...args: Parameters<typeof clsx>) => string;
|
|
15
|
-
type ConfigSchema = Record<string, Record<string, ClassValue>>;
|
|
16
|
-
type ConfigVariants<T extends ConfigSchema> = {
|
|
17
|
-
[Variant in keyof T]?: StringToBoolean<keyof T[Variant]> | null | undefined;
|
|
18
|
-
};
|
|
19
|
-
type ConfigVariantsMulti<T extends ConfigSchema> = {
|
|
20
|
-
[Variant in keyof T]?: StringToBoolean<keyof T[Variant]> | StringToBoolean<keyof T[Variant]>[] | undefined;
|
|
21
|
-
};
|
|
22
|
-
type Config<T> = T extends ConfigSchema ? {
|
|
23
|
-
variants?: T;
|
|
24
|
-
defaultVariants?: ConfigVariants<T>;
|
|
25
|
-
compoundVariants?: (T extends ConfigSchema ? (ConfigVariants<T> | ConfigVariantsMulti<T>) & ClassProp : ClassProp)[];
|
|
26
|
-
} : never;
|
|
27
|
-
type Props<T> = T extends ConfigSchema ? ConfigVariants<T> & ClassProp : ClassProp;
|
|
28
|
-
/**
|
|
29
|
-
* Class Variance Authority но с примесями tailwind-merge
|
|
30
|
-
*
|
|
31
|
-
* https://cva.style/docs
|
|
32
|
-
*/
|
|
33
|
-
export declare const cva: <T>(base?: ClassValue, config?: Config<T>) => (props?: Props<T>) => string;
|
|
34
|
-
export type { VariantProps } from 'class-variance-authority';
|
|
35
|
-
export type { ClassValue } from 'clsx';
|
|
36
|
-
//# sourceMappingURL=css.d.ts.map
|
package/dist/css.d.cts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"css.d.ts","sourceRoot":"","sources":["../src/css.ts"],"names":[],"mappings":"AACA,OAAO,IAAI,EAAE,EAAE,KAAK,UAAU,EAAE,MAAM,MAAM,CAAC;AAG7C,KAAK,SAAS,GAAG;IACf,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,SAAS,CAAC,EAAE,UAAU,CAAC;CACxB,CAAC;AAEF,KAAK,eAAe,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,CAAC,CAAC;AAEnE;;GAEG;AACH,eAAO,MAAM,KAAK,GAAI,IAAI,MAAM,EAAE,iBAAa,WAA0B,CAAC;AAE1E;;GAEG;AACH,eAAO,MAAM,EAAE,GAAI,GAAG,MAAM,UAAU,CAAC,OAAO,IAAI,CAAC,WAA2B,CAAC;AAE/E,KAAK,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC;AAC/D,KAAK,cAAc,CAAC,CAAC,SAAS,YAAY,IAAI;KAC3C,OAAO,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,IAAI,GAAG,SAAS;CAC5E,CAAC;AACF,KAAK,mBAAmB,CAAC,CAAC,SAAS,YAAY,IAAI;KAChD,OAAO,IAAI,MAAM,CAAC,CAAC,CAAC,EACjB,eAAe,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,GACjC,eAAe,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,EAAE,GACnC,SAAS;CACd,CAAC;AACF,KAAK,MAAM,CAAC,CAAC,IAAI,CAAC,SAAS,YAAY,GACnC;IACE,QAAQ,CAAC,EAAE,CAAC,CAAC;IACb,eAAe,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC;IACpC,gBAAgB,CAAC,EAAE,CAAC,CAAC,SAAS,YAAY,GACtC,CAAC,cAAc,CAAC,CAAC,CAAC,GAAG,mBAAmB,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,GACxD,SAAS,CAAC,EAAE,CAAC;CAClB,GACD,KAAK,CAAC;AAEV,KAAK,KAAK,CAAC,CAAC,IAAI,CAAC,SAAS,YAAY,GAClC,cAAc,CAAC,CAAC,CAAC,GAAG,SAAS,GAC7B,SAAS,CAAC;AAEd;;;;GAIG;AACH,eAAO,MAAM,GAAG,EAGH,CAAC,CAAC,EACb,IAAI,CAAC,EAAE,UAAU,EACjB,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,KACf,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC;AAElC,YAAY,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,YAAY,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC"}
|
package/dist/css.d.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import clsx, { type ClassValue } from 'clsx';
|
|
2
|
-
type ClassProp = {
|
|
3
|
-
class?: ClassValue;
|
|
4
|
-
className?: ClassValue;
|
|
5
|
-
};
|
|
6
|
-
type StringToBoolean<T> = T extends 'true' | 'false' ? boolean : T;
|
|
7
|
-
/**
|
|
8
|
-
* Перевод значения в пикселях в rem строковое
|
|
9
|
-
*/
|
|
10
|
-
export declare const toRem: (px: number, remValue?: number) => string;
|
|
11
|
-
/**
|
|
12
|
-
* classNames/clsx но с примесями tailwind-merge
|
|
13
|
-
*/
|
|
14
|
-
export declare const cx: (...args: Parameters<typeof clsx>) => string;
|
|
15
|
-
type ConfigSchema = Record<string, Record<string, ClassValue>>;
|
|
16
|
-
type ConfigVariants<T extends ConfigSchema> = {
|
|
17
|
-
[Variant in keyof T]?: StringToBoolean<keyof T[Variant]> | null | undefined;
|
|
18
|
-
};
|
|
19
|
-
type ConfigVariantsMulti<T extends ConfigSchema> = {
|
|
20
|
-
[Variant in keyof T]?: StringToBoolean<keyof T[Variant]> | StringToBoolean<keyof T[Variant]>[] | undefined;
|
|
21
|
-
};
|
|
22
|
-
type Config<T> = T extends ConfigSchema ? {
|
|
23
|
-
variants?: T;
|
|
24
|
-
defaultVariants?: ConfigVariants<T>;
|
|
25
|
-
compoundVariants?: (T extends ConfigSchema ? (ConfigVariants<T> | ConfigVariantsMulti<T>) & ClassProp : ClassProp)[];
|
|
26
|
-
} : never;
|
|
27
|
-
type Props<T> = T extends ConfigSchema ? ConfigVariants<T> & ClassProp : ClassProp;
|
|
28
|
-
/**
|
|
29
|
-
* Class Variance Authority но с примесями tailwind-merge
|
|
30
|
-
*
|
|
31
|
-
* https://cva.style/docs
|
|
32
|
-
*/
|
|
33
|
-
export declare const cva: <T>(base?: ClassValue, config?: Config<T>) => (props?: Props<T>) => string;
|
|
34
|
-
export type { VariantProps } from 'class-variance-authority';
|
|
35
|
-
export type { ClassValue } from 'clsx';
|
|
36
|
-
//# sourceMappingURL=css.d.ts.map
|
package/dist/css.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"css.d.ts","sourceRoot":"","sources":["../src/css.ts"],"names":[],"mappings":"AACA,OAAO,IAAI,EAAE,EAAE,KAAK,UAAU,EAAE,MAAM,MAAM,CAAC;AAG7C,KAAK,SAAS,GAAG;IACf,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,SAAS,CAAC,EAAE,UAAU,CAAC;CACxB,CAAC;AAEF,KAAK,eAAe,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,CAAC,CAAC;AAEnE;;GAEG;AACH,eAAO,MAAM,KAAK,GAAI,IAAI,MAAM,EAAE,iBAAa,WAA0B,CAAC;AAE1E;;GAEG;AACH,eAAO,MAAM,EAAE,GAAI,GAAG,MAAM,UAAU,CAAC,OAAO,IAAI,CAAC,WAA2B,CAAC;AAE/E,KAAK,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC;AAC/D,KAAK,cAAc,CAAC,CAAC,SAAS,YAAY,IAAI;KAC3C,OAAO,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,IAAI,GAAG,SAAS;CAC5E,CAAC;AACF,KAAK,mBAAmB,CAAC,CAAC,SAAS,YAAY,IAAI;KAChD,OAAO,IAAI,MAAM,CAAC,CAAC,CAAC,EACjB,eAAe,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,GACjC,eAAe,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,EAAE,GACnC,SAAS;CACd,CAAC;AACF,KAAK,MAAM,CAAC,CAAC,IAAI,CAAC,SAAS,YAAY,GACnC;IACE,QAAQ,CAAC,EAAE,CAAC,CAAC;IACb,eAAe,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC;IACpC,gBAAgB,CAAC,EAAE,CAAC,CAAC,SAAS,YAAY,GACtC,CAAC,cAAc,CAAC,CAAC,CAAC,GAAG,mBAAmB,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,GACxD,SAAS,CAAC,EAAE,CAAC;CAClB,GACD,KAAK,CAAC;AAEV,KAAK,KAAK,CAAC,CAAC,IAAI,CAAC,SAAS,YAAY,GAClC,cAAc,CAAC,CAAC,CAAC,GAAG,SAAS,GAC7B,SAAS,CAAC;AAEd;;;;GAIG;AACH,eAAO,MAAM,GAAG,EAGH,CAAC,CAAC,EACb,IAAI,CAAC,EAAE,UAAU,EACjB,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,KACf,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC;AAElC,YAAY,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,YAAY,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC"}
|
package/dist/css.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { cva as cvaLib } from 'class-variance-authority';
|
|
2
|
-
import clsx from 'clsx';
|
|
3
|
-
import { twMerge } from 'tailwind-merge';
|
|
4
|
-
/**
|
|
5
|
-
* Перевод значения в пикселях в rem строковое
|
|
6
|
-
*/
|
|
7
|
-
export const toRem = (px, remValue = 16) => `${px / remValue}rem`;
|
|
8
|
-
/**
|
|
9
|
-
* classNames/clsx но с примесями tailwind-merge
|
|
10
|
-
*/
|
|
11
|
-
export const cx = (...args) => twMerge(clsx(...args));
|
|
12
|
-
/**
|
|
13
|
-
* Class Variance Authority но с примесями tailwind-merge
|
|
14
|
-
*
|
|
15
|
-
* https://cva.style/docs
|
|
16
|
-
*/
|
|
17
|
-
export const cva = ((...args) => {
|
|
18
|
-
const schema = cvaLib(...args);
|
|
19
|
-
return (...inputArgs) => twMerge(schema(...inputArgs));
|
|
20
|
-
});
|
package/dist/data.cjs
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.safeJsonParse = exports.flatMapDeep = exports.isShallowEqual = void 0;
|
|
4
|
-
const isShallowEqual = (a, b) => {
|
|
5
|
-
if (a === b)
|
|
6
|
-
return true;
|
|
7
|
-
if (typeof a !== 'object' ||
|
|
8
|
-
typeof b !== 'object' ||
|
|
9
|
-
a === null ||
|
|
10
|
-
b === null) {
|
|
11
|
-
return false;
|
|
12
|
-
}
|
|
13
|
-
if (a.constructor !== b.constructor)
|
|
14
|
-
return false;
|
|
15
|
-
const isArrayA = Array.isArray(a);
|
|
16
|
-
if (isArrayA !== Array.isArray(b))
|
|
17
|
-
return false;
|
|
18
|
-
if (isArrayA) {
|
|
19
|
-
const arrA = a;
|
|
20
|
-
const arrB = b;
|
|
21
|
-
if (arrA.length !== arrB.length)
|
|
22
|
-
return false;
|
|
23
|
-
for (const [i, element] of arrA.entries()) {
|
|
24
|
-
if (element !== arrB[i])
|
|
25
|
-
return false;
|
|
26
|
-
}
|
|
27
|
-
return true;
|
|
28
|
-
}
|
|
29
|
-
if (a instanceof Date)
|
|
30
|
-
return a.getTime() === b.getTime();
|
|
31
|
-
if (a instanceof RegExp)
|
|
32
|
-
return a.toString() === b.toString();
|
|
33
|
-
const aKeys = Object.keys(a);
|
|
34
|
-
const bKeys = Object.keys(b);
|
|
35
|
-
if (aKeys.length !== bKeys.length)
|
|
36
|
-
return false;
|
|
37
|
-
const bObj = b;
|
|
38
|
-
for (const key of aKeys) {
|
|
39
|
-
if (!Object.hasOwn(bObj, key) || a[key] !== bObj[key]) {
|
|
40
|
-
return false;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
return true;
|
|
44
|
-
};
|
|
45
|
-
exports.isShallowEqual = isShallowEqual;
|
|
46
|
-
const flatMapDeep = (arr, fn) => Array.isArray(arr)
|
|
47
|
-
? arr.flatMap((c) => (0, exports.flatMapDeep)(c, fn))
|
|
48
|
-
: [fn(arr, 0, [arr])];
|
|
49
|
-
exports.flatMapDeep = flatMapDeep;
|
|
50
|
-
const safeJsonParse = (json) => {
|
|
51
|
-
try {
|
|
52
|
-
return JSON.parse(json);
|
|
53
|
-
}
|
|
54
|
-
catch {
|
|
55
|
-
return null;
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
exports.safeJsonParse = safeJsonParse;
|
package/dist/data.d.cts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export declare const isShallowEqual: (a: unknown, b: unknown) => boolean;
|
|
2
|
-
export declare const flatMapDeep: <TSource, TNewValue>(arr: TSource | TSource[], fn: (value: TSource, i: number, arr: TSource[]) => TNewValue) => TNewValue[];
|
|
3
|
-
export declare const safeJsonParse: (json: string) => any;
|
|
4
|
-
//# sourceMappingURL=data.d.ts.map
|
package/dist/data.d.cts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../src/data.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,GAAI,GAAG,OAAO,EAAE,GAAG,OAAO,KAAG,OA8CvD,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,OAAO,EAAE,SAAS,EAC5C,KAAK,OAAO,GAAG,OAAO,EAAE,EACxB,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,SAAS,KAC3D,SAAS,EAGa,CAAC;AAE1B,eAAO,MAAM,aAAa,GAAI,MAAM,MAAM,QAMzC,CAAC"}
|
package/dist/data.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export declare const isShallowEqual: (a: unknown, b: unknown) => boolean;
|
|
2
|
-
export declare const flatMapDeep: <TSource, TNewValue>(arr: TSource | TSource[], fn: (value: TSource, i: number, arr: TSource[]) => TNewValue) => TNewValue[];
|
|
3
|
-
export declare const safeJsonParse: (json: string) => any;
|
|
4
|
-
//# sourceMappingURL=data.d.ts.map
|
package/dist/data.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../src/data.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,GAAI,GAAG,OAAO,EAAE,GAAG,OAAO,KAAG,OA8CvD,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,OAAO,EAAE,SAAS,EAC5C,KAAK,OAAO,GAAG,OAAO,EAAE,EACxB,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,SAAS,KAC3D,SAAS,EAGa,CAAC;AAE1B,eAAO,MAAM,aAAa,GAAI,MAAM,MAAM,QAMzC,CAAC"}
|
package/dist/data.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
export const isShallowEqual = (a, b) => {
|
|
2
|
-
if (a === b)
|
|
3
|
-
return true;
|
|
4
|
-
if (typeof a !== 'object' ||
|
|
5
|
-
typeof b !== 'object' ||
|
|
6
|
-
a === null ||
|
|
7
|
-
b === null) {
|
|
8
|
-
return false;
|
|
9
|
-
}
|
|
10
|
-
if (a.constructor !== b.constructor)
|
|
11
|
-
return false;
|
|
12
|
-
const isArrayA = Array.isArray(a);
|
|
13
|
-
if (isArrayA !== Array.isArray(b))
|
|
14
|
-
return false;
|
|
15
|
-
if (isArrayA) {
|
|
16
|
-
const arrA = a;
|
|
17
|
-
const arrB = b;
|
|
18
|
-
if (arrA.length !== arrB.length)
|
|
19
|
-
return false;
|
|
20
|
-
for (const [i, element] of arrA.entries()) {
|
|
21
|
-
if (element !== arrB[i])
|
|
22
|
-
return false;
|
|
23
|
-
}
|
|
24
|
-
return true;
|
|
25
|
-
}
|
|
26
|
-
if (a instanceof Date)
|
|
27
|
-
return a.getTime() === b.getTime();
|
|
28
|
-
if (a instanceof RegExp)
|
|
29
|
-
return a.toString() === b.toString();
|
|
30
|
-
const aKeys = Object.keys(a);
|
|
31
|
-
const bKeys = Object.keys(b);
|
|
32
|
-
if (aKeys.length !== bKeys.length)
|
|
33
|
-
return false;
|
|
34
|
-
const bObj = b;
|
|
35
|
-
for (const key of aKeys) {
|
|
36
|
-
if (!Object.hasOwn(bObj, key) || a[key] !== bObj[key]) {
|
|
37
|
-
return false;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
return true;
|
|
41
|
-
};
|
|
42
|
-
export const flatMapDeep = (arr, fn) => Array.isArray(arr)
|
|
43
|
-
? arr.flatMap((c) => flatMapDeep(c, fn))
|
|
44
|
-
: [fn(arr, 0, [arr])];
|
|
45
|
-
export const safeJsonParse = (json) => {
|
|
46
|
-
try {
|
|
47
|
-
return JSON.parse(json);
|
|
48
|
-
}
|
|
49
|
-
catch {
|
|
50
|
-
return null;
|
|
51
|
-
}
|
|
52
|
-
};
|