@stryke/helpers 0.9.26 → 0.9.28
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/CHANGELOG.md +16 -0
- package/dist/arg-identity.cjs +1 -1
- package/dist/arg-identity.d.cts +14 -2
- package/dist/arg-identity.d.cts.map +1 -0
- package/dist/arg-identity.d.mts +14 -2
- package/dist/arg-identity.d.mts.map +1 -0
- package/dist/arg-identity.mjs +2 -1
- package/dist/arg-identity.mjs.map +1 -0
- package/dist/convert/src/to-string-key.cjs +1 -0
- package/dist/convert/src/to-string-key.mjs +2 -0
- package/dist/convert/src/to-string-key.mjs.map +1 -0
- package/dist/debounce.cjs +1 -1
- package/dist/debounce.d.cts +47 -2
- package/dist/debounce.d.cts.map +1 -0
- package/dist/debounce.d.mts +47 -2
- package/dist/debounce.d.mts.map +1 -0
- package/dist/debounce.mjs +2 -1
- package/dist/debounce.mjs.map +1 -0
- package/dist/deep-clone.cjs +1 -1
- package/dist/deep-clone.d.cts +65 -2
- package/dist/deep-clone.d.cts.map +1 -0
- package/dist/deep-clone.d.mts +65 -2
- package/dist/deep-clone.d.mts.map +1 -0
- package/dist/deep-clone.mjs +2 -1
- package/dist/deep-clone.mjs.map +1 -0
- package/dist/deep-merge.cjs +1 -1
- package/dist/deep-merge.d.cts +26 -2
- package/dist/deep-merge.d.cts.map +1 -0
- package/dist/deep-merge.d.mts +26 -2
- package/dist/deep-merge.d.mts.map +1 -0
- package/dist/deep-merge.mjs +2 -1
- package/dist/deep-merge.mjs.map +1 -0
- package/dist/delay.cjs +1 -1
- package/dist/delay.d.cts +77 -2
- package/dist/delay.d.cts.map +1 -0
- package/dist/delay.d.mts +77 -2
- package/dist/delay.d.mts.map +1 -0
- package/dist/delay.mjs +2 -1
- package/dist/delay.mjs.map +1 -0
- package/dist/errors.cjs +1 -1
- package/dist/errors.mjs +2 -1
- package/dist/errors.mjs.map +1 -0
- package/dist/filter-empty.cjs +1 -1
- package/dist/filter-empty.d.cts +5 -2
- package/dist/filter-empty.d.cts.map +1 -0
- package/dist/filter-empty.d.mts +5 -2
- package/dist/filter-empty.d.mts.map +1 -0
- package/dist/filter-empty.mjs +2 -1
- package/dist/filter-empty.mjs.map +1 -0
- package/dist/flatten-object.cjs +1 -1
- package/dist/flatten-object.d.cts +35 -2
- package/dist/flatten-object.d.cts.map +1 -0
- package/dist/flatten-object.d.mts +35 -2
- package/dist/flatten-object.d.mts.map +1 -0
- package/dist/flatten-object.mjs +2 -1
- package/dist/flatten-object.mjs.map +1 -0
- package/dist/get-field.cjs +1 -1
- package/dist/get-field.d.cts +254 -2
- package/dist/get-field.d.cts.map +1 -0
- package/dist/get-field.d.mts +254 -2
- package/dist/get-field.d.mts.map +1 -0
- package/dist/get-field.mjs +2 -1
- package/dist/get-field.mjs.map +1 -0
- package/dist/get-ordered-by.cjs +1 -1
- package/dist/get-ordered-by.d.cts +39 -2
- package/dist/get-ordered-by.d.cts.map +1 -0
- package/dist/get-ordered-by.d.mts +39 -2
- package/dist/get-ordered-by.d.mts.map +1 -0
- package/dist/get-ordered-by.mjs +2 -1
- package/dist/get-ordered-by.mjs.map +1 -0
- package/dist/get-unique.cjs +1 -1
- package/dist/get-unique.d.cts +26 -2
- package/dist/get-unique.d.cts.map +1 -0
- package/dist/get-unique.d.mts +26 -2
- package/dist/get-unique.d.mts.map +1 -0
- package/dist/get-unique.mjs +2 -1
- package/dist/get-unique.mjs.map +1 -0
- package/dist/identity.cjs +1 -1
- package/dist/identity.d.cts +18 -2
- package/dist/identity.d.cts.map +1 -0
- package/dist/identity.d.mts +18 -2
- package/dist/identity.d.mts.map +1 -0
- package/dist/identity.mjs +2 -1
- package/dist/identity.mjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +31 -31
- package/dist/index.d.mts +31 -31
- package/dist/index.mjs +1 -1
- package/dist/is-equal.cjs +1 -1
- package/dist/is-equal.d.cts +22 -2
- package/dist/is-equal.d.cts.map +1 -0
- package/dist/is-equal.d.mts +22 -2
- package/dist/is-equal.d.mts.map +1 -0
- package/dist/is-equal.mjs +2 -1
- package/dist/is-equal.mjs.map +1 -0
- package/dist/lru-cache.cjs +1 -1
- package/dist/lru-cache.d.cts +103 -2
- package/dist/lru-cache.d.cts.map +1 -0
- package/dist/lru-cache.d.mts +103 -2
- package/dist/lru-cache.d.mts.map +1 -0
- package/dist/lru-cache.mjs +2 -1
- package/dist/lru-cache.mjs.map +1 -0
- package/dist/match-sorter.cjs +1 -1
- package/dist/match-sorter.d.cts +78 -2
- package/dist/match-sorter.d.cts.map +1 -0
- package/dist/match-sorter.d.mts +78 -2
- package/dist/match-sorter.d.mts.map +1 -0
- package/dist/match-sorter.mjs +2 -1
- package/dist/match-sorter.mjs.map +1 -0
- package/dist/memoize.cjs +1 -1
- package/dist/memoize.d.cts +11 -2
- package/dist/memoize.d.cts.map +1 -0
- package/dist/memoize.d.mts +11 -2
- package/dist/memoize.d.mts.map +1 -0
- package/dist/memoize.mjs +2 -1
- package/dist/memoize.mjs.map +1 -0
- package/dist/mutex.cjs +1 -1
- package/dist/mutex.d.cts +72 -2
- package/dist/mutex.d.cts.map +1 -0
- package/dist/mutex.d.mts +72 -2
- package/dist/mutex.d.mts.map +1 -0
- package/dist/mutex.mjs +2 -1
- package/dist/mutex.mjs.map +1 -0
- package/dist/noop.cjs +1 -1
- package/dist/noop.d.cts +22 -2
- package/dist/noop.d.cts.map +1 -0
- package/dist/noop.d.mts +22 -2
- package/dist/noop.d.mts.map +1 -0
- package/dist/noop.mjs +2 -1
- package/dist/noop.mjs.map +1 -0
- package/dist/omit.cjs +1 -1
- package/dist/omit.d.cts +22 -2
- package/dist/omit.d.cts.map +1 -0
- package/dist/omit.d.mts +22 -2
- package/dist/omit.d.mts.map +1 -0
- package/dist/omit.mjs +2 -1
- package/dist/omit.mjs.map +1 -0
- package/dist/once.cjs +1 -1
- package/dist/once.d.cts +13 -2
- package/dist/once.d.cts.map +1 -0
- package/dist/once.d.mts +13 -2
- package/dist/once.d.mts.map +1 -0
- package/dist/once.mjs +2 -1
- package/dist/once.mjs.map +1 -0
- package/dist/pick.cjs +1 -1
- package/dist/pick.d.cts +22 -2
- package/dist/pick.d.cts.map +1 -0
- package/dist/pick.d.mts +22 -2
- package/dist/pick.d.mts.map +1 -0
- package/dist/pick.mjs +2 -1
- package/dist/pick.mjs.map +1 -0
- package/dist/remove-accents.cjs +1 -1
- package/dist/remove-accents.d.cts +12 -2
- package/dist/remove-accents.d.cts.map +1 -0
- package/dist/remove-accents.d.mts +12 -2
- package/dist/remove-accents.d.mts.map +1 -0
- package/dist/remove-accents.mjs +2 -1
- package/dist/remove-accents.mjs.map +1 -0
- package/dist/remove-empty-items.cjs +1 -1
- package/dist/remove-empty-items.d.cts +11 -2
- package/dist/remove-empty-items.d.cts.map +1 -0
- package/dist/remove-empty-items.d.mts +11 -2
- package/dist/remove-empty-items.d.mts.map +1 -0
- package/dist/remove-empty-items.mjs +2 -1
- package/dist/remove-empty-items.mjs.map +1 -0
- package/dist/semaphore.cjs +1 -1
- package/dist/semaphore.d.cts +86 -2
- package/dist/semaphore.d.cts.map +1 -0
- package/dist/semaphore.d.mts +86 -2
- package/dist/semaphore.d.mts.map +1 -0
- package/dist/semaphore.mjs +2 -1
- package/dist/semaphore.mjs.map +1 -0
- package/dist/set-field.cjs +1 -1
- package/dist/set-field.d.cts +16 -2
- package/dist/set-field.d.cts.map +1 -0
- package/dist/set-field.d.mts +16 -2
- package/dist/set-field.d.mts.map +1 -0
- package/dist/set-field.mjs +2 -1
- package/dist/set-field.mjs.map +1 -0
- package/dist/throttle.cjs +1 -1
- package/dist/throttle.d.cts +32 -2
- package/dist/throttle.d.cts.map +1 -0
- package/dist/throttle.d.mts +32 -2
- package/dist/throttle.d.mts.map +1 -0
- package/dist/throttle.mjs +2 -1
- package/dist/throttle.mjs.map +1 -0
- package/dist/timeout.cjs +1 -1
- package/dist/timeout.d.cts +12 -2
- package/dist/timeout.d.cts.map +1 -0
- package/dist/timeout.d.mts +12 -2
- package/dist/timeout.d.mts.map +1 -0
- package/dist/timeout.mjs +2 -1
- package/dist/timeout.mjs.map +1 -0
- package/dist/to-deep-key.cjs +1 -1
- package/dist/to-deep-key.d.cts +42 -2
- package/dist/to-deep-key.d.cts.map +1 -0
- package/dist/to-deep-key.d.mts +42 -2
- package/dist/to-deep-key.d.mts.map +1 -0
- package/dist/to-deep-key.mjs +2 -1
- package/dist/to-deep-key.mjs.map +1 -0
- package/dist/to-path.cjs +1 -1
- package/dist/to-path.d.cts +24 -2
- package/dist/to-path.d.cts.map +1 -0
- package/dist/to-path.d.mts +24 -2
- package/dist/to-path.d.mts.map +1 -0
- package/dist/to-path.mjs +2 -1
- package/dist/to-path.mjs.map +1 -0
- package/dist/type-checks/src/get-object-tag.cjs +1 -0
- package/dist/type-checks/src/get-object-tag.mjs +2 -0
- package/dist/type-checks/src/get-object-tag.mjs.map +1 -0
- package/dist/type-checks/src/is-deep-key.cjs +1 -0
- package/dist/type-checks/src/is-deep-key.mjs +2 -0
- package/dist/type-checks/src/is-deep-key.mjs.map +1 -0
- package/dist/type-checks/src/is-empty.cjs +1 -0
- package/dist/type-checks/src/is-empty.mjs +2 -0
- package/dist/type-checks/src/is-empty.mjs.map +1 -0
- package/dist/type-checks/src/is-function.cjs +1 -0
- package/dist/type-checks/src/is-function.mjs +2 -0
- package/dist/type-checks/src/is-function.mjs.map +1 -0
- package/dist/type-checks/src/is-mergeable-object.cjs +1 -0
- package/dist/type-checks/src/is-mergeable-object.mjs +2 -0
- package/dist/type-checks/src/is-mergeable-object.mjs.map +1 -0
- package/dist/type-checks/src/is-non-null-object.cjs +1 -0
- package/dist/type-checks/src/is-non-null-object.mjs +2 -0
- package/dist/type-checks/src/is-non-null-object.mjs.map +1 -0
- package/dist/type-checks/src/is-null.cjs +1 -0
- package/dist/type-checks/src/is-null.mjs +2 -0
- package/dist/type-checks/src/is-null.mjs.map +1 -0
- package/dist/type-checks/src/is-number.cjs +1 -0
- package/dist/type-checks/src/is-number.mjs +2 -0
- package/dist/type-checks/src/is-number.mjs.map +1 -0
- package/dist/type-checks/src/is-object-index.cjs +1 -0
- package/dist/type-checks/src/is-object-index.mjs +2 -0
- package/dist/type-checks/src/is-object-index.mjs.map +1 -0
- package/dist/type-checks/src/is-object.cjs +1 -0
- package/dist/type-checks/src/is-object.mjs +2 -0
- package/dist/type-checks/src/is-object.mjs.map +1 -0
- package/dist/type-checks/src/is-plain-object.cjs +1 -0
- package/dist/type-checks/src/is-plain-object.mjs +2 -0
- package/dist/type-checks/src/is-plain-object.mjs.map +1 -0
- package/dist/type-checks/src/is-primitive.cjs +1 -0
- package/dist/type-checks/src/is-primitive.mjs +2 -0
- package/dist/type-checks/src/is-primitive.mjs.map +1 -0
- package/dist/type-checks/src/is-react-element.cjs +1 -0
- package/dist/type-checks/src/is-react-element.mjs +2 -0
- package/dist/type-checks/src/is-react-element.mjs.map +1 -0
- package/dist/type-checks/src/is-set-string.cjs +1 -0
- package/dist/type-checks/src/is-set-string.mjs +2 -0
- package/dist/type-checks/src/is-set-string.mjs.map +1 -0
- package/dist/type-checks/src/is-set.cjs +1 -0
- package/dist/type-checks/src/is-set.mjs +2 -0
- package/dist/type-checks/src/is-set.mjs.map +1 -0
- package/dist/{is-string-CvmuuuDj.mjs → type-checks/src/is-string.cjs} +1 -2
- package/dist/type-checks/src/is-string.mjs +2 -0
- package/dist/type-checks/src/is-string.mjs.map +1 -0
- package/dist/type-checks/src/is-typed-array.cjs +1 -0
- package/dist/type-checks/src/is-typed-array.mjs +2 -0
- package/dist/type-checks/src/is-typed-array.mjs.map +1 -0
- package/dist/type-checks/src/is-undefined.cjs +1 -0
- package/dist/type-checks/src/is-undefined.mjs +2 -0
- package/dist/type-checks/src/is-undefined.mjs.map +1 -0
- package/dist/type-checks/src/property-exists.cjs +1 -0
- package/dist/type-checks/src/property-exists.mjs +2 -0
- package/dist/type-checks/src/property-exists.mjs.map +1 -0
- package/dist/types/src/base.d.cts +6 -0
- package/dist/types/src/base.d.cts.map +1 -0
- package/dist/types/src/base.d.mts +6 -0
- package/dist/types/src/base.d.mts.map +1 -0
- package/dist/types/src/json.d.cts +28 -0
- package/dist/types/src/json.d.cts.map +1 -0
- package/dist/types/src/json.d.mts +28 -0
- package/dist/types/src/json.d.mts.map +1 -0
- package/dist/{object-CHmrmQna.d.mts → types/src/object.d.cts} +6 -40
- package/dist/types/src/object.d.cts.map +1 -0
- package/dist/{object-D8HGAGMr.d.cts → types/src/object.d.mts} +6 -40
- package/dist/types/src/object.d.mts.map +1 -0
- package/dist/types/src/string.d.cts +6 -0
- package/dist/types/src/string.d.cts.map +1 -0
- package/dist/types/src/string.d.mts +6 -0
- package/dist/types/src/string.d.mts.map +1 -0
- package/dist/types/src/utilities.d.cts +7 -0
- package/dist/types/src/utilities.d.cts.map +1 -0
- package/dist/types/src/utilities.d.mts +7 -0
- package/dist/types/src/utilities.d.mts.map +1 -0
- package/dist/unflatten-object.cjs +1 -1
- package/dist/unflatten-object.d.cts +35 -2
- package/dist/unflatten-object.d.cts.map +1 -0
- package/dist/unflatten-object.d.mts +35 -2
- package/dist/unflatten-object.d.mts.map +1 -0
- package/dist/unflatten-object.mjs +2 -1
- package/dist/unflatten-object.mjs.map +1 -0
- package/dist/union.cjs +1 -1
- package/dist/union.d.cts +24 -2
- package/dist/union.d.cts.map +1 -0
- package/dist/union.d.mts +24 -2
- package/dist/union.d.mts.map +1 -0
- package/dist/union.mjs +2 -1
- package/dist/union.mjs.map +1 -0
- package/dist/with-timeout.cjs +1 -1
- package/dist/with-timeout.d.cts +24 -2
- package/dist/with-timeout.d.cts.map +1 -0
- package/dist/with-timeout.d.mts +24 -2
- package/dist/with-timeout.d.mts.map +1 -0
- package/dist/with-timeout.mjs +2 -1
- package/dist/with-timeout.mjs.map +1 -0
- package/package.json +3 -3
- package/dist/arg-identity-BIir8uzO.d.mts +0 -14
- package/dist/arg-identity-BIir8uzO.d.mts.map +0 -1
- package/dist/arg-identity-BfviduMt.mjs +0 -2
- package/dist/arg-identity-BfviduMt.mjs.map +0 -1
- package/dist/arg-identity-C-pVjd0u.d.cts +0 -14
- package/dist/arg-identity-C-pVjd0u.d.cts.map +0 -1
- package/dist/arg-identity-dlKw6BsD.cjs +0 -1
- package/dist/debounce-C5O3IDKy.mjs +0 -2
- package/dist/debounce-C5O3IDKy.mjs.map +0 -1
- package/dist/debounce-CIMf8-Yr.d.mts +0 -47
- package/dist/debounce-CIMf8-Yr.d.mts.map +0 -1
- package/dist/debounce-CLb-VvJv.d.cts +0 -47
- package/dist/debounce-CLb-VvJv.d.cts.map +0 -1
- package/dist/debounce-SIYbhEOF.cjs +0 -1
- package/dist/deep-clone-BlN5QTtW.mjs +0 -2
- package/dist/deep-clone-BlN5QTtW.mjs.map +0 -1
- package/dist/deep-clone-CoUy-Hrt.cjs +0 -1
- package/dist/deep-clone-CpLJcTgz.d.mts +0 -65
- package/dist/deep-clone-CpLJcTgz.d.mts.map +0 -1
- package/dist/deep-clone-jRNy1xoj.d.cts +0 -65
- package/dist/deep-clone-jRNy1xoj.d.cts.map +0 -1
- package/dist/deep-merge-BDZ6c79O.mjs +0 -2
- package/dist/deep-merge-BDZ6c79O.mjs.map +0 -1
- package/dist/deep-merge-BpFjvumi.cjs +0 -1
- package/dist/deep-merge-C9qDSleg.d.cts +0 -26
- package/dist/deep-merge-C9qDSleg.d.cts.map +0 -1
- package/dist/deep-merge-eCT712Cv.d.mts +0 -26
- package/dist/deep-merge-eCT712Cv.d.mts.map +0 -1
- package/dist/delay-Bd_sGzMj.d.mts +0 -77
- package/dist/delay-Bd_sGzMj.d.mts.map +0 -1
- package/dist/delay-UwR_fCwt.cjs +0 -1
- package/dist/delay-VkcrQf1l.d.cts +0 -77
- package/dist/delay-VkcrQf1l.d.cts.map +0 -1
- package/dist/delay-wdNbY6sk.mjs +0 -2
- package/dist/delay-wdNbY6sk.mjs.map +0 -1
- package/dist/errors-BXYY8wXj.cjs +0 -1
- package/dist/errors-DWX9ET_b.mjs +0 -2
- package/dist/errors-DWX9ET_b.mjs.map +0 -1
- package/dist/filter-empty-5_nMg04e.cjs +0 -1
- package/dist/filter-empty-BMtd0K07.d.mts +0 -5
- package/dist/filter-empty-BMtd0K07.d.mts.map +0 -1
- package/dist/filter-empty-C2fq9M7o.d.cts +0 -5
- package/dist/filter-empty-C2fq9M7o.d.cts.map +0 -1
- package/dist/filter-empty-Dsc1ymCj.mjs +0 -2
- package/dist/filter-empty-Dsc1ymCj.mjs.map +0 -1
- package/dist/flatten-object-Bk2VT-b2.d.mts +0 -35
- package/dist/flatten-object-Bk2VT-b2.d.mts.map +0 -1
- package/dist/flatten-object-D-EbEZqR.cjs +0 -1
- package/dist/flatten-object-DFCZmly9.mjs +0 -2
- package/dist/flatten-object-DFCZmly9.mjs.map +0 -1
- package/dist/flatten-object-DjaJJaY0.d.cts +0 -35
- package/dist/flatten-object-DjaJJaY0.d.cts.map +0 -1
- package/dist/get-field-5XqtknPs.d.mts +0 -254
- package/dist/get-field-5XqtknPs.d.mts.map +0 -1
- package/dist/get-field-D4F_p-Ov.cjs +0 -1
- package/dist/get-field-ngQ9O38X.mjs +0 -2
- package/dist/get-field-ngQ9O38X.mjs.map +0 -1
- package/dist/get-field-oltWWNRO.d.cts +0 -254
- package/dist/get-field-oltWWNRO.d.cts.map +0 -1
- package/dist/get-object-tag-D53RvMgo.cjs +0 -1
- package/dist/get-object-tag-oBoWkttN.mjs +0 -2
- package/dist/get-object-tag-oBoWkttN.mjs.map +0 -1
- package/dist/get-ordered-by-C45FfW2T.d.mts +0 -39
- package/dist/get-ordered-by-C45FfW2T.d.mts.map +0 -1
- package/dist/get-ordered-by-CBKKJr4R.mjs +0 -2
- package/dist/get-ordered-by-CBKKJr4R.mjs.map +0 -1
- package/dist/get-ordered-by-D2Sr6vUN.cjs +0 -1
- package/dist/get-ordered-by-DuD7QRma.d.cts +0 -39
- package/dist/get-ordered-by-DuD7QRma.d.cts.map +0 -1
- package/dist/get-unique-BOiakY6A.cjs +0 -1
- package/dist/get-unique-C0SBPUBv.d.cts +0 -26
- package/dist/get-unique-C0SBPUBv.d.cts.map +0 -1
- package/dist/get-unique-DZ6E1Kvc.d.mts +0 -26
- package/dist/get-unique-DZ6E1Kvc.d.mts.map +0 -1
- package/dist/get-unique-DzZ7Z34U.mjs +0 -2
- package/dist/get-unique-DzZ7Z34U.mjs.map +0 -1
- package/dist/identity-B_cGeF8o.d.mts +0 -18
- package/dist/identity-B_cGeF8o.d.mts.map +0 -1
- package/dist/identity-DBwwvmGU.mjs +0 -2
- package/dist/identity-DBwwvmGU.mjs.map +0 -1
- package/dist/identity-DRhIvbPG.d.cts +0 -18
- package/dist/identity-DRhIvbPG.d.cts.map +0 -1
- package/dist/identity-z2xaIqpe.cjs +0 -1
- package/dist/is-empty-C7vlSVFD.mjs +0 -2
- package/dist/is-empty-C7vlSVFD.mjs.map +0 -1
- package/dist/is-empty-DZZDqzjD.cjs +0 -1
- package/dist/is-equal-0Z-K2uIG.mjs +0 -2
- package/dist/is-equal-0Z-K2uIG.mjs.map +0 -1
- package/dist/is-equal-BJgVhUVS.cjs +0 -1
- package/dist/is-equal-BMlMHlVi.d.cts +0 -22
- package/dist/is-equal-BMlMHlVi.d.cts.map +0 -1
- package/dist/is-equal-Baqurdpn.d.mts +0 -22
- package/dist/is-equal-Baqurdpn.d.mts.map +0 -1
- package/dist/is-number-BcjxCzDM.cjs +0 -1
- package/dist/is-number-bwhfkHlC.mjs +0 -2
- package/dist/is-number-bwhfkHlC.mjs.map +0 -1
- package/dist/is-plain-object-BQuFhL4M.cjs +0 -1
- package/dist/is-plain-object-D8GSMOhY.mjs +0 -2
- package/dist/is-plain-object-D8GSMOhY.mjs.map +0 -1
- package/dist/is-set-B9o0NIT4.mjs +0 -2
- package/dist/is-set-B9o0NIT4.mjs.map +0 -1
- package/dist/is-set-ByJOY6h2.cjs +0 -1
- package/dist/is-set-string-48_jZFw0.cjs +0 -1
- package/dist/is-set-string-Dr1MlMk0.mjs +0 -2
- package/dist/is-set-string-Dr1MlMk0.mjs.map +0 -1
- package/dist/is-string-CvmuuuDj.mjs.map +0 -1
- package/dist/is-string-DPanLeA_.cjs +0 -1
- package/dist/lru-cache-CzQ_kKXk.d.mts +0 -103
- package/dist/lru-cache-CzQ_kKXk.d.mts.map +0 -1
- package/dist/lru-cache-D4VEIgtR.d.cts +0 -103
- package/dist/lru-cache-D4VEIgtR.d.cts.map +0 -1
- package/dist/lru-cache-DLY_yZRN.mjs +0 -2
- package/dist/lru-cache-DLY_yZRN.mjs.map +0 -1
- package/dist/lru-cache-DgTSGx5W.cjs +0 -1
- package/dist/match-sorter-B9_7YvTo.mjs +0 -2
- package/dist/match-sorter-B9_7YvTo.mjs.map +0 -1
- package/dist/match-sorter-BjnWjkKu.cjs +0 -1
- package/dist/match-sorter-CMYN3GuY.d.cts +0 -78
- package/dist/match-sorter-CMYN3GuY.d.cts.map +0 -1
- package/dist/match-sorter-DCRerxVe.d.mts +0 -78
- package/dist/match-sorter-DCRerxVe.d.mts.map +0 -1
- package/dist/memoize-Cr5jFKxi.mjs +0 -2
- package/dist/memoize-Cr5jFKxi.mjs.map +0 -1
- package/dist/memoize-TyrmWrfR.d.mts +0 -11
- package/dist/memoize-TyrmWrfR.d.mts.map +0 -1
- package/dist/memoize-qxvbI-0y.cjs +0 -1
- package/dist/memoize-tSTYY522.d.cts +0 -11
- package/dist/memoize-tSTYY522.d.cts.map +0 -1
- package/dist/mutex-CnQQBndt.cjs +0 -1
- package/dist/mutex-DAZduiSP.d.mts +0 -72
- package/dist/mutex-DAZduiSP.d.mts.map +0 -1
- package/dist/mutex-DCyX7B66.d.cts +0 -72
- package/dist/mutex-DCyX7B66.d.cts.map +0 -1
- package/dist/mutex-TqoKHosg.mjs +0 -2
- package/dist/mutex-TqoKHosg.mjs.map +0 -1
- package/dist/noop-B7OetrhD.mjs +0 -2
- package/dist/noop-B7OetrhD.mjs.map +0 -1
- package/dist/noop-BnXKMH6Z.d.mts +0 -22
- package/dist/noop-BnXKMH6Z.d.mts.map +0 -1
- package/dist/noop-CnJXOCpF.d.cts +0 -22
- package/dist/noop-CnJXOCpF.d.cts.map +0 -1
- package/dist/noop-Dpf7hIui.cjs +0 -1
- package/dist/object-CHmrmQna.d.mts.map +0 -1
- package/dist/object-D8HGAGMr.d.cts.map +0 -1
- package/dist/omit-A0uVyAS4.cjs +0 -1
- package/dist/omit-BROsDK0D.mjs +0 -2
- package/dist/omit-BROsDK0D.mjs.map +0 -1
- package/dist/omit-D1FKiOYz.d.cts +0 -22
- package/dist/omit-D1FKiOYz.d.cts.map +0 -1
- package/dist/omit-DpqOAtKt.d.mts +0 -22
- package/dist/omit-DpqOAtKt.d.mts.map +0 -1
- package/dist/once-DNPPQd3P.d.mts +0 -13
- package/dist/once-DNPPQd3P.d.mts.map +0 -1
- package/dist/once-DZCwmdkv.cjs +0 -1
- package/dist/once-DqmxXwEB.d.cts +0 -13
- package/dist/once-DqmxXwEB.d.cts.map +0 -1
- package/dist/once-txoW63yJ.mjs +0 -2
- package/dist/once-txoW63yJ.mjs.map +0 -1
- package/dist/pick-CuXTvXaw.mjs +0 -2
- package/dist/pick-CuXTvXaw.mjs.map +0 -1
- package/dist/pick-DXREvZBr.d.cts +0 -22
- package/dist/pick-DXREvZBr.d.cts.map +0 -1
- package/dist/pick-GDOwAh6I.cjs +0 -1
- package/dist/pick-ZrWD4de2.d.mts +0 -22
- package/dist/pick-ZrWD4de2.d.mts.map +0 -1
- package/dist/remove-accents-BFmyvTRZ.mjs +0 -2
- package/dist/remove-accents-BFmyvTRZ.mjs.map +0 -1
- package/dist/remove-accents-C4C0A2ex.d.mts +0 -12
- package/dist/remove-accents-C4C0A2ex.d.mts.map +0 -1
- package/dist/remove-accents-CXBUC-Id.cjs +0 -1
- package/dist/remove-accents-Yo3-2jWO.d.cts +0 -12
- package/dist/remove-accents-Yo3-2jWO.d.cts.map +0 -1
- package/dist/remove-empty-items-BglsRCyG.d.cts +0 -11
- package/dist/remove-empty-items-BglsRCyG.d.cts.map +0 -1
- package/dist/remove-empty-items-BzI9Vid9.mjs +0 -2
- package/dist/remove-empty-items-BzI9Vid9.mjs.map +0 -1
- package/dist/remove-empty-items-COwdCPHC.d.mts +0 -11
- package/dist/remove-empty-items-COwdCPHC.d.mts.map +0 -1
- package/dist/remove-empty-items-CjTxJuyS.cjs +0 -1
- package/dist/semaphore-4zJqtox8.mjs +0 -2
- package/dist/semaphore-4zJqtox8.mjs.map +0 -1
- package/dist/semaphore-CsGTxqsW.d.cts +0 -86
- package/dist/semaphore-CsGTxqsW.d.cts.map +0 -1
- package/dist/semaphore-DkHqPlow.cjs +0 -1
- package/dist/semaphore-WaZBtCk5.d.mts +0 -86
- package/dist/semaphore-WaZBtCk5.d.mts.map +0 -1
- package/dist/set-field-CUgbKEjW.mjs +0 -2
- package/dist/set-field-CUgbKEjW.mjs.map +0 -1
- package/dist/set-field-CcCiXZNl.d.cts +0 -16
- package/dist/set-field-CcCiXZNl.d.cts.map +0 -1
- package/dist/set-field-DyvXgpNP.d.mts +0 -16
- package/dist/set-field-DyvXgpNP.d.mts.map +0 -1
- package/dist/set-field-mr4GkhFb.cjs +0 -1
- package/dist/throttle-BOKOTo3m.cjs +0 -1
- package/dist/throttle-BWPQuZty.d.cts +0 -32
- package/dist/throttle-BWPQuZty.d.cts.map +0 -1
- package/dist/throttle-BgU4k6qs.d.mts +0 -32
- package/dist/throttle-BgU4k6qs.d.mts.map +0 -1
- package/dist/throttle-CYK3F0mZ.mjs +0 -2
- package/dist/throttle-CYK3F0mZ.mjs.map +0 -1
- package/dist/timeout-43rG9ETK.mjs +0 -2
- package/dist/timeout-43rG9ETK.mjs.map +0 -1
- package/dist/timeout-CLhwG-oo.d.mts +0 -12
- package/dist/timeout-CLhwG-oo.d.mts.map +0 -1
- package/dist/timeout-CoYbhliP.cjs +0 -1
- package/dist/timeout-DC38jHR8.d.cts +0 -12
- package/dist/timeout-DC38jHR8.d.cts.map +0 -1
- package/dist/to-deep-key-Cma9aiEz.cjs +0 -1
- package/dist/to-deep-key-D8uDBd6T.mjs +0 -2
- package/dist/to-deep-key-D8uDBd6T.mjs.map +0 -1
- package/dist/to-deep-key-DO-Z0Zjs.d.mts +0 -42
- package/dist/to-deep-key-DO-Z0Zjs.d.mts.map +0 -1
- package/dist/to-deep-key-DlsE4ziE.d.cts +0 -42
- package/dist/to-deep-key-DlsE4ziE.d.cts.map +0 -1
- package/dist/to-path-BajxeMmo.d.mts +0 -24
- package/dist/to-path-BajxeMmo.d.mts.map +0 -1
- package/dist/to-path-CdOFd4od.cjs +0 -1
- package/dist/to-path-D2zWXeYc.d.cts +0 -24
- package/dist/to-path-D2zWXeYc.d.cts.map +0 -1
- package/dist/to-path-Dm1fe-Ix.mjs +0 -2
- package/dist/to-path-Dm1fe-Ix.mjs.map +0 -1
- package/dist/unflatten-object-C7TE8J80.mjs +0 -2
- package/dist/unflatten-object-C7TE8J80.mjs.map +0 -1
- package/dist/unflatten-object-CPJIUozj.d.mts +0 -35
- package/dist/unflatten-object-CPJIUozj.d.mts.map +0 -1
- package/dist/unflatten-object-CvZj41LG.cjs +0 -1
- package/dist/unflatten-object-Cvbj7Q__.d.cts +0 -35
- package/dist/unflatten-object-Cvbj7Q__.d.cts.map +0 -1
- package/dist/union-BMOMEzO-.d.cts +0 -24
- package/dist/union-BMOMEzO-.d.cts.map +0 -1
- package/dist/union-C-2CRoFc.mjs +0 -2
- package/dist/union-C-2CRoFc.mjs.map +0 -1
- package/dist/union-D4bbjM2i.d.mts +0 -24
- package/dist/union-D4bbjM2i.d.mts.map +0 -1
- package/dist/union-EwdcZzNT.cjs +0 -1
- package/dist/with-timeout-BPaAIZtS.d.cts +0 -24
- package/dist/with-timeout-BPaAIZtS.d.cts.map +0 -1
- package/dist/with-timeout-BoZYdcOg.d.mts +0 -24
- package/dist/with-timeout-BoZYdcOg.d.mts.map +0 -1
- package/dist/with-timeout-CAuUr1ck.mjs +0 -2
- package/dist/with-timeout-CAuUr1ck.mjs.map +0 -1
- package/dist/with-timeout-CPUBGT4X.cjs +0 -1
|
@@ -1,42 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import { Nullish } from "./base.cjs";
|
|
2
|
+
import { StringKeyOf } from "./json.cjs";
|
|
3
|
+
import { StringDigit } from "./string.cjs";
|
|
4
|
+
import { Index40 } from "./utilities.cjs";
|
|
2
5
|
|
|
3
|
-
type Nullish = undefined | null;
|
|
4
|
-
//#endregion
|
|
5
|
-
//#region ../types/src/json.d.ts
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Get keys of the given type as strings.
|
|
9
|
-
*
|
|
10
|
-
* Number keys are converted to strings.
|
|
11
|
-
*
|
|
12
|
-
* Use-cases:
|
|
13
|
-
* - Get string keys from a type which may have number keys.
|
|
14
|
-
* - Makes it possible to index using strings retrieved from template types.
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* ```
|
|
18
|
-
* import type {StringKeyOf} from 'type-fest';
|
|
19
|
-
*
|
|
20
|
-
* type Foo = {
|
|
21
|
-
* 1: number,
|
|
22
|
-
* stringKey: string,
|
|
23
|
-
* };
|
|
24
|
-
*
|
|
25
|
-
* type StringKeysOfFoo = StringKeyOf<Foo>;
|
|
26
|
-
* //=> '1' | 'stringKey'
|
|
27
|
-
* ```
|
|
28
|
-
*/
|
|
29
|
-
type StringKeyOf<BaseType> = `${Extract<keyof BaseType, string | number>}`;
|
|
30
|
-
//#endregion
|
|
31
|
-
//#region ../types/src/string.d.ts
|
|
32
|
-
|
|
33
|
-
type StringDigit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9";
|
|
34
|
-
//#endregion
|
|
35
|
-
//#region ../types/src/utilities.d.ts
|
|
36
|
-
|
|
37
|
-
type ComputeRange<N extends number, Result extends unknown[] = []> = Result["length"] extends N ? Result : ComputeRange<N, [...Result, Result["length"]]>;
|
|
38
|
-
type Index40 = ComputeRange<40>[number];
|
|
39
|
-
//#endregion
|
|
40
6
|
//#region ../types/src/object.d.ts
|
|
41
7
|
|
|
42
8
|
interface GetOptions {
|
|
@@ -156,5 +122,5 @@ type PrefixFromDepth<T extends number | string, TDepth extends any[]> = TDepth["
|
|
|
156
122
|
type DeepKey<T, TDepth extends any[] = []> = TDepth["length"] extends 5 ? never : unknown extends T ? PrefixFromDepth<string, TDepth> : T extends IsTuple<T> & any[] ? PrefixTupleAccessor<T, AllowedIndexes<T>, TDepth> : T extends any[] ? PrefixArrayAccessor<T, [...TDepth, any]> : T extends Date ? never : T extends object ? PrefixObjectAccessor<T, TDepth> : T extends bigint | boolean | number | string ? "" : never;
|
|
157
123
|
type DeepValue<TObject extends Record<string, unknown>, TPath extends DeepKey<TObject>> = GetWithPath<TObject, ToPath<TPath>>;
|
|
158
124
|
//#endregion
|
|
159
|
-
export {
|
|
160
|
-
//# sourceMappingURL=object
|
|
125
|
+
export { DeepKey, DeepValue };
|
|
126
|
+
//# sourceMappingURL=object.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"object.d.cts","names":[],"sources":["../../../../types/src/object.ts"],"sourcesContent":[],"mappings":";;;;;;;UA+OU,UAAA,CAsLA;EAAiC;;;;;;;EACf,MAAA,CAAA,EAAA,OAAA;AA6Q2C;;;;AAOhE,KA7bK,WA6bL,CAAA,QAAA,EAAA,aAAA,SAAA,MAAA,EAAA,EAAA,gBAzbW,UAybX,GAAA,CAAA,CAAA,CAAA,GAxbH,IAwbG,SAAA,SAAA,EAAA,GAvbH,QAubG,GAtbH,IAsbG,SAAA,SAAA,CAAA,KAAA,KAAA,EAAA,GAAA,KAAA,KAAA,CAAA,GArbD,WAqbC,CApbC,UAobD,CApbY,QAobZ,EApbsB,OAobtB,CApb8B,IAob9B,EAAA,MAAA,CAAA,EApb6C,OAob7C,CAAA,EAnbC,OAmbD,CAnbS,IAmbT,EAAA,MAAA,EAAA,CAAA,EAlbC,OAkbD,CAAA,GAAA,KAAA;AAAA;;;KA3aF,SAqbD,CAAA,IAAA,EAAA,gBAnbc,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,mBACE,qBAAqB,GAAG,UACxB;KAaF,0BACM,uCACF,QAAQ,YACpB,YAAY,SAAS,OAAO"}
|
|
@@ -1,42 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import { Nullish } from "./base.mjs";
|
|
2
|
+
import { StringKeyOf } from "./json.mjs";
|
|
3
|
+
import { StringDigit } from "./string.mjs";
|
|
4
|
+
import { Index40 } from "./utilities.mjs";
|
|
2
5
|
|
|
3
|
-
type Nullish = undefined | null;
|
|
4
|
-
//#endregion
|
|
5
|
-
//#region ../types/src/json.d.ts
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Get keys of the given type as strings.
|
|
9
|
-
*
|
|
10
|
-
* Number keys are converted to strings.
|
|
11
|
-
*
|
|
12
|
-
* Use-cases:
|
|
13
|
-
* - Get string keys from a type which may have number keys.
|
|
14
|
-
* - Makes it possible to index using strings retrieved from template types.
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* ```
|
|
18
|
-
* import type {StringKeyOf} from 'type-fest';
|
|
19
|
-
*
|
|
20
|
-
* type Foo = {
|
|
21
|
-
* 1: number,
|
|
22
|
-
* stringKey: string,
|
|
23
|
-
* };
|
|
24
|
-
*
|
|
25
|
-
* type StringKeysOfFoo = StringKeyOf<Foo>;
|
|
26
|
-
* //=> '1' | 'stringKey'
|
|
27
|
-
* ```
|
|
28
|
-
*/
|
|
29
|
-
type StringKeyOf<BaseType> = `${Extract<keyof BaseType, string | number>}`;
|
|
30
|
-
//#endregion
|
|
31
|
-
//#region ../types/src/string.d.ts
|
|
32
|
-
|
|
33
|
-
type StringDigit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9";
|
|
34
|
-
//#endregion
|
|
35
|
-
//#region ../types/src/utilities.d.ts
|
|
36
|
-
|
|
37
|
-
type ComputeRange<N extends number, Result extends unknown[] = []> = Result["length"] extends N ? Result : ComputeRange<N, [...Result, Result["length"]]>;
|
|
38
|
-
type Index40 = ComputeRange<40>[number];
|
|
39
|
-
//#endregion
|
|
40
6
|
//#region ../types/src/object.d.ts
|
|
41
7
|
|
|
42
8
|
interface GetOptions {
|
|
@@ -156,5 +122,5 @@ type PrefixFromDepth<T extends number | string, TDepth extends any[]> = TDepth["
|
|
|
156
122
|
type DeepKey<T, TDepth extends any[] = []> = TDepth["length"] extends 5 ? never : unknown extends T ? PrefixFromDepth<string, TDepth> : T extends IsTuple<T> & any[] ? PrefixTupleAccessor<T, AllowedIndexes<T>, TDepth> : T extends any[] ? PrefixArrayAccessor<T, [...TDepth, any]> : T extends Date ? never : T extends object ? PrefixObjectAccessor<T, TDepth> : T extends bigint | boolean | number | string ? "" : never;
|
|
157
123
|
type DeepValue<TObject extends Record<string, unknown>, TPath extends DeepKey<TObject>> = GetWithPath<TObject, ToPath<TPath>>;
|
|
158
124
|
//#endregion
|
|
159
|
-
export {
|
|
160
|
-
//# sourceMappingURL=object
|
|
125
|
+
export { DeepKey, DeepValue };
|
|
126
|
+
//# sourceMappingURL=object.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"object.d.mts","names":[],"sources":["../../../../types/src/object.ts"],"sourcesContent":[],"mappings":";;;;;;;UA+OU,UAAA,CAsLA;EAAiC;;;;;;;EACf,MAAA,CAAA,EAAA,OAAA;AA6Q2C;;;;AAOhE,KA7bK,WA6bL,CAAA,QAAA,EAAA,aAAA,SAAA,MAAA,EAAA,EAAA,gBAzbW,UAybX,GAAA,CAAA,CAAA,CAAA,GAxbH,IAwbG,SAAA,SAAA,EAAA,GAvbH,QAubG,GAtbH,IAsbG,SAAA,SAAA,CAAA,KAAA,KAAA,EAAA,GAAA,KAAA,KAAA,CAAA,GArbD,WAqbC,CApbC,UAobD,CApbY,QAobZ,EApbsB,OAobtB,CApb8B,IAob9B,EAAA,MAAA,CAAA,EApb6C,OAob7C,CAAA,EAnbC,OAmbD,CAnbS,IAmbT,EAAA,MAAA,EAAA,CAAA,EAlbC,OAkbD,CAAA,GAAA,KAA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IAAI,UAC1C,kBACE,oBAAoB,OAAO,gBAC3B,UAAU,eAER,mBACE,qBAAqB,GAAG,UACxB;KAaF,0BACM,uCACF,QAAQ,YACpB,YAAY,SAAS,OAAO"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"string.d.cts","names":[],"sources":["../../../../types/src/string.ts"],"sourcesContent":[],"mappings":";;KAiJY,WAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"string.d.mts","names":[],"sources":["../../../../types/src/string.ts"],"sourcesContent":[],"mappings":";;KAiJY,WAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
//#region ../types/src/utilities.d.ts
|
|
2
|
+
|
|
3
|
+
type ComputeRange<N extends number, Result extends unknown[] = []> = Result["length"] extends N ? Result : ComputeRange<N, [...Result, Result["length"]]>;
|
|
4
|
+
type Index40 = ComputeRange<40>[number];
|
|
5
|
+
//#endregion
|
|
6
|
+
export { Index40 };
|
|
7
|
+
//# sourceMappingURL=utilities.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utilities.d.cts","names":[],"sources":["../../../../types/src/utilities.ts"],"sourcesContent":[],"mappings":";;KA6CY,gEAGR,yBAAyB,IACzB,SACA,aAAa,OAAO,QAAQ;KAEpB,OAAA,GAAU"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
//#region ../types/src/utilities.d.ts
|
|
2
|
+
|
|
3
|
+
type ComputeRange<N extends number, Result extends unknown[] = []> = Result["length"] extends N ? Result : ComputeRange<N, [...Result, Result["length"]]>;
|
|
4
|
+
type Index40 = ComputeRange<40>[number];
|
|
5
|
+
//#endregion
|
|
6
|
+
export { Index40 };
|
|
7
|
+
//# sourceMappingURL=utilities.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utilities.d.mts","names":[],"sources":["../../../../types/src/utilities.ts"],"sourcesContent":[],"mappings":";;KA6CY,gEAGR,yBAAyB,IACzB,SACA,aAAa,OAAO,QAAQ;KAEpB,OAAA,GAAU"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`./
|
|
1
|
+
const e=require(`./set-field.cjs`);function t(t){return Object.entries(t).reduce((t,[n,r])=>e.setField(t,n,r),{})}exports.unflattenObject=t;
|
|
@@ -1,2 +1,35 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { DeepKey, DeepValue } from "./types/src/object.cjs";
|
|
2
|
+
|
|
3
|
+
//#region src/unflatten-object.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Flattens a nested object into a single level object with dot-separated keys.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* const nestedObject = {
|
|
11
|
+
* a: {
|
|
12
|
+
* b: {
|
|
13
|
+
* c: 1
|
|
14
|
+
* }
|
|
15
|
+
* },
|
|
16
|
+
* d: [2, 3]
|
|
17
|
+
* };
|
|
18
|
+
*
|
|
19
|
+
* const flattened = flattenObject(nestedObject);
|
|
20
|
+
* console.log(flattened);
|
|
21
|
+
* // Output:
|
|
22
|
+
* // {
|
|
23
|
+
* // 'a.b.c': 1,
|
|
24
|
+
* // 'd.0': 2,
|
|
25
|
+
* // 'd.1': 3
|
|
26
|
+
* // }
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* @param object - The object to flatten.
|
|
30
|
+
* @returns - The flattened object.
|
|
31
|
+
*/
|
|
32
|
+
declare function unflattenObject<TObject extends Record<string, any> = Record<string, any>, TDeepKeyObject extends { [TKey in DeepKey<TObject>]: DeepValue<TObject, TKey> } = { [TKey in DeepKey<TObject>]: DeepValue<TObject, TKey> }>(deepKeyObject: TDeepKeyObject): TObject;
|
|
33
|
+
//#endregion
|
|
34
|
+
export { unflattenObject };
|
|
35
|
+
//# sourceMappingURL=unflatten-object.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unflatten-object.d.cts","names":[],"sources":["../src/unflatten-object.ts"],"sourcesContent":[],"mappings":";;;;;;AA+CA;;;;;;;;;;;;;;;;;;;;;;;;;iBAAgB,gCACE,sBAAsB,uDAE3B,QAAQ,WAAW,UAAU,SAAS,qBAClC,QAAQ,WAAW,UAAU,SAAS,wBACtC,iBAAiB"}
|
|
@@ -1,2 +1,35 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { DeepKey, DeepValue } from "./types/src/object.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/unflatten-object.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Flattens a nested object into a single level object with dot-separated keys.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* const nestedObject = {
|
|
11
|
+
* a: {
|
|
12
|
+
* b: {
|
|
13
|
+
* c: 1
|
|
14
|
+
* }
|
|
15
|
+
* },
|
|
16
|
+
* d: [2, 3]
|
|
17
|
+
* };
|
|
18
|
+
*
|
|
19
|
+
* const flattened = flattenObject(nestedObject);
|
|
20
|
+
* console.log(flattened);
|
|
21
|
+
* // Output:
|
|
22
|
+
* // {
|
|
23
|
+
* // 'a.b.c': 1,
|
|
24
|
+
* // 'd.0': 2,
|
|
25
|
+
* // 'd.1': 3
|
|
26
|
+
* // }
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* @param object - The object to flatten.
|
|
30
|
+
* @returns - The flattened object.
|
|
31
|
+
*/
|
|
32
|
+
declare function unflattenObject<TObject extends Record<string, any> = Record<string, any>, TDeepKeyObject extends { [TKey in DeepKey<TObject>]: DeepValue<TObject, TKey> } = { [TKey in DeepKey<TObject>]: DeepValue<TObject, TKey> }>(deepKeyObject: TDeepKeyObject): TObject;
|
|
33
|
+
//#endregion
|
|
34
|
+
export { unflattenObject };
|
|
35
|
+
//# sourceMappingURL=unflatten-object.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unflatten-object.d.mts","names":[],"sources":["../src/unflatten-object.ts"],"sourcesContent":[],"mappings":";;;;;;AA+CA;;;;;;;;;;;;;;;;;;;;;;;;;iBAAgB,gCACE,sBAAsB,uDAE3B,QAAQ,WAAW,UAAU,SAAS,qBAClC,QAAQ,WAAW,UAAU,SAAS,wBACtC,iBAAiB"}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import{setField as e}from"./set-field.mjs";function t(t){return Object.entries(t).reduce((t,[n,r])=>e(t,n,r),{})}export{t as unflattenObject};
|
|
2
|
+
//# sourceMappingURL=unflatten-object.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unflatten-object.mjs","names":[],"sources":["../src/unflatten-object.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 License, and is\n free for commercial and private use. For more information, please visit\n our licensing page.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://stormsoftware.com/projects/stryke/docs\n Contact: https://stormsoftware.com/contact\n License: https://stormsoftware.com/projects/stryke/license\n\n ------------------------------------------------------------------- */\n\nimport type { DeepKey, DeepValue } from \"@stryke/types/object\";\nimport { setField } from \"./set-field\";\n\n/**\n * Flattens a nested object into a single level object with dot-separated keys.\n *\n * @example\n * ```typescript\n * const nestedObject = {\n * a: {\n * b: {\n * c: 1\n * }\n * },\n * d: [2, 3]\n * };\n *\n * const flattened = flattenObject(nestedObject);\n * console.log(flattened);\n * // Output:\n * // {\n * // 'a.b.c': 1,\n * // 'd.0': 2,\n * // 'd.1': 3\n * // }\n * ```\n *\n * @param object - The object to flatten.\n * @returns - The flattened object.\n */\nexport function unflattenObject<\n TObject extends Record<string, any> = Record<string, any>,\n TDeepKeyObject extends {\n [TKey in DeepKey<TObject>]: DeepValue<TObject, TKey>;\n } = { [TKey in DeepKey<TObject>]: DeepValue<TObject, TKey> }\n>(deepKeyObject: TDeepKeyObject): TObject {\n return Object.entries(deepKeyObject).reduce(\n (ret: TObject, [key, value]: [string, any]) => {\n return setField<TObject>(ret, key as DeepKey<TObject>, value);\n },\n {} as TObject\n );\n}\n"],"mappings":"2CA+CA,SAAgB,EAKd,EAAwC,CACxC,OAAO,OAAO,QAAQ,EAAc,CAAC,QAClC,EAAc,CAAC,EAAK,KACZ,EAAkB,EAAK,EAAyB,EAAM,CAE/D,EAAE,CACH"}
|
package/dist/union.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`./
|
|
1
|
+
const e=require(`./get-unique.cjs`);function t(t,n){return e.getUnique([...t,...n])}exports.union=t;
|
package/dist/union.d.cts
CHANGED
|
@@ -1,2 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
//#region src/union.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Creates an array of unique values from all given arrays.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* This function takes two arrays, merges them into a single array, and returns a new array
|
|
7
|
+
* containing only the unique values from the merged array.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* const array1 = [1, 2, 3];
|
|
12
|
+
* const array2 = [3, 4, 5];
|
|
13
|
+
* const result = union(array1, array2);
|
|
14
|
+
* // result will be [1, 2, 3, 4, 5]
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @param arr1 - The first array to merge and filter for unique values.
|
|
18
|
+
* @param arr2 - The second array to merge and filter for unique values.
|
|
19
|
+
* @returns A new array of unique values.
|
|
20
|
+
*/
|
|
21
|
+
declare function union<T>(arr1: readonly T[], arr2: readonly T[]): T[];
|
|
22
|
+
//#endregion
|
|
23
|
+
export { union };
|
|
24
|
+
//# sourceMappingURL=union.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"union.d.cts","names":[],"sources":["../src/union.ts"],"sourcesContent":[],"mappings":";;AAsCA;;;;;;;;;;;;;;;;;;iBAAgB,wBAAwB,oBAAoB,MAAM"}
|
package/dist/union.d.mts
CHANGED
|
@@ -1,2 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
//#region src/union.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Creates an array of unique values from all given arrays.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* This function takes two arrays, merges them into a single array, and returns a new array
|
|
7
|
+
* containing only the unique values from the merged array.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* const array1 = [1, 2, 3];
|
|
12
|
+
* const array2 = [3, 4, 5];
|
|
13
|
+
* const result = union(array1, array2);
|
|
14
|
+
* // result will be [1, 2, 3, 4, 5]
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @param arr1 - The first array to merge and filter for unique values.
|
|
18
|
+
* @param arr2 - The second array to merge and filter for unique values.
|
|
19
|
+
* @returns A new array of unique values.
|
|
20
|
+
*/
|
|
21
|
+
declare function union<T>(arr1: readonly T[], arr2: readonly T[]): T[];
|
|
22
|
+
//#endregion
|
|
23
|
+
export { union };
|
|
24
|
+
//# sourceMappingURL=union.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"union.d.mts","names":[],"sources":["../src/union.ts"],"sourcesContent":[],"mappings":";;AAsCA;;;;;;;;;;;;;;;;;;iBAAgB,wBAAwB,oBAAoB,MAAM"}
|
package/dist/union.mjs
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{getUnique as e}from"./get-unique.mjs";function t(t,n){return e([...t,...n])}export{t as union};
|
|
2
|
+
//# sourceMappingURL=union.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"union.mjs","names":[],"sources":["../src/union.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 License, and is\n free for commercial and private use. For more information, please visit\n our licensing page.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://stormsoftware.com/projects/stryke/docs\n Contact: https://stormsoftware.com/contact\n License: https://stormsoftware.com/projects/stryke/license\n\n ------------------------------------------------------------------- */\n\nimport { getUnique } from \"./get-unique\";\n\n/**\n * Creates an array of unique values from all given arrays.\n *\n * @remarks\n * This function takes two arrays, merges them into a single array, and returns a new array\n * containing only the unique values from the merged array.\n *\n * @example\n * ```ts\n * const array1 = [1, 2, 3];\n * const array2 = [3, 4, 5];\n * const result = union(array1, array2);\n * // result will be [1, 2, 3, 4, 5]\n * ```\n *\n * @param arr1 - The first array to merge and filter for unique values.\n * @param arr2 - The second array to merge and filter for unique values.\n * @returns A new array of unique values.\n */\nexport function union<T>(arr1: readonly T[], arr2: readonly T[]): T[] {\n return getUnique([...arr1, ...arr2]);\n}\n"],"mappings":"6CAsCA,SAAgB,EAAS,EAAoB,EAAyB,CACpE,OAAO,EAAU,CAAC,GAAG,EAAM,GAAG,EAAK,CAAC"}
|
package/dist/with-timeout.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`./
|
|
1
|
+
const e=require(`./timeout.cjs`);async function t(t,n){return Promise.race([t(),e.timeout(n)])}exports.withTimeout=t;
|
package/dist/with-timeout.d.cts
CHANGED
|
@@ -1,2 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
//#region src/with-timeout.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Executes an async function and enforces a timeout.
|
|
4
|
+
*
|
|
5
|
+
* If the promise does not resolve within the specified time,
|
|
6
|
+
* the timeout will trigger and the returned promise will be rejected.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* try {
|
|
11
|
+
* await withTimeout(() => {}, 1000); // Timeout exception after 1 second
|
|
12
|
+
* } catch (error) {
|
|
13
|
+
* console.error(error); // Will log 'TimeoutError'
|
|
14
|
+
* }
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @param run - A function that returns a promise to be executed.
|
|
18
|
+
* @param ms - The timeout duration in milliseconds.
|
|
19
|
+
* @returns A promise that resolves with the result of the `run` function or rejects if the timeout is reached.
|
|
20
|
+
*/
|
|
21
|
+
declare function withTimeout<T>(run: () => Promise<T>, ms: number): Promise<T>;
|
|
22
|
+
//#endregion
|
|
23
|
+
export { withTimeout };
|
|
24
|
+
//# sourceMappingURL=with-timeout.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"with-timeout.d.cts","names":[],"sources":["../src/with-timeout.ts"],"sourcesContent":[],"mappings":";;AAsCA;;;;;;;;;;;;;;;;;;iBAAsB,0BACT,QAAQ,iBAElB,QAAQ"}
|
package/dist/with-timeout.d.mts
CHANGED
|
@@ -1,2 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
//#region src/with-timeout.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Executes an async function and enforces a timeout.
|
|
4
|
+
*
|
|
5
|
+
* If the promise does not resolve within the specified time,
|
|
6
|
+
* the timeout will trigger and the returned promise will be rejected.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* try {
|
|
11
|
+
* await withTimeout(() => {}, 1000); // Timeout exception after 1 second
|
|
12
|
+
* } catch (error) {
|
|
13
|
+
* console.error(error); // Will log 'TimeoutError'
|
|
14
|
+
* }
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @param run - A function that returns a promise to be executed.
|
|
18
|
+
* @param ms - The timeout duration in milliseconds.
|
|
19
|
+
* @returns A promise that resolves with the result of the `run` function or rejects if the timeout is reached.
|
|
20
|
+
*/
|
|
21
|
+
declare function withTimeout<T>(run: () => Promise<T>, ms: number): Promise<T>;
|
|
22
|
+
//#endregion
|
|
23
|
+
export { withTimeout };
|
|
24
|
+
//# sourceMappingURL=with-timeout.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"with-timeout.d.mts","names":[],"sources":["../src/with-timeout.ts"],"sourcesContent":[],"mappings":";;AAsCA;;;;;;;;;;;;;;;;;;iBAAsB,0BACT,QAAQ,iBAElB,QAAQ"}
|
package/dist/with-timeout.mjs
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{timeout as e}from"./timeout.mjs";async function t(t,n){return Promise.race([t(),e(n)])}export{t as withTimeout};
|
|
2
|
+
//# sourceMappingURL=with-timeout.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"with-timeout.mjs","names":[],"sources":["../src/with-timeout.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 License, and is\n free for commercial and private use. For more information, please visit\n our licensing page.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://stormsoftware.com/projects/stryke/docs\n Contact: https://stormsoftware.com/contact\n License: https://stormsoftware.com/projects/stryke/license\n\n ------------------------------------------------------------------- */\n\nimport { timeout } from \"./timeout\";\n\n/**\n * Executes an async function and enforces a timeout.\n *\n * If the promise does not resolve within the specified time,\n * the timeout will trigger and the returned promise will be rejected.\n *\n * @example\n * ```typescript\n * try {\n * await withTimeout(() => {}, 1000); // Timeout exception after 1 second\n * } catch (error) {\n * console.error(error); // Will log 'TimeoutError'\n * }\n * ```\n *\n * @param run - A function that returns a promise to be executed.\n * @param ms - The timeout duration in milliseconds.\n * @returns A promise that resolves with the result of the `run` function or rejects if the timeout is reached.\n */\nexport async function withTimeout<T>(\n run: () => Promise<T>,\n ms: number\n): Promise<T> {\n return Promise.race([run(), timeout(ms) as T]);\n}\n"],"mappings":"wCAsCA,eAAsB,EACpB,EACA,EACY,CACZ,OAAO,QAAQ,KAAK,CAAC,GAAK,CAAE,EAAQ,EAAG,CAAM,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stryke/helpers",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.28",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A package containing miscellaneous helper functions that are used across many different Storm Software projects.",
|
|
6
6
|
"repository": {
|
|
@@ -123,7 +123,7 @@
|
|
|
123
123
|
"./*": "./*"
|
|
124
124
|
},
|
|
125
125
|
"types": "./dist/index.d.cts",
|
|
126
|
-
"devDependencies": { "tsdown": "^0.17.
|
|
126
|
+
"devDependencies": { "tsdown": "^0.17.2" },
|
|
127
127
|
"publishConfig": { "access": "public" },
|
|
128
|
-
"gitHead": "
|
|
128
|
+
"gitHead": "afcd140cfb0555b3dacd5ece701909f66c174068"
|
|
129
129
|
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
//#region src/arg-identity.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* This method returns the first argument provided to it.
|
|
4
|
-
*
|
|
5
|
-
* @remarks
|
|
6
|
-
* For more info, please see {@link https://lodash.com/docs/4.17.15#identity | the original Lodash documentation}.
|
|
7
|
-
*
|
|
8
|
-
* @param value - The value to return.
|
|
9
|
-
* @returns The value provided.
|
|
10
|
-
*/
|
|
11
|
-
declare function argIdentity(value: any): any;
|
|
12
|
-
//#endregion
|
|
13
|
-
export { argIdentity as t };
|
|
14
|
-
//# sourceMappingURL=arg-identity-BIir8uzO.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"arg-identity-BIir8uzO.d.mts","names":[],"sources":["../src/arg-identity.ts"],"sourcesContent":[],"mappings":";;AA0BA;;;;;;;;iBAAgB,WAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"arg-identity-BfviduMt.mjs","names":[],"sources":["../src/arg-identity.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 License, and is\n free for commercial and private use. For more information, please visit\n our licensing page.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://stormsoftware.com/projects/stryke/docs\n Contact: https://stormsoftware.com/contact\n License: https://stormsoftware.com/projects/stryke/license\n\n ------------------------------------------------------------------- */\n\n/**\n * This method returns the first argument provided to it.\n *\n * @remarks\n * For more info, please see {@link https://lodash.com/docs/4.17.15#identity | the original Lodash documentation}.\n *\n * @param value - The value to return.\n * @returns The value provided.\n */\nexport function argIdentity(value: any) {\n return value;\n}\n"],"mappings":"AA0BA,SAAgB,EAAY,EAAY,CACtC,OAAO"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
//#region src/arg-identity.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* This method returns the first argument provided to it.
|
|
4
|
-
*
|
|
5
|
-
* @remarks
|
|
6
|
-
* For more info, please see {@link https://lodash.com/docs/4.17.15#identity | the original Lodash documentation}.
|
|
7
|
-
*
|
|
8
|
-
* @param value - The value to return.
|
|
9
|
-
* @returns The value provided.
|
|
10
|
-
*/
|
|
11
|
-
declare function argIdentity(value: any): any;
|
|
12
|
-
//#endregion
|
|
13
|
-
export { argIdentity as t };
|
|
14
|
-
//# sourceMappingURL=arg-identity-C-pVjd0u.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"arg-identity-C-pVjd0u.d.cts","names":[],"sources":["../src/arg-identity.ts"],"sourcesContent":[],"mappings":";;AA0BA;;;;;;;;iBAAgB,WAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function e(e){return e}Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return e}});
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
function e(e,t,{signal:n}={}){let r=null,i=((...i)=>{r!==null&&clearTimeout(r),!n?.aborted&&(r=setTimeout(()=>{e(...i),r=null},t))});return i.cancel=()=>{r!==null&&(clearTimeout(r),r=null)},n?.addEventListener(`abort`,()=>{i.cancel()},{once:!0}),i}export{e as t};
|
|
2
|
-
//# sourceMappingURL=debounce-C5O3IDKy.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"debounce-C5O3IDKy.mjs","names":["timeoutId: ReturnType<typeof setTimeout> | null"],"sources":["../src/debounce.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 License, and is\n free for commercial and private use. For more information, please visit\n our licensing page.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://stormsoftware.com/projects/stryke/docs\n Contact: https://stormsoftware.com/contact\n License: https://stormsoftware.com/projects/stryke/license\n\n ------------------------------------------------------------------- */\n\nexport interface DebounceOptions {\n signal?: AbortSignal;\n}\n\n/**\n * Creates a debounced function that delays invoking the provided function until after `debounceMs` milliseconds\n * have elapsed since the last time the debounced function was invoked. The debounced function also has a `cancel`\n * method to cancel any pending execution.\n *\n * @example\n * ```typescript\n * const debouncedFunction = debounce(() => {\n * console.log('Function executed');\n * }, 1000);\n *\n * // Will log 'Function executed' after 1 second if not called again in that time\n * debouncedFunction();\n *\n * // Will not log anything as the previous call is canceled\n * debouncedFunction.cancel();\n *\n * // With AbortSignal\n * const controller = new AbortController();\n * const signal = controller.signal;\n * const debouncedWithSignal = debounce(() => {\n * console.log('Function executed');\n * }, 1000, { signal });\n *\n * debouncedWithSignal();\n *\n * // Will cancel the debounced function call\n * controller.abort();\n * ```\n *\n * @param func - The function to debounce.\n * @param debounceMs - The number of milliseconds to delay.\n * @param options - The options object.\n * @returns A new debounced function with a `cancel` method.\n */\nexport function debounce<F extends (...args: any[]) => void>(\n func: F,\n debounceMs: number,\n { signal }: DebounceOptions = {}\n): F & { cancel: () => void } {\n let timeoutId: ReturnType<typeof setTimeout> | null = null;\n\n const debounced = ((...args: Parameters<F>) => {\n if (timeoutId !== null) {\n clearTimeout(timeoutId);\n }\n\n if (signal?.aborted) {\n return;\n }\n\n timeoutId = setTimeout(() => {\n func(...args);\n timeoutId = null;\n }, debounceMs);\n }) as F & { cancel: () => void };\n\n const onAbort = () => {\n debounced.cancel();\n };\n\n debounced.cancel = () => {\n if (timeoutId !== null) {\n clearTimeout(timeoutId);\n timeoutId = null;\n }\n };\n\n signal?.addEventListener(\"abort\", onAbort, { once: true });\n\n return debounced;\n}\n"],"mappings":"AAwDA,SAAgB,EACd,EACA,EACA,CAAE,UAA4B,EAAE,CACJ,CAC5B,IAAIA,EAAkD,KAEhD,IAAc,GAAG,IAAwB,CACzC,IAAc,MAChB,aAAa,EAAU,CAGrB,IAAQ,UAIZ,EAAY,eAAiB,CAC3B,EAAK,GAAG,EAAK,CACb,EAAY,MACX,EAAW,IAgBhB,MATA,GAAU,WAAe,CACnB,IAAc,OAChB,aAAa,EAAU,CACvB,EAAY,OAIhB,GAAQ,iBAAiB,YAXH,CACpB,EAAU,QAAQ,EAUuB,CAAE,KAAM,GAAM,CAAC,CAEnD"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
//#region src/debounce.d.ts
|
|
2
|
-
interface DebounceOptions {
|
|
3
|
-
signal?: AbortSignal;
|
|
4
|
-
}
|
|
5
|
-
/**
|
|
6
|
-
* Creates a debounced function that delays invoking the provided function until after `debounceMs` milliseconds
|
|
7
|
-
* have elapsed since the last time the debounced function was invoked. The debounced function also has a `cancel`
|
|
8
|
-
* method to cancel any pending execution.
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* ```typescript
|
|
12
|
-
* const debouncedFunction = debounce(() => {
|
|
13
|
-
* console.log('Function executed');
|
|
14
|
-
* }, 1000);
|
|
15
|
-
*
|
|
16
|
-
* // Will log 'Function executed' after 1 second if not called again in that time
|
|
17
|
-
* debouncedFunction();
|
|
18
|
-
*
|
|
19
|
-
* // Will not log anything as the previous call is canceled
|
|
20
|
-
* debouncedFunction.cancel();
|
|
21
|
-
*
|
|
22
|
-
* // With AbortSignal
|
|
23
|
-
* const controller = new AbortController();
|
|
24
|
-
* const signal = controller.signal;
|
|
25
|
-
* const debouncedWithSignal = debounce(() => {
|
|
26
|
-
* console.log('Function executed');
|
|
27
|
-
* }, 1000, { signal });
|
|
28
|
-
*
|
|
29
|
-
* debouncedWithSignal();
|
|
30
|
-
*
|
|
31
|
-
* // Will cancel the debounced function call
|
|
32
|
-
* controller.abort();
|
|
33
|
-
* ```
|
|
34
|
-
*
|
|
35
|
-
* @param func - The function to debounce.
|
|
36
|
-
* @param debounceMs - The number of milliseconds to delay.
|
|
37
|
-
* @param options - The options object.
|
|
38
|
-
* @returns A new debounced function with a `cancel` method.
|
|
39
|
-
*/
|
|
40
|
-
declare function debounce<F extends (...args: any[]) => void>(func: F, debounceMs: number, {
|
|
41
|
-
signal
|
|
42
|
-
}?: DebounceOptions): F & {
|
|
43
|
-
cancel: () => void;
|
|
44
|
-
};
|
|
45
|
-
//#endregion
|
|
46
|
-
export { debounce as n, DebounceOptions as t };
|
|
47
|
-
//# sourceMappingURL=debounce-CIMf8-Yr.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"debounce-CIMf8-Yr.d.mts","names":[],"sources":["../src/debounce.ts"],"sourcesContent":[],"mappings":";UAiBiB,eAAA;EAAA,MAAA,CAAA,EACN,WADqB;AAuChC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAgB,mDACR;;IAEM,kBACX"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
//#region src/debounce.d.ts
|
|
2
|
-
interface DebounceOptions {
|
|
3
|
-
signal?: AbortSignal;
|
|
4
|
-
}
|
|
5
|
-
/**
|
|
6
|
-
* Creates a debounced function that delays invoking the provided function until after `debounceMs` milliseconds
|
|
7
|
-
* have elapsed since the last time the debounced function was invoked. The debounced function also has a `cancel`
|
|
8
|
-
* method to cancel any pending execution.
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* ```typescript
|
|
12
|
-
* const debouncedFunction = debounce(() => {
|
|
13
|
-
* console.log('Function executed');
|
|
14
|
-
* }, 1000);
|
|
15
|
-
*
|
|
16
|
-
* // Will log 'Function executed' after 1 second if not called again in that time
|
|
17
|
-
* debouncedFunction();
|
|
18
|
-
*
|
|
19
|
-
* // Will not log anything as the previous call is canceled
|
|
20
|
-
* debouncedFunction.cancel();
|
|
21
|
-
*
|
|
22
|
-
* // With AbortSignal
|
|
23
|
-
* const controller = new AbortController();
|
|
24
|
-
* const signal = controller.signal;
|
|
25
|
-
* const debouncedWithSignal = debounce(() => {
|
|
26
|
-
* console.log('Function executed');
|
|
27
|
-
* }, 1000, { signal });
|
|
28
|
-
*
|
|
29
|
-
* debouncedWithSignal();
|
|
30
|
-
*
|
|
31
|
-
* // Will cancel the debounced function call
|
|
32
|
-
* controller.abort();
|
|
33
|
-
* ```
|
|
34
|
-
*
|
|
35
|
-
* @param func - The function to debounce.
|
|
36
|
-
* @param debounceMs - The number of milliseconds to delay.
|
|
37
|
-
* @param options - The options object.
|
|
38
|
-
* @returns A new debounced function with a `cancel` method.
|
|
39
|
-
*/
|
|
40
|
-
declare function debounce<F extends (...args: any[]) => void>(func: F, debounceMs: number, {
|
|
41
|
-
signal
|
|
42
|
-
}?: DebounceOptions): F & {
|
|
43
|
-
cancel: () => void;
|
|
44
|
-
};
|
|
45
|
-
//#endregion
|
|
46
|
-
export { debounce as n, DebounceOptions as t };
|
|
47
|
-
//# sourceMappingURL=debounce-CLb-VvJv.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"debounce-CLb-VvJv.d.cts","names":[],"sources":["../src/debounce.ts"],"sourcesContent":[],"mappings":";UAiBiB,eAAA;EAAA,MAAA,CAAA,EACN,WADqB;AAuChC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAgB,mDACR;;IAEM,kBACX"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function e(e,t,{signal:n}={}){let r=null,i=((...i)=>{r!==null&&clearTimeout(r),!n?.aborted&&(r=setTimeout(()=>{e(...i),r=null},t))});return i.cancel=()=>{r!==null&&(clearTimeout(r),r=null)},n?.addEventListener(`abort`,()=>{i.cancel()},{once:!0}),i}Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return e}});
|