@telperion/js-utils 3.7.0 → 3.8.0
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/.build-manifest.json +966 -0
- package/README.md +24 -0
- package/array/arrayize.cjs +5 -3
- package/array/arrayize.cjs.map +1 -0
- package/array/arrayize.d.cts +19 -0
- package/array/arrayize.d.ts +3 -1
- package/array/arrayize.js +2 -1
- package/array/arrayize.js.map +1 -1
- package/array/async-map.cjs +5 -3
- package/array/async-map.cjs.map +1 -0
- package/array/async-map.d.cts +36 -0
- package/array/async-map.d.ts +3 -1
- package/array/async-map.js +2 -1
- package/array/async-map.js.map +1 -1
- package/array/compact.cjs +8 -5
- package/array/compact.cjs.map +1 -0
- package/array/compact.d.cts +30 -0
- package/array/compact.d.ts +3 -1
- package/array/compact.js +4 -2
- package/array/compact.js.map +1 -1
- package/array/difference.cjs +5 -3
- package/array/difference.cjs.map +1 -0
- package/array/difference.d.cts +48 -0
- package/array/difference.d.ts +6 -3
- package/array/difference.js +2 -1
- package/array/difference.js.map +1 -1
- package/array/find-by-key.cjs +5 -3
- package/array/find-by-key.cjs.map +1 -0
- package/array/find-by-key.d.cts +32 -0
- package/array/find-by-key.d.ts +3 -1
- package/array/find-by-key.js +2 -1
- package/array/find-by-key.js.map +1 -1
- package/array/gather.cjs +5 -3
- package/array/gather.cjs.map +1 -0
- package/array/gather.d.cts +50 -0
- package/array/gather.d.ts +3 -1
- package/array/gather.js +2 -1
- package/array/gather.js.map +1 -1
- package/array/index.cjs +34 -15
- package/array/index.cjs.map +1 -0
- package/array/index.d.cts +14 -0
- package/array/index.d.ts +14 -12
- package/array/index.js +14 -13
- package/array/index.js.map +1 -1
- package/array/intersection.cjs +5 -3
- package/array/intersection.cjs.map +1 -0
- package/array/intersection.d.cts +48 -0
- package/array/intersection.d.ts +6 -3
- package/array/intersection.js +2 -1
- package/array/intersection.js.map +1 -1
- package/array/limit.cjs +5 -3
- package/array/limit.cjs.map +1 -0
- package/array/limit.d.cts +31 -0
- package/array/limit.d.ts +3 -1
- package/array/limit.js +2 -1
- package/array/limit.js.map +1 -1
- package/array/proto/async-map.cjs +6 -4
- package/array/proto/async-map.cjs.map +1 -0
- package/array/proto/async-map.d.cts +24 -0
- package/array/proto/async-map.d.ts +0 -1
- package/array/proto/async-map.js +2 -2
- package/array/proto/async-map.js.map +1 -1
- package/array/proto/compact.cjs +6 -4
- package/array/proto/compact.cjs.map +1 -0
- package/array/proto/compact.d.cts +14 -0
- package/array/proto/compact.d.ts +0 -1
- package/array/proto/compact.js +2 -2
- package/array/proto/compact.js.map +1 -1
- package/array/proto/difference.cjs +6 -4
- package/array/proto/difference.cjs.map +1 -0
- package/array/proto/difference.d.cts +28 -0
- package/array/proto/difference.d.ts +2 -1
- package/array/proto/difference.js +2 -2
- package/array/proto/difference.js.map +1 -1
- package/array/proto/find-by-key.cjs +6 -4
- package/array/proto/find-by-key.cjs.map +1 -0
- package/array/proto/find-by-key.d.cts +24 -0
- package/array/proto/find-by-key.d.ts +0 -1
- package/array/proto/find-by-key.js +2 -2
- package/array/proto/find-by-key.js.map +1 -1
- package/array/proto/gather.cjs +6 -4
- package/array/proto/gather.cjs.map +1 -0
- package/array/proto/gather.d.cts +31 -0
- package/array/proto/gather.d.ts +0 -1
- package/array/proto/gather.js +2 -2
- package/array/proto/gather.js.map +1 -1
- package/array/proto/intersection.cjs +6 -4
- package/array/proto/intersection.cjs.map +1 -0
- package/array/proto/intersection.d.cts +28 -0
- package/array/proto/intersection.d.ts +2 -1
- package/array/proto/intersection.js +2 -2
- package/array/proto/intersection.js.map +1 -1
- package/array/proto/limit.cjs +6 -4
- package/array/proto/limit.cjs.map +1 -0
- package/array/proto/limit.d.cts +23 -0
- package/array/proto/limit.d.ts +0 -1
- package/array/proto/limit.js +2 -2
- package/array/proto/limit.js.map +1 -1
- package/array/proto/remove.cjs +6 -4
- package/array/proto/remove.cjs.map +1 -0
- package/array/proto/remove.d.cts +32 -0
- package/array/proto/remove.d.ts +3 -3
- package/array/proto/remove.js +2 -2
- package/array/proto/remove.js.map +1 -1
- package/array/proto/replace.cjs +6 -4
- package/array/proto/replace.cjs.map +1 -0
- package/array/proto/replace.d.cts +73 -0
- package/array/proto/replace.d.ts +2 -1
- package/array/proto/replace.js +2 -2
- package/array/proto/replace.js.map +1 -1
- package/array/proto/slice-after.cjs +8 -0
- package/array/proto/slice-after.cjs.map +1 -0
- package/array/proto/slice-after.d.cts +33 -0
- package/array/proto/slice-after.d.ts +33 -0
- package/array/proto/slice-after.js +6 -0
- package/array/proto/slice-after.js.map +1 -0
- package/array/proto/slice-before.cjs +8 -0
- package/array/proto/slice-before.cjs.map +1 -0
- package/array/proto/slice-before.d.cts +33 -0
- package/array/proto/slice-before.d.ts +33 -0
- package/array/proto/slice-before.js +6 -0
- package/array/proto/slice-before.js.map +1 -0
- package/array/proto/uniquify-by-key.cjs +6 -4
- package/array/proto/uniquify-by-key.cjs.map +1 -0
- package/array/proto/uniquify-by-key.d.cts +23 -0
- package/array/proto/uniquify-by-key.d.ts +0 -1
- package/array/proto/uniquify-by-key.js +2 -2
- package/array/proto/uniquify-by-key.js.map +1 -1
- package/array/proto/uniquify.cjs +6 -4
- package/array/proto/uniquify.cjs.map +1 -0
- package/array/proto/uniquify.d.cts +22 -0
- package/array/proto/uniquify.d.ts +0 -1
- package/array/proto/uniquify.js +2 -2
- package/array/proto/uniquify.js.map +1 -1
- package/array/remove.cjs +5 -3
- package/array/remove.cjs.map +1 -0
- package/array/remove.d.cts +35 -0
- package/array/remove.d.ts +3 -1
- package/array/remove.js +2 -1
- package/array/remove.js.map +1 -1
- package/array/replace.cjs +5 -3
- package/array/replace.cjs.map +1 -0
- package/array/replace.d.cts +142 -0
- package/array/replace.d.ts +8 -5
- package/array/replace.js +2 -1
- package/array/replace.js.map +1 -1
- package/array/slice-after.cjs +44 -0
- package/array/slice-after.cjs.map +1 -0
- package/array/slice-after.d.cts +35 -0
- package/array/slice-after.d.ts +35 -0
- package/array/slice-after.js +42 -0
- package/array/slice-after.js.map +1 -0
- package/array/slice-before.cjs +44 -0
- package/array/slice-before.cjs.map +1 -0
- package/array/slice-before.d.cts +35 -0
- package/array/slice-before.d.ts +35 -0
- package/array/slice-before.js +42 -0
- package/array/slice-before.js.map +1 -0
- package/array/static/arrayize.cjs +6 -4
- package/array/static/arrayize.cjs.map +1 -0
- package/array/static/arrayize.d.cts +7 -0
- package/array/static/arrayize.d.ts +2 -1
- package/array/static/arrayize.js +2 -2
- package/array/static/arrayize.js.map +1 -1
- package/array/uniquify-by-key.cjs +5 -3
- package/array/uniquify-by-key.cjs.map +1 -0
- package/array/uniquify-by-key.d.cts +31 -0
- package/array/uniquify-by-key.d.ts +3 -1
- package/array/uniquify-by-key.js +2 -1
- package/array/uniquify-by-key.js.map +1 -1
- package/array/uniquify.cjs +5 -3
- package/array/uniquify.cjs.map +1 -0
- package/array/uniquify.d.cts +29 -0
- package/array/uniquify.d.ts +3 -1
- package/array/uniquify.js +2 -1
- package/array/uniquify.js.map +1 -1
- package/boolean/static/is-falsy.cjs +6 -4
- package/boolean/static/is-falsy.cjs.map +1 -0
- package/boolean/static/is-falsy.d.cts +24 -0
- package/boolean/static/is-falsy.d.ts +2 -1
- package/boolean/static/is-falsy.js +2 -2
- package/boolean/static/is-falsy.js.map +1 -1
- package/boolean/static/is-truthy.cjs +6 -4
- package/boolean/static/is-truthy.cjs.map +1 -0
- package/boolean/static/is-truthy.d.cts +24 -0
- package/boolean/static/is-truthy.d.ts +2 -1
- package/boolean/static/is-truthy.js +2 -2
- package/boolean/static/is-truthy.js.map +1 -1
- package/class/index.cjs +8 -4
- package/class/index.cjs.map +1 -0
- package/class/index.d.cts +1 -0
- package/class/index.d.ts +1 -1
- package/class/index.js +1 -2
- package/class/index.js.map +1 -1
- package/class/mixin.cjs +6 -4
- package/class/mixin.cjs.map +1 -0
- package/class/mixin.d.cts +51 -0
- package/class/mixin.d.ts +3 -2
- package/class/mixin.js +3 -2
- package/class/mixin.js.map +1 -1
- package/compact.cjs +10 -7
- package/compact.cjs.map +1 -0
- package/compact.d.cts +4 -0
- package/compact.d.ts +4 -2
- package/compact.js +7 -5
- package/compact.js.map +1 -1
- package/fesm/js-utils.mjs +1817 -0
- package/fesm/js-utils.mjs.map +1 -0
- package/function/call.cjs +5 -3
- package/function/call.cjs.map +1 -0
- package/function/call.d.cts +3 -0
- package/function/call.d.ts +3 -1
- package/function/call.js +2 -1
- package/function/call.js.map +1 -1
- package/function/debounce.cjs +19 -16
- package/function/debounce.cjs.map +1 -0
- package/function/debounce.d.cts +47 -0
- package/function/debounce.d.ts +7 -4
- package/function/debounce.js +8 -6
- package/function/debounce.js.map +1 -1
- package/function/defer.cjs +8 -5
- package/function/defer.cjs.map +1 -0
- package/function/defer.d.cts +28 -0
- package/function/defer.d.ts +3 -1
- package/function/defer.js +4 -2
- package/function/defer.js.map +1 -1
- package/function/index.cjs +18 -8
- package/function/index.cjs.map +1 -0
- package/function/index.d.cts +5 -0
- package/function/index.d.ts +5 -5
- package/function/index.js +5 -6
- package/function/index.js.map +1 -1
- package/function/noop.cjs +5 -3
- package/function/noop.cjs.map +1 -0
- package/function/noop.d.cts +22 -0
- package/function/noop.d.ts +3 -1
- package/function/noop.js +2 -1
- package/function/noop.js.map +1 -1
- package/function/of.cjs +8 -5
- package/function/of.cjs.map +1 -0
- package/function/of.d.cts +33 -0
- package/function/of.d.ts +3 -1
- package/function/of.js +4 -2
- package/function/of.js.map +1 -1
- package/function/proto/debounce.cjs +7 -5
- package/function/proto/debounce.cjs.map +1 -0
- package/function/proto/debounce.d.cts +29 -0
- package/function/proto/debounce.d.ts +0 -1
- package/function/proto/debounce.js +2 -2
- package/function/proto/debounce.js.map +1 -1
- package/function/static/call.cjs +6 -4
- package/function/static/call.cjs.map +1 -0
- package/function/static/call.d.cts +7 -0
- package/function/static/call.d.ts +2 -1
- package/function/static/call.js +2 -2
- package/function/static/call.js.map +1 -1
- package/function/static/defer.cjs +6 -4
- package/function/static/defer.cjs.map +1 -0
- package/function/static/defer.d.cts +24 -0
- package/function/static/defer.d.ts +2 -1
- package/function/static/defer.js +2 -2
- package/function/static/defer.js.map +1 -1
- package/function/static/noop.cjs +6 -4
- package/function/static/noop.cjs.map +1 -0
- package/function/static/noop.d.cts +19 -0
- package/function/static/noop.d.ts +2 -1
- package/function/static/noop.js +2 -2
- package/function/static/noop.js.map +1 -1
- package/function/static/of.cjs +6 -4
- package/function/static/of.cjs.map +1 -0
- package/function/static/of.d.cts +27 -0
- package/function/static/of.d.ts +2 -1
- package/function/static/of.js +2 -2
- package/function/static/of.js.map +1 -1
- package/index.cjs +95 -34
- package/index.cjs.map +1 -0
- package/index.d.cts +44 -0
- package/index.d.ts +44 -15
- package/index.js +43 -17
- package/index.js.map +1 -1
- package/is-falsy.cjs +5 -3
- package/is-falsy.cjs.map +1 -0
- package/is-falsy.d.cts +30 -0
- package/is-falsy.d.ts +3 -1
- package/is-falsy.js +2 -1
- package/is-falsy.js.map +1 -1
- package/is-truthy.cjs +5 -3
- package/is-truthy.cjs.map +1 -0
- package/is-truthy.d.cts +30 -0
- package/is-truthy.d.ts +3 -1
- package/is-truthy.js +2 -1
- package/is-truthy.js.map +1 -1
- package/limit.cjs +10 -7
- package/limit.cjs.map +1 -0
- package/limit.d.cts +4 -0
- package/limit.d.ts +4 -2
- package/limit.js +7 -5
- package/limit.js.map +1 -1
- package/map/index.cjs +8 -4
- package/map/index.cjs.map +1 -0
- package/map/index.d.cts +1 -0
- package/map/index.d.ts +1 -1
- package/map/index.js +1 -2
- package/map/index.js.map +1 -1
- package/map/merge.cjs +5 -3
- package/map/merge.cjs.map +1 -0
- package/map/merge.d.cts +26 -0
- package/map/merge.d.ts +3 -1
- package/map/merge.js +2 -1
- package/map/merge.js.map +1 -1
- package/math/index.cjs +8 -4
- package/math/index.cjs.map +1 -0
- package/math/index.d.cts +1 -0
- package/math/index.d.ts +1 -1
- package/math/index.js +1 -2
- package/math/index.js.map +1 -1
- package/math/min-max.cjs +5 -3
- package/math/min-max.cjs.map +1 -0
- package/math/min-max.d.cts +26 -0
- package/math/min-max.d.ts +3 -1
- package/math/min-max.js +2 -1
- package/math/min-max.js.map +1 -1
- package/math/static/min-max.cjs +6 -4
- package/math/static/min-max.cjs.map +1 -0
- package/math/static/min-max.d.cts +21 -0
- package/math/static/min-max.d.ts +2 -1
- package/math/static/min-max.js +2 -2
- package/math/static/min-max.js.map +1 -1
- package/object/clone.cjs +14 -11
- package/object/clone.cjs.map +1 -0
- package/object/clone.d.cts +164 -0
- package/object/clone.d.ts +9 -6
- package/object/clone.js +6 -4
- package/object/clone.js.map +1 -1
- package/object/compact.cjs +5 -3
- package/object/compact.cjs.map +1 -0
- package/object/compact.d.cts +39 -0
- package/object/compact.d.ts +3 -1
- package/object/compact.js +2 -1
- package/object/compact.js.map +1 -1
- package/object/deep-freeze.cjs +5 -3
- package/object/deep-freeze.cjs.map +1 -0
- package/object/deep-freeze.d.cts +3 -0
- package/object/deep-freeze.d.ts +3 -1
- package/object/deep-freeze.js +2 -1
- package/object/deep-freeze.js.map +1 -1
- package/object/deepest.cjs +5 -3
- package/object/deepest.cjs.map +1 -0
- package/object/deepest.d.cts +50 -0
- package/object/deepest.d.ts +5 -2
- package/object/deepest.js +2 -1
- package/object/deepest.js.map +1 -1
- package/object/index.cjs +16 -8
- package/object/index.cjs.map +1 -0
- package/object/index.d.cts +6 -0
- package/object/index.d.ts +6 -5
- package/object/index.js +5 -6
- package/object/index.js.map +1 -1
- package/object/map.cjs +5 -3
- package/object/map.cjs.map +1 -0
- package/object/map.d.cts +34 -0
- package/object/map.d.ts +3 -1
- package/object/map.js +2 -1
- package/object/map.js.map +1 -1
- package/object/static/clone.cjs +6 -4
- package/object/static/clone.cjs.map +1 -0
- package/object/static/clone.d.cts +44 -0
- package/object/static/clone.d.ts +2 -1
- package/object/static/clone.js +2 -2
- package/object/static/clone.js.map +1 -1
- package/object/static/compact.cjs +6 -4
- package/object/static/compact.cjs.map +1 -0
- package/object/static/compact.d.cts +27 -0
- package/object/static/compact.d.ts +2 -1
- package/object/static/compact.js +2 -2
- package/object/static/compact.js.map +1 -1
- package/object/static/deep-freeze.cjs +6 -4
- package/object/static/deep-freeze.cjs.map +1 -0
- package/object/static/deep-freeze.d.cts +7 -0
- package/object/static/deep-freeze.d.ts +2 -1
- package/object/static/deep-freeze.js +2 -2
- package/object/static/deep-freeze.js.map +1 -1
- package/object/static/deepest.cjs +6 -4
- package/object/static/deepest.cjs.map +1 -0
- package/object/static/deepest.d.cts +34 -0
- package/object/static/deepest.d.ts +3 -1
- package/object/static/deepest.js +2 -2
- package/object/static/deepest.js.map +1 -1
- package/object/static/map.cjs +6 -4
- package/object/static/map.cjs.map +1 -0
- package/object/static/map.d.cts +27 -0
- package/object/static/map.d.ts +2 -1
- package/object/static/map.js +2 -2
- package/object/static/map.js.map +1 -1
- package/open-promise.cjs +13 -11
- package/open-promise.cjs.map +1 -0
- package/open-promise.d.cts +82 -0
- package/open-promise.d.ts +5 -3
- package/open-promise.js +4 -2
- package/open-promise.js.map +1 -1
- package/package.json +817 -412
- package/promise/chain.cjs +5 -3
- package/promise/chain.cjs.map +1 -0
- package/promise/chain.d.cts +9 -0
- package/promise/chain.d.ts +3 -1
- package/promise/chain.js +2 -1
- package/promise/chain.js.map +1 -1
- package/promise/index.cjs +21 -10
- package/promise/index.cjs.map +1 -0
- package/promise/index.d.cts +7 -0
- package/promise/index.d.ts +7 -7
- package/promise/index.js +7 -8
- package/promise/index.js.map +1 -1
- package/promise/never.cjs +10 -7
- package/promise/never.cjs.map +1 -0
- package/promise/never.d.cts +36 -0
- package/promise/never.d.ts +4 -2
- package/promise/never.js +5 -3
- package/promise/never.js.map +1 -1
- package/promise/promisify.cjs +5 -3
- package/promise/promisify.cjs.map +1 -0
- package/promise/promisify.d.cts +9 -0
- package/promise/promisify.d.ts +3 -1
- package/promise/promisify.js +2 -1
- package/promise/promisify.js.map +1 -1
- package/promise/proto/revert.cjs +6 -4
- package/promise/proto/revert.cjs.map +1 -0
- package/promise/proto/revert.d.cts +28 -0
- package/promise/proto/revert.d.ts +0 -1
- package/promise/proto/revert.js +2 -2
- package/promise/proto/revert.js.map +1 -1
- package/promise/proto/try-catch.cjs +6 -4
- package/promise/proto/try-catch.cjs.map +1 -0
- package/promise/proto/try-catch.d.cts +29 -0
- package/promise/proto/try-catch.d.ts +0 -1
- package/promise/proto/try-catch.js +2 -2
- package/promise/proto/try-catch.js.map +1 -1
- package/promise/revert.cjs +5 -3
- package/promise/revert.cjs.map +1 -0
- package/promise/revert.d.cts +40 -0
- package/promise/revert.d.ts +3 -1
- package/promise/revert.js +2 -1
- package/promise/revert.js.map +1 -1
- package/promise/static/chain.cjs +6 -4
- package/promise/static/chain.cjs.map +1 -0
- package/promise/static/chain.d.cts +11 -0
- package/promise/static/chain.d.ts +2 -1
- package/promise/static/chain.js +2 -2
- package/promise/static/chain.js.map +1 -1
- package/promise/static/never.cjs +7 -5
- package/promise/static/never.cjs.map +1 -0
- package/promise/static/never.d.cts +40 -0
- package/promise/static/never.d.ts +2 -1
- package/promise/static/never.js +2 -2
- package/promise/static/never.js.map +1 -1
- package/promise/static/timeout.cjs +6 -4
- package/promise/static/timeout.cjs.map +1 -0
- package/promise/static/timeout.d.cts +22 -0
- package/promise/static/timeout.d.ts +2 -1
- package/promise/static/timeout.js +2 -2
- package/promise/static/timeout.js.map +1 -1
- package/promise/static/try-one-by-one.cjs +6 -4
- package/promise/static/try-one-by-one.cjs.map +1 -0
- package/promise/static/try-one-by-one.d.cts +28 -0
- package/promise/static/try-one-by-one.d.ts +2 -1
- package/promise/static/try-one-by-one.js +2 -2
- package/promise/static/try-one-by-one.js.map +1 -1
- package/promise/timeout.cjs +13 -11
- package/promise/timeout.cjs.map +1 -0
- package/promise/timeout.d.cts +112 -0
- package/promise/timeout.d.ts +5 -2
- package/promise/timeout.js +4 -3
- package/promise/timeout.js.map +1 -1
- package/promise/try-catch.cjs +5 -3
- package/promise/try-catch.cjs.map +1 -0
- package/promise/try-catch.d.cts +47 -0
- package/promise/try-catch.d.ts +4 -2
- package/promise/try-catch.js +2 -1
- package/promise/try-catch.js.map +1 -1
- package/promise/try-one-by-one.cjs +5 -3
- package/promise/try-one-by-one.cjs.map +1 -0
- package/promise/try-one-by-one.d.cts +44 -0
- package/promise/try-one-by-one.d.ts +3 -1
- package/promise/try-one-by-one.js +2 -1
- package/promise/try-one-by-one.js.map +1 -1
- package/set/proto/difference.cjs +6 -4
- package/set/proto/difference.cjs.map +1 -0
- package/set/proto/difference.d.cts +27 -0
- package/set/proto/difference.d.ts +2 -1
- package/set/proto/difference.js +2 -2
- package/set/proto/difference.js.map +1 -1
- package/set/proto/intersection.cjs +6 -4
- package/set/proto/intersection.cjs.map +1 -0
- package/set/proto/intersection.d.cts +27 -0
- package/set/proto/intersection.d.ts +2 -1
- package/set/proto/intersection.js +2 -2
- package/set/proto/intersection.js.map +1 -1
- package/smart-map.cjs +4 -3
- package/smart-map.cjs.map +1 -0
- package/smart-map.d.cts +82 -0
- package/smart-map.d.ts +3 -2
- package/smart-map.js +2 -1
- package/smart-map.js.map +1 -1
- package/string/index.cjs +8 -4
- package/string/index.cjs.map +1 -0
- package/string/index.d.cts +1 -0
- package/string/index.d.ts +1 -1
- package/string/index.js +1 -2
- package/string/index.js.map +1 -1
- package/string/limit.cjs +8 -5
- package/string/limit.cjs.map +1 -0
- package/string/limit.d.cts +31 -0
- package/string/limit.d.ts +3 -1
- package/string/limit.js +5 -3
- package/string/limit.js.map +1 -1
- package/string/proto/limit.cjs +6 -4
- package/string/proto/limit.cjs.map +1 -0
- package/string/proto/limit.d.cts +30 -0
- package/string/proto/limit.d.ts +3 -3
- package/string/proto/limit.js +2 -2
- package/string/proto/limit.js.map +1 -1
- package/time/days.cjs +8 -5
- package/time/days.cjs.map +1 -0
- package/time/days.d.cts +17 -0
- package/time/days.d.ts +3 -1
- package/time/days.js +4 -2
- package/time/days.js.map +1 -1
- package/time/hours.cjs +8 -5
- package/time/hours.cjs.map +1 -0
- package/time/hours.d.cts +17 -0
- package/time/hours.d.ts +3 -1
- package/time/hours.js +4 -2
- package/time/hours.js.map +1 -1
- package/time/index.cjs +20 -10
- package/time/index.cjs.map +1 -0
- package/time/index.d.cts +7 -0
- package/time/index.d.ts +7 -7
- package/time/index.js +7 -8
- package/time/index.js.map +1 -1
- package/time/minutes.cjs +8 -5
- package/time/minutes.cjs.map +1 -0
- package/time/minutes.d.cts +17 -0
- package/time/minutes.d.ts +3 -1
- package/time/minutes.js +4 -2
- package/time/minutes.js.map +1 -1
- package/time/months.cjs +8 -5
- package/time/months.cjs.map +1 -0
- package/time/months.d.cts +17 -0
- package/time/months.d.ts +3 -1
- package/time/months.js +4 -2
- package/time/months.js.map +1 -1
- package/time/seconds.cjs +5 -3
- package/time/seconds.cjs.map +1 -0
- package/time/seconds.d.cts +17 -0
- package/time/seconds.d.ts +3 -1
- package/time/seconds.js +2 -1
- package/time/seconds.js.map +1 -1
- package/time/weeks.cjs +8 -5
- package/time/weeks.cjs.map +1 -0
- package/time/weeks.d.cts +17 -0
- package/time/weeks.d.ts +3 -1
- package/time/weeks.js +4 -2
- package/time/weeks.js.map +1 -1
- package/time/years.cjs +8 -5
- package/time/years.cjs.map +1 -0
- package/time/years.d.cts +17 -0
- package/time/years.d.ts +3 -1
- package/time/years.js +4 -2
- package/time/years.js.map +1 -1
- package/unique-id.cjs +5 -3
- package/unique-id.cjs.map +1 -0
- package/unique-id.d.cts +23 -0
- package/unique-id.d.ts +4 -2
- package/unique-id.js +2 -1
- package/unique-id.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../libs/js-utils/src/array/proto/gather.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"gather.js","sources":["../../../../../libs/js-utils/src/array/proto/gather.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAkCA,KAAK,CAAC,SAAS,CAAC,MAAM,GAAG,UAAmE,GAAM,EAAA;AAChG,IAAA,OAAO,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC;AAC1B,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var array_intersection = require('../intersection.cjs');
|
|
4
|
+
|
|
4
5
|
Array.prototype.intersection = function (inclusion, allEquals = true) {
|
|
5
|
-
return
|
|
6
|
+
return array_intersection.intersection(this, inclusion, allEquals);
|
|
6
7
|
};
|
|
8
|
+
//# sourceMappingURL=intersection.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intersection.cjs","sources":["../../../../../libs/js-utils/src/array/proto/intersection.ts"],"sourcesContent":[null],"names":["intersection"],"mappings":";;;;AA6BA,KAAK,CAAC,SAAS,CAAC,YAAY,GAAG,UAAS,SAAoB,EAAE,SAAS,GAAG,IAAI,EAAA;IAC5E,OAAOA,+BAAY,CAAC,IAAI,EAAE,SAAS,EAAE,SAAS,CAAC;AACjD,CAAC;;"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Inclusion } from '../intersection.cjs';
|
|
2
|
+
|
|
3
|
+
declare global {
|
|
4
|
+
export interface Array<T> {
|
|
5
|
+
/**
|
|
6
|
+
* #### Intersection
|
|
7
|
+
*
|
|
8
|
+
* Gets the intersection of the two arrays or sets
|
|
9
|
+
*
|
|
10
|
+
* * * *
|
|
11
|
+
* Example:
|
|
12
|
+
* ```typescript
|
|
13
|
+
* import "@telperion/js-utils/array/proto/intersection";
|
|
14
|
+
*
|
|
15
|
+
* const base = ["a", "b", "c", "d", "a", "b", "c", "d"];
|
|
16
|
+
*
|
|
17
|
+
* base.intersection(["a", "b"]); // ["a", "b", "a", "b"]
|
|
18
|
+
* base.intersection(["a", "b"], false); // ["a", "b"]
|
|
19
|
+
* ```
|
|
20
|
+
* * * *
|
|
21
|
+
* @param base Base Set or Array
|
|
22
|
+
* @param inclusion Set or Array to include its values
|
|
23
|
+
* @param allEquals By default all the same items encountered in the inclusion will be included, set this argument as false to get real intersection
|
|
24
|
+
* @returns Intersection of base and inclusion
|
|
25
|
+
*/
|
|
26
|
+
intersection(inclusion: Inclusion, allEquals?: boolean): T[];
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { intersection } from '
|
|
1
|
+
import { intersection } from '../intersection.js';
|
|
2
|
+
|
|
2
3
|
Array.prototype.intersection = function (inclusion, allEquals = true) {
|
|
3
4
|
return intersection(this, inclusion, allEquals);
|
|
4
5
|
};
|
|
5
|
-
|
|
6
6
|
//# sourceMappingURL=intersection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../libs/js-utils/src/array/proto/intersection.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"intersection.js","sources":["../../../../../libs/js-utils/src/array/proto/intersection.ts"],"sourcesContent":[null],"names":[],"mappings":";;AA6BA,KAAK,CAAC,SAAS,CAAC,YAAY,GAAG,UAAS,SAAoB,EAAE,SAAS,GAAG,IAAI,EAAA;IAC5E,OAAO,YAAY,CAAC,IAAI,EAAE,SAAS,EAAE,SAAS,CAAC;AACjD,CAAC"}
|
package/array/proto/limit.cjs
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var array_limit = require('../limit.cjs');
|
|
4
|
+
|
|
4
5
|
Array.prototype.limit = function (count) {
|
|
5
|
-
return
|
|
6
|
+
return array_limit.limit(this, count);
|
|
6
7
|
};
|
|
8
|
+
//# sourceMappingURL=limit.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"limit.cjs","sources":["../../../../../libs/js-utils/src/array/proto/limit.ts"],"sourcesContent":[null],"names":["limit"],"mappings":";;;;AA0BA,KAAK,CAAC,SAAS,CAAC,KAAK,GAAG,UAAS,KAAa,EAAA;AAC5C,IAAA,OAAOA,iBAAK,CAAC,IAAI,EAAE,KAAK,CAAC;AAC3B,CAAC;;"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
export interface Array<T> {
|
|
3
|
+
/**
|
|
4
|
+
* #### Limit
|
|
5
|
+
*
|
|
6
|
+
* Returns first `n` children of an array
|
|
7
|
+
*
|
|
8
|
+
* * * *
|
|
9
|
+
* Example:
|
|
10
|
+
* ```typescript
|
|
11
|
+
* import "@telperion/js-utils/array/proto/limit";
|
|
12
|
+
*
|
|
13
|
+
* const array = ["a", "b", "c", "d", "e", "f"];
|
|
14
|
+
*
|
|
15
|
+
* array.limit(3); // ["a", "b", "c"]
|
|
16
|
+
* ```
|
|
17
|
+
* * * *
|
|
18
|
+
* @param count Limiter
|
|
19
|
+
* @return New array
|
|
20
|
+
*/
|
|
21
|
+
limit(count: number): T[];
|
|
22
|
+
}
|
|
23
|
+
}
|
package/array/proto/limit.d.ts
CHANGED
package/array/proto/limit.js
CHANGED
package/array/proto/limit.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../libs/js-utils/src/array/proto/limit.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"limit.js","sources":["../../../../../libs/js-utils/src/array/proto/limit.ts"],"sourcesContent":[null],"names":[],"mappings":";;AA0BA,KAAK,CAAC,SAAS,CAAC,KAAK,GAAG,UAAS,KAAa,EAAA;AAC5C,IAAA,OAAO,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC;AAC3B,CAAC"}
|
package/array/proto/remove.cjs
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var array_remove = require('../remove.cjs');
|
|
4
|
+
|
|
4
5
|
Array.prototype.remove = function (...args) {
|
|
5
|
-
return
|
|
6
|
+
return array_remove.remove(this, ...args);
|
|
6
7
|
};
|
|
8
|
+
//# sourceMappingURL=remove.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remove.cjs","sources":["../../../../../libs/js-utils/src/array/proto/remove.ts"],"sourcesContent":[null],"names":["remove"],"mappings":";;;;AAmCA,KAAK,CAAC,SAAS,CAAC,MAAM,GAAG,UAAuB,GAAG,IAAkB,EAAA;AACnE,IAAA,OAAOA,mBAAM,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC;AAC9B,CAAC;;"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Tail } from '@telperion/extra-ts-types';
|
|
2
|
+
import { remove } from '../remove.cjs';
|
|
3
|
+
|
|
4
|
+
type FuncType<T> = typeof remove<T>;
|
|
5
|
+
type FuncArgs<T> = Parameters<FuncType<T>>;
|
|
6
|
+
type FuncReturn<T> = ReturnType<FuncType<T>>;
|
|
7
|
+
type ProtoArgs<T> = Tail<FuncArgs<T>>;
|
|
8
|
+
declare global {
|
|
9
|
+
export interface Array<T> {
|
|
10
|
+
/**
|
|
11
|
+
* #### Remove
|
|
12
|
+
*
|
|
13
|
+
* Removes an item from the array
|
|
14
|
+
*
|
|
15
|
+
* Removes all item references if multi is set to `true`
|
|
16
|
+
*
|
|
17
|
+
* * * *
|
|
18
|
+
* Example:
|
|
19
|
+
* ```typescript
|
|
20
|
+
* import "@telperion/js-utils/array/proto/remove";
|
|
21
|
+
*
|
|
22
|
+
* const array = ["a", "b", "c", "a", "b", "c"];
|
|
23
|
+
*
|
|
24
|
+
* array.remove("b", true); // ["a", "c", "a", "c"]
|
|
25
|
+
* ```
|
|
26
|
+
* * * *
|
|
27
|
+
* @param itemToRemove Item to remove
|
|
28
|
+
* @return New array
|
|
29
|
+
*/
|
|
30
|
+
remove(...args: ProtoArgs<T>): FuncReturn<T>;
|
|
31
|
+
}
|
|
32
|
+
}
|
package/array/proto/remove.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { remove } from '
|
|
1
|
+
import { Tail } from '@telperion/extra-ts-types';
|
|
2
|
+
import { remove } from '../remove.js';
|
|
3
|
+
|
|
3
4
|
type FuncType<T> = typeof remove<T>;
|
|
4
5
|
type FuncArgs<T> = Parameters<FuncType<T>>;
|
|
5
6
|
type FuncReturn<T> = ReturnType<FuncType<T>>;
|
|
@@ -29,4 +30,3 @@ declare global {
|
|
|
29
30
|
remove(...args: ProtoArgs<T>): FuncReturn<T>;
|
|
30
31
|
}
|
|
31
32
|
}
|
|
32
|
-
export {};
|
package/array/proto/remove.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../libs/js-utils/src/array/proto/remove.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"remove.js","sources":["../../../../../libs/js-utils/src/array/proto/remove.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAmCA,KAAK,CAAC,SAAS,CAAC,MAAM,GAAG,UAAuB,GAAG,IAAkB,EAAA;AACnE,IAAA,OAAO,MAAM,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC;AAC9B,CAAC"}
|
package/array/proto/replace.cjs
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var array_replace = require('../replace.cjs');
|
|
4
|
+
|
|
4
5
|
Array.prototype.replace = function (...args) {
|
|
5
|
-
return
|
|
6
|
+
return array_replace.replace(this, ...args);
|
|
6
7
|
};
|
|
8
|
+
//# sourceMappingURL=replace.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replace.cjs","sources":["../../../../../libs/js-utils/src/array/proto/replace.ts"],"sourcesContent":[null],"names":["replace"],"mappings":";;;;AA8EA,KAAK,CAAC,SAAS,CAAC,OAAO,GAA0B,UAAuB,GAAG,IAAyC,EAAA;AAClH,IAAA,OAAOA,qBAAO,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC;AAC/B,CAAC;;"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { ReplaceItemsOptions, ReplaceByMapOptions } from '../replace.cjs';
|
|
2
|
+
|
|
3
|
+
declare global {
|
|
4
|
+
export interface Array<T> {
|
|
5
|
+
/**
|
|
6
|
+
* #### Replace
|
|
7
|
+
*
|
|
8
|
+
* Replaces an item with passed one of an array
|
|
9
|
+
*
|
|
10
|
+
* * * *
|
|
11
|
+
* Example:
|
|
12
|
+
* ```typescript
|
|
13
|
+
* import "@telperion/js-utils/array/proto/replace";
|
|
14
|
+
*
|
|
15
|
+
* const array = ["a", "b", "c", "a", "b", "c"];
|
|
16
|
+
*
|
|
17
|
+
* array.replace("b", "x"); // ["a", "x", "c", "a", "b", "c"]
|
|
18
|
+
* ```
|
|
19
|
+
* * * *
|
|
20
|
+
* @param array Array to replace its item
|
|
21
|
+
* @param itemToRemove Item to remove
|
|
22
|
+
* @param itemToReplace Item to replace with
|
|
23
|
+
* @return New replaced array
|
|
24
|
+
*/
|
|
25
|
+
replace(itemToRemove: T, itemToReplace: T): T[];
|
|
26
|
+
/**
|
|
27
|
+
* #### Replace
|
|
28
|
+
*
|
|
29
|
+
* Deletes items and replaces new ones from passed starting index of an array
|
|
30
|
+
*
|
|
31
|
+
* * * *
|
|
32
|
+
* Example:
|
|
33
|
+
* ```typescript
|
|
34
|
+
* import "@telperion/js-utils/array/proto/replace";
|
|
35
|
+
*
|
|
36
|
+
* const array = ["a", "b", "c", "a", "b", "c"];
|
|
37
|
+
*
|
|
38
|
+
* array.replace({startingIndex: 3, deleteCount: 1, itemsToReplace: ['x', 'y']}); // ["a", "b", "c", "x", "y", "b", "c"];
|
|
39
|
+
* ```
|
|
40
|
+
* * * *
|
|
41
|
+
* @param array Array to replace its item
|
|
42
|
+
* @param replaceOptions Replace options
|
|
43
|
+
* @template T Typeof array items
|
|
44
|
+
* @return New replaced array
|
|
45
|
+
*/
|
|
46
|
+
replace(replaceOptions: ReplaceItemsOptions<T>): T[];
|
|
47
|
+
/**
|
|
48
|
+
* #### Replace
|
|
49
|
+
*
|
|
50
|
+
* Deletes items and replaces new ones by passed matcher map
|
|
51
|
+
*
|
|
52
|
+
* * * *
|
|
53
|
+
* Example:
|
|
54
|
+
* ```typescript
|
|
55
|
+
* import "@telperion/js-utils/array/proto/replace";
|
|
56
|
+
*
|
|
57
|
+
* const array = ["a", "b", "c", "a", "b", "c"];
|
|
58
|
+
* const map = new Map();
|
|
59
|
+
* map.set("a", "x")
|
|
60
|
+
* map.set("b", "y");
|
|
61
|
+
*
|
|
62
|
+
* array.replace({itemsToReplace: map}); // ["x", "y", "c", "a", "b", "c"];
|
|
63
|
+
* array.replace({itemsToReplace: map, multi: true}); // ["x", "y", "c", "x", "y", "c"];
|
|
64
|
+
* ```
|
|
65
|
+
* * * *
|
|
66
|
+
* @param array Array to replace its item
|
|
67
|
+
* @param replaceOptions Replace options
|
|
68
|
+
* @template T Typeof array items
|
|
69
|
+
* @return New replaced array
|
|
70
|
+
*/
|
|
71
|
+
replace(replaceOptions: ReplaceByMapOptions<T>): T[];
|
|
72
|
+
}
|
|
73
|
+
}
|
package/array/proto/replace.d.ts
CHANGED
package/array/proto/replace.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../libs/js-utils/src/array/proto/replace.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"replace.js","sources":["../../../../../libs/js-utils/src/array/proto/replace.ts"],"sourcesContent":[null],"names":[],"mappings":";;AA8EA,KAAK,CAAC,SAAS,CAAC,OAAO,GAA0B,UAAuB,GAAG,IAAyC,EAAA;AAClH,IAAA,OAAO,OAAO,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC;AAC/B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slice-after.cjs","sources":["../../../../../libs/js-utils/src/array/proto/slice-after.ts"],"sourcesContent":[null],"names":["sliceAfter"],"mappings":";;;;AAoCA,KAAK,CAAC,SAAS,CAAC,UAAU,GAAG,UAAuB,GAAG,IAAkB,EAAA;AACvE,IAAA,OAAOA,2BAAU,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC;AAClC,CAAC;;"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Tail } from '@telperion/extra-ts-types';
|
|
2
|
+
import { sliceAfter } from '../slice-after.cjs';
|
|
3
|
+
|
|
4
|
+
type FuncType<T> = typeof sliceAfter<T>;
|
|
5
|
+
type FuncArgs<T> = Parameters<FuncType<T>>;
|
|
6
|
+
type FuncReturn<T> = ReturnType<FuncType<T>>;
|
|
7
|
+
type ProtoArgs<T> = Tail<FuncArgs<T>>;
|
|
8
|
+
declare global {
|
|
9
|
+
export interface Array<T> {
|
|
10
|
+
/**
|
|
11
|
+
* #### Slice After
|
|
12
|
+
*
|
|
13
|
+
* Returns a new array containing the items located after the first occurrence
|
|
14
|
+
* of the given item.
|
|
15
|
+
*
|
|
16
|
+
* If the item is not found, an empty array is returned.
|
|
17
|
+
*
|
|
18
|
+
* * * *
|
|
19
|
+
* Example:
|
|
20
|
+
* ```typescript
|
|
21
|
+
* import "@telperion/js-utils/array/proto/slice-after";
|
|
22
|
+
*
|
|
23
|
+
* const fruits = ["apple", "grapes", "banana", "melon", "orange"];
|
|
24
|
+
*
|
|
25
|
+
* fruits.sliceAfter("banana"); // ["melon", "orange"]
|
|
26
|
+
* ```
|
|
27
|
+
* * * *
|
|
28
|
+
* @param item Item to slice after
|
|
29
|
+
* @return New array containing the items after the given item
|
|
30
|
+
*/
|
|
31
|
+
sliceAfter(...args: ProtoArgs<T>): FuncReturn<T>;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Tail } from '@telperion/extra-ts-types';
|
|
2
|
+
import { sliceAfter } from '../slice-after.js';
|
|
3
|
+
|
|
4
|
+
type FuncType<T> = typeof sliceAfter<T>;
|
|
5
|
+
type FuncArgs<T> = Parameters<FuncType<T>>;
|
|
6
|
+
type FuncReturn<T> = ReturnType<FuncType<T>>;
|
|
7
|
+
type ProtoArgs<T> = Tail<FuncArgs<T>>;
|
|
8
|
+
declare global {
|
|
9
|
+
export interface Array<T> {
|
|
10
|
+
/**
|
|
11
|
+
* #### Slice After
|
|
12
|
+
*
|
|
13
|
+
* Returns a new array containing the items located after the first occurrence
|
|
14
|
+
* of the given item.
|
|
15
|
+
*
|
|
16
|
+
* If the item is not found, an empty array is returned.
|
|
17
|
+
*
|
|
18
|
+
* * * *
|
|
19
|
+
* Example:
|
|
20
|
+
* ```typescript
|
|
21
|
+
* import "@telperion/js-utils/array/proto/slice-after";
|
|
22
|
+
*
|
|
23
|
+
* const fruits = ["apple", "grapes", "banana", "melon", "orange"];
|
|
24
|
+
*
|
|
25
|
+
* fruits.sliceAfter("banana"); // ["melon", "orange"]
|
|
26
|
+
* ```
|
|
27
|
+
* * * *
|
|
28
|
+
* @param item Item to slice after
|
|
29
|
+
* @return New array containing the items after the given item
|
|
30
|
+
*/
|
|
31
|
+
sliceAfter(...args: ProtoArgs<T>): FuncReturn<T>;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slice-after.js","sources":["../../../../../libs/js-utils/src/array/proto/slice-after.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAoCA,KAAK,CAAC,SAAS,CAAC,UAAU,GAAG,UAAuB,GAAG,IAAkB,EAAA;AACvE,IAAA,OAAO,UAAU,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC;AAClC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slice-before.cjs","sources":["../../../../../libs/js-utils/src/array/proto/slice-before.ts"],"sourcesContent":[null],"names":["sliceBefore"],"mappings":";;;;AAoCA,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,UAAuB,GAAG,IAAkB,EAAA;AACxE,IAAA,OAAOA,6BAAW,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC;AACnC,CAAC;;"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Tail } from '@telperion/extra-ts-types';
|
|
2
|
+
import { sliceBefore } from '../slice-before.cjs';
|
|
3
|
+
|
|
4
|
+
type FuncType<T> = typeof sliceBefore<T>;
|
|
5
|
+
type FuncArgs<T> = Parameters<FuncType<T>>;
|
|
6
|
+
type FuncReturn<T> = ReturnType<FuncType<T>>;
|
|
7
|
+
type ProtoArgs<T> = Tail<FuncArgs<T>>;
|
|
8
|
+
declare global {
|
|
9
|
+
export interface Array<T> {
|
|
10
|
+
/**
|
|
11
|
+
* #### Slice Before
|
|
12
|
+
*
|
|
13
|
+
* Returns a new array containing the items located before the first occurrence
|
|
14
|
+
* of the given item.
|
|
15
|
+
*
|
|
16
|
+
* If the item is not found, an empty array is returned.
|
|
17
|
+
*
|
|
18
|
+
* * * *
|
|
19
|
+
* Example:
|
|
20
|
+
* ```typescript
|
|
21
|
+
* import "@telperion/js-utils/array/proto/slice-before";
|
|
22
|
+
*
|
|
23
|
+
* const fruits = ["apple", "grapes", "banana", "melon", "orange"];
|
|
24
|
+
*
|
|
25
|
+
* fruits.sliceBefore("melon"); // ["apple", "grapes", "banana"]
|
|
26
|
+
* ```
|
|
27
|
+
* * * *
|
|
28
|
+
* @param item Item to slice before
|
|
29
|
+
* @return New array containing the items before the given item
|
|
30
|
+
*/
|
|
31
|
+
sliceBefore(...args: ProtoArgs<T>): FuncReturn<T>;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Tail } from '@telperion/extra-ts-types';
|
|
2
|
+
import { sliceBefore } from '../slice-before.js';
|
|
3
|
+
|
|
4
|
+
type FuncType<T> = typeof sliceBefore<T>;
|
|
5
|
+
type FuncArgs<T> = Parameters<FuncType<T>>;
|
|
6
|
+
type FuncReturn<T> = ReturnType<FuncType<T>>;
|
|
7
|
+
type ProtoArgs<T> = Tail<FuncArgs<T>>;
|
|
8
|
+
declare global {
|
|
9
|
+
export interface Array<T> {
|
|
10
|
+
/**
|
|
11
|
+
* #### Slice Before
|
|
12
|
+
*
|
|
13
|
+
* Returns a new array containing the items located before the first occurrence
|
|
14
|
+
* of the given item.
|
|
15
|
+
*
|
|
16
|
+
* If the item is not found, an empty array is returned.
|
|
17
|
+
*
|
|
18
|
+
* * * *
|
|
19
|
+
* Example:
|
|
20
|
+
* ```typescript
|
|
21
|
+
* import "@telperion/js-utils/array/proto/slice-before";
|
|
22
|
+
*
|
|
23
|
+
* const fruits = ["apple", "grapes", "banana", "melon", "orange"];
|
|
24
|
+
*
|
|
25
|
+
* fruits.sliceBefore("melon"); // ["apple", "grapes", "banana"]
|
|
26
|
+
* ```
|
|
27
|
+
* * * *
|
|
28
|
+
* @param item Item to slice before
|
|
29
|
+
* @return New array containing the items before the given item
|
|
30
|
+
*/
|
|
31
|
+
sliceBefore(...args: ProtoArgs<T>): FuncReturn<T>;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slice-before.js","sources":["../../../../../libs/js-utils/src/array/proto/slice-before.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAoCA,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,UAAuB,GAAG,IAAkB,EAAA;AACxE,IAAA,OAAO,WAAW,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC;AACnC,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var array_uniquifyByKey = require('../uniquify-by-key.cjs');
|
|
4
|
+
|
|
4
5
|
Array.prototype.uniquifyByKey = function (key) {
|
|
5
|
-
return
|
|
6
|
+
return array_uniquifyByKey.uniquifyByKey(this, key);
|
|
6
7
|
};
|
|
8
|
+
//# sourceMappingURL=uniquify-by-key.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uniquify-by-key.cjs","sources":["../../../../../libs/js-utils/src/array/proto/uniquify-by-key.ts"],"sourcesContent":[null],"names":["uniquifyByKey"],"mappings":";;;;AA0BA,KAAK,CAAC,SAAS,CAAC,aAAa,GAAG,UAAsC,GAAY,EAAA;AAChF,IAAA,OAAOA,iCAAa,CAAC,IAAI,EAAE,GAAG,CAAC;AACjC,CAAC;;"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
export interface Array<T> {
|
|
3
|
+
/**
|
|
4
|
+
* #### Uniquify By Key
|
|
5
|
+
*
|
|
6
|
+
* Removes objects from the array which the value of its specifed key included before by another
|
|
7
|
+
*
|
|
8
|
+
* * * *
|
|
9
|
+
* Example:
|
|
10
|
+
* ```typescript
|
|
11
|
+
* import "@telperion/js-utils/array/proto/uniquify-by-key";
|
|
12
|
+
*
|
|
13
|
+
* const array = [{a: 1}, {a: 1}, {a: 2}, {a: 3}, {a: 3}, {a: 4}];
|
|
14
|
+
*
|
|
15
|
+
* array.uniquifyByKey('a'); // [{a: 1}, {a: 2}, {a: 3}, {a: 4}]
|
|
16
|
+
* ```
|
|
17
|
+
* * * *
|
|
18
|
+
* @param key Key to search the value on
|
|
19
|
+
* @return The new uniquified array
|
|
20
|
+
*/
|
|
21
|
+
uniquifyByKey(key: keyof T): T[];
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { uniquifyByKey } from '
|
|
1
|
+
import { uniquifyByKey } from '../uniquify-by-key.js';
|
|
2
|
+
|
|
2
3
|
Array.prototype.uniquifyByKey = function (key) {
|
|
3
4
|
return uniquifyByKey(this, key);
|
|
4
5
|
};
|
|
5
|
-
|
|
6
6
|
//# sourceMappingURL=uniquify-by-key.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../libs/js-utils/src/array/proto/uniquify-by-key.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"uniquify-by-key.js","sources":["../../../../../libs/js-utils/src/array/proto/uniquify-by-key.ts"],"sourcesContent":[null],"names":[],"mappings":";;AA0BA,KAAK,CAAC,SAAS,CAAC,aAAa,GAAG,UAAsC,GAAY,EAAA;AAChF,IAAA,OAAO,aAAa,CAAC,IAAI,EAAE,GAAG,CAAC;AACjC,CAAC"}
|
package/array/proto/uniquify.cjs
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var array_uniquify = require('../uniquify.cjs');
|
|
4
|
+
|
|
4
5
|
Array.prototype.uniquify = function () {
|
|
5
|
-
return
|
|
6
|
+
return array_uniquify.uniquify(this);
|
|
6
7
|
};
|
|
8
|
+
//# sourceMappingURL=uniquify.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uniquify.cjs","sources":["../../../../../libs/js-utils/src/array/proto/uniquify.ts"],"sourcesContent":[null],"names":["uniquify"],"mappings":";;;;AAyBA,KAAK,CAAC,SAAS,CAAC,QAAQ,GAAQ,YAAA;AAC9B,IAAA,OAAOA,uBAAQ,CAAC,IAAI,CAAC;AACvB,CAAC;;"}
|