@vinicunca/perkakas 0.2.1 → 0.3.1
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/README.md +9 -0
- package/dist/commonjs/aria/index.js +17 -0
- package/dist/commonjs/aria/key-codes.js +25 -0
- package/dist/commonjs/array/all-pass.js +11 -0
- package/dist/commonjs/array/any-pass.js +11 -0
- package/dist/commonjs/array/chunk.js +17 -0
- package/dist/commonjs/array/compact.js +8 -0
- package/dist/commonjs/array/concat.js +11 -0
- package/dist/commonjs/array/count-by.js +22 -0
- package/dist/commonjs/array/difference-with.js +31 -0
- package/dist/commonjs/array/difference.js +32 -0
- package/dist/commonjs/array/drop-first-by.js +26 -0
- package/dist/commonjs/array/drop-last-while.js +16 -0
- package/dist/commonjs/array/drop-last.js +15 -0
- package/dist/commonjs/array/drop-while.js +16 -0
- package/dist/commonjs/array/drop.js +32 -0
- package/dist/commonjs/array/filter.js +41 -0
- package/dist/commonjs/array/find-index.js +46 -0
- package/dist/commonjs/array/find-last-index.js +24 -0
- package/dist/commonjs/array/find-last.js +24 -0
- package/dist/commonjs/array/find.js +38 -0
- package/dist/commonjs/array/first-by.js +22 -0
- package/dist/commonjs/array/first.js +26 -0
- package/dist/commonjs/array/flat-map-to-obj.js +25 -0
- package/dist/commonjs/array/flat-map.js +33 -0
- package/dist/commonjs/array/flatten-deep.js +48 -0
- package/dist/commonjs/array/flatten.js +32 -0
- package/dist/commonjs/array/for-each.js +40 -0
- package/dist/commonjs/array/group-by.js +33 -0
- package/dist/commonjs/array/has-at-least.js +11 -0
- package/dist/commonjs/array/index-by.js +24 -0
- package/dist/commonjs/array/index.js +81 -0
- package/dist/commonjs/array/intersection-with.js +31 -0
- package/dist/commonjs/array/intersection.js +32 -0
- package/dist/commonjs/array/join.js +11 -0
- package/dist/commonjs/array/last.js +11 -0
- package/dist/commonjs/array/length.js +11 -0
- package/dist/commonjs/array/map-to-obj.js +23 -0
- package/dist/commonjs/array/map.js +35 -0
- package/dist/commonjs/array/max-by.js +28 -0
- package/dist/commonjs/array/mean-by.js +26 -0
- package/dist/commonjs/array/merge-all.js +7 -0
- package/dist/commonjs/array/min-by.js +28 -0
- package/dist/commonjs/array/nth-by.js +12 -0
- package/dist/commonjs/array/only.js +14 -0
- package/dist/commonjs/array/partition.js +24 -0
- package/dist/commonjs/array/range.js +15 -0
- package/dist/commonjs/array/rank-by.js +17 -0
- package/dist/commonjs/array/reduce.js +19 -0
- package/dist/commonjs/array/reject.js +41 -0
- package/dist/commonjs/array/reverse.js +11 -0
- package/dist/commonjs/array/sample.js +34 -0
- package/dist/commonjs/array/shuffle.js +18 -0
- package/dist/commonjs/array/sort-by.js +52 -0
- package/dist/commonjs/array/sort.js +16 -0
- package/dist/commonjs/array/splice.js +13 -0
- package/dist/commonjs/array/split-at.js +13 -0
- package/dist/commonjs/array/split-when.js +17 -0
- package/dist/commonjs/array/sum-by.js +24 -0
- package/dist/commonjs/array/swap-indices.js +34 -0
- package/dist/commonjs/array/take-first-by.js +24 -0
- package/dist/commonjs/array/take-while.js +18 -0
- package/dist/commonjs/array/take.js +38 -0
- package/dist/commonjs/array/uniq-by.js +30 -0
- package/dist/commonjs/array/uniq-with.js +33 -0
- package/dist/commonjs/array/uniq.js +32 -0
- package/dist/commonjs/array/zip-obj.js +16 -0
- package/dist/commonjs/array/zip-with.js +23 -0
- package/dist/commonjs/array/zip.js +19 -0
- package/dist/commonjs/function/conditional.js +34 -0
- package/dist/commonjs/function/create-pipe.js +8 -0
- package/dist/commonjs/function/debounce.js +88 -0
- package/dist/commonjs/function/identity.js +7 -0
- package/dist/commonjs/function/index.js +25 -0
- package/dist/commonjs/function/noop.js +7 -0
- package/dist/commonjs/function/once.js +15 -0
- package/dist/commonjs/function/pipe.js +106 -0
- package/dist/commonjs/function/purry.js +20 -0
- package/dist/commonjs/function/sleep.js +9 -0
- package/dist/commonjs/guard/index.js +32 -0
- package/dist/commonjs/guard/is-array.js +7 -0
- package/dist/commonjs/guard/is-boolean.js +7 -0
- package/dist/commonjs/guard/is-date.js +7 -0
- package/dist/commonjs/guard/is-defined.js +13 -0
- package/dist/commonjs/guard/is-empty.js +19 -0
- package/dist/commonjs/guard/is-error.js +7 -0
- package/dist/commonjs/guard/is-function.js +7 -0
- package/dist/commonjs/guard/is-nil.js +7 -0
- package/dist/commonjs/guard/is-non-null.js +7 -0
- package/dist/commonjs/guard/is-not.js +9 -0
- package/dist/commonjs/guard/is-number.js +7 -0
- package/dist/commonjs/guard/is-object.js +11 -0
- package/dist/commonjs/guard/is-promise.js +7 -0
- package/dist/commonjs/guard/is-string.js +7 -0
- package/dist/commonjs/guard/is-symbol.js +7 -0
- package/dist/commonjs/guard/is-truthy.js +7 -0
- package/dist/commonjs/index.js +26 -0
- package/dist/commonjs/number/add.js +11 -0
- package/dist/commonjs/number/ceil.js +9 -0
- package/dist/commonjs/number/clamp.js +17 -0
- package/dist/commonjs/number/divide.js +11 -0
- package/dist/commonjs/number/floor.js +9 -0
- package/dist/commonjs/number/index.js +24 -0
- package/dist/commonjs/number/multiply.js +11 -0
- package/dist/commonjs/number/round.js +9 -0
- package/dist/commonjs/number/subtract.js +11 -0
- package/dist/commonjs/object/add-prop.js +14 -0
- package/dist/commonjs/object/clone.js +49 -0
- package/dist/commonjs/object/equals.js +71 -0
- package/dist/commonjs/object/for-each-obj.js +30 -0
- package/dist/commonjs/object/from-pairs.js +14 -0
- package/dist/commonjs/object/index.js +39 -0
- package/dist/commonjs/object/invert.js +15 -0
- package/dist/commonjs/object/keys.js +10 -0
- package/dist/commonjs/object/map-keys.js +16 -0
- package/dist/commonjs/object/map-values.js +16 -0
- package/dist/commonjs/object/merge-deep.js +31 -0
- package/dist/commonjs/object/merge.js +11 -0
- package/dist/commonjs/object/omit-by.js +20 -0
- package/dist/commonjs/object/omit.js +25 -0
- package/dist/commonjs/object/path-or.js +18 -0
- package/dist/commonjs/object/pick-by.js +20 -0
- package/dist/commonjs/object/pick.js +19 -0
- package/dist/commonjs/object/prop.js +7 -0
- package/dist/commonjs/object/set-path.js +26 -0
- package/dist/commonjs/object/set.js +14 -0
- package/dist/commonjs/object/swap-props.js +16 -0
- package/dist/commonjs/object/to-pairs.js +11 -0
- package/dist/commonjs/object/values.js +7 -0
- package/dist/commonjs/string/cases-types.js +2 -0
- package/dist/commonjs/string/cases.js +107 -0
- package/dist/commonjs/string/human-readable-file-size.js +16 -0
- package/dist/commonjs/string/index.js +21 -0
- package/dist/commonjs/string/random-string.js +10 -0
- package/dist/commonjs/string/slugify.js +13 -0
- package/dist/commonjs/string/string-to-path.js +18 -0
- package/dist/commonjs/type/index.js +17 -0
- package/dist/commonjs/type/type.js +13 -0
- package/dist/commonjs/utils/heap.js +43 -0
- package/dist/commonjs/utils/narrow.js +2 -0
- package/dist/commonjs/utils/paths.js +2 -0
- package/dist/commonjs/utils/purry-on.js +10 -0
- package/dist/commonjs/utils/purry-order-rules.js +66 -0
- package/dist/commonjs/utils/quick-select.js +31 -0
- package/dist/commonjs/utils/reduce-lazy.js +18 -0
- package/dist/commonjs/utils/swap-in-place.js +7 -0
- package/dist/commonjs/utils/to-lazy-indexed.js +7 -0
- package/dist/commonjs/utils/to-single.js +8 -0
- package/dist/commonjs/utils/types.js +2 -0
- package/dist/commonjs/utils/with-precision.js +23 -0
- package/dist/es/aria/index.js +1 -0
- package/dist/es/aria/key-codes.js +22 -0
- package/dist/es/array/all-pass.js +7 -0
- package/dist/es/array/any-pass.js +7 -0
- package/dist/es/array/chunk.js +13 -0
- package/dist/es/array/compact.js +4 -0
- package/dist/es/array/concat.js +7 -0
- package/dist/es/array/count-by.js +18 -0
- package/dist/es/array/difference-with.js +27 -0
- package/dist/es/array/difference.js +28 -0
- package/dist/es/array/drop-first-by.js +22 -0
- package/dist/es/array/drop-last-while.js +12 -0
- package/dist/es/array/drop-last.js +11 -0
- package/dist/es/array/drop-while.js +12 -0
- package/dist/es/array/drop.js +28 -0
- package/dist/es/array/filter.js +37 -0
- package/dist/es/array/find-index.js +42 -0
- package/dist/es/array/find-last-index.js +20 -0
- package/dist/es/array/find-last.js +20 -0
- package/dist/es/array/find.js +34 -0
- package/dist/es/array/first-by.js +18 -0
- package/dist/es/array/first.js +22 -0
- package/dist/es/array/flat-map-to-obj.js +21 -0
- package/dist/es/array/flat-map.js +29 -0
- package/dist/es/array/flatten-deep.js +44 -0
- package/dist/es/array/flatten.js +28 -0
- package/dist/es/array/for-each.js +36 -0
- package/dist/es/array/group-by.js +29 -0
- package/dist/es/array/has-at-least.js +7 -0
- package/dist/es/array/index-by.js +20 -0
- package/dist/es/array/index.js +65 -0
- package/dist/es/array/intersection-with.js +27 -0
- package/dist/es/array/intersection.js +28 -0
- package/dist/es/array/join.js +7 -0
- package/dist/es/array/last.js +7 -0
- package/dist/es/array/length.js +7 -0
- package/dist/es/array/map-to-obj.js +19 -0
- package/dist/es/array/map.js +31 -0
- package/dist/es/array/max-by.js +24 -0
- package/dist/es/array/mean-by.js +22 -0
- package/dist/es/array/merge-all.js +3 -0
- package/dist/es/array/min-by.js +24 -0
- package/dist/es/array/nth-by.js +8 -0
- package/dist/es/array/only.js +10 -0
- package/dist/es/array/partition.js +20 -0
- package/dist/es/array/range.js +11 -0
- package/dist/es/array/rank-by.js +13 -0
- package/dist/es/array/reduce.js +15 -0
- package/dist/es/array/reject.js +37 -0
- package/dist/es/array/reverse.js +7 -0
- package/dist/es/array/sample.js +30 -0
- package/dist/es/array/shuffle.js +14 -0
- package/dist/es/array/sort-by.js +48 -0
- package/dist/es/array/sort.js +12 -0
- package/dist/es/array/splice.js +9 -0
- package/dist/es/array/split-at.js +9 -0
- package/dist/es/array/split-when.js +13 -0
- package/dist/es/array/sum-by.js +20 -0
- package/dist/es/array/swap-indices.js +30 -0
- package/dist/es/array/take-first-by.js +20 -0
- package/dist/es/array/take-while.js +14 -0
- package/dist/es/array/take.js +34 -0
- package/dist/es/array/uniq-by.js +26 -0
- package/dist/es/array/uniq-with.js +29 -0
- package/dist/es/array/uniq.js +28 -0
- package/dist/es/array/zip-obj.js +12 -0
- package/dist/es/array/zip-with.js +19 -0
- package/dist/es/array/zip.js +15 -0
- package/dist/es/function/conditional.js +30 -0
- package/dist/es/function/create-pipe.js +4 -0
- package/dist/es/function/debounce.js +84 -0
- package/dist/es/function/identity.js +3 -0
- package/dist/es/function/index.js +9 -0
- package/dist/es/function/noop.js +3 -0
- package/dist/es/function/once.js +11 -0
- package/dist/es/function/pipe.js +102 -0
- package/dist/es/function/purry.js +16 -0
- package/dist/es/function/sleep.js +5 -0
- package/dist/es/guard/index.js +16 -0
- package/dist/es/guard/is-array.js +3 -0
- package/dist/es/guard/is-boolean.js +3 -0
- package/dist/es/guard/is-date.js +3 -0
- package/dist/es/guard/is-defined.js +9 -0
- package/dist/es/guard/is-empty.js +15 -0
- package/dist/es/guard/is-error.js +3 -0
- package/dist/es/guard/is-function.js +3 -0
- package/dist/es/guard/is-nil.js +3 -0
- package/dist/es/guard/is-non-null.js +3 -0
- package/dist/es/guard/is-not.js +5 -0
- package/dist/es/guard/is-number.js +3 -0
- package/dist/es/guard/is-object.js +7 -0
- package/dist/es/guard/is-promise.js +3 -0
- package/dist/es/guard/is-string.js +3 -0
- package/dist/es/guard/is-symbol.js +3 -0
- package/dist/es/guard/is-truthy.js +3 -0
- package/dist/es/index.js +9 -0
- package/dist/es/number/add.js +7 -0
- package/dist/es/number/ceil.js +5 -0
- package/dist/es/number/clamp.js +13 -0
- package/dist/es/number/divide.js +7 -0
- package/dist/es/number/floor.js +5 -0
- package/dist/es/number/index.js +8 -0
- package/dist/es/number/multiply.js +7 -0
- package/dist/es/number/round.js +5 -0
- package/dist/es/number/subtract.js +7 -0
- package/dist/es/object/add-prop.js +10 -0
- package/dist/es/object/clone.js +45 -0
- package/dist/es/object/equals.js +67 -0
- package/dist/es/object/for-each-obj.js +26 -0
- package/dist/es/object/from-pairs.js +10 -0
- package/dist/es/object/index.js +23 -0
- package/dist/es/object/invert.js +11 -0
- package/dist/es/object/keys.js +6 -0
- package/dist/es/object/map-keys.js +12 -0
- package/dist/es/object/map-values.js +12 -0
- package/dist/es/object/merge-deep.js +27 -0
- package/dist/es/object/merge.js +7 -0
- package/dist/es/object/omit-by.js +16 -0
- package/dist/es/object/omit.js +21 -0
- package/dist/es/object/path-or.js +14 -0
- package/dist/es/object/pick-by.js +16 -0
- package/dist/es/object/pick.js +15 -0
- package/dist/es/object/prop.js +3 -0
- package/dist/es/object/set-path.js +21 -0
- package/dist/es/object/set.js +10 -0
- package/dist/es/object/swap-props.js +12 -0
- package/dist/es/object/to-pairs.js +7 -0
- package/dist/es/object/values.js +3 -0
- package/dist/es/string/cases-types.js +1 -0
- package/dist/es/string/cases.js +93 -0
- package/dist/es/string/human-readable-file-size.js +12 -0
- package/dist/es/string/index.js +5 -0
- package/dist/es/string/random-string.js +6 -0
- package/dist/es/string/slugify.js +9 -0
- package/dist/es/string/string-to-path.js +14 -0
- package/dist/es/type/index.js +1 -0
- package/dist/es/type/type.js +9 -0
- package/dist/es/utils/heap.js +38 -0
- package/dist/es/utils/narrow.js +1 -0
- package/dist/es/utils/paths.js +1 -0
- package/dist/es/utils/purry-on.js +6 -0
- package/dist/es/utils/purry-order-rules.js +61 -0
- package/dist/es/utils/quick-select.js +27 -0
- package/dist/es/utils/reduce-lazy.js +14 -0
- package/dist/es/utils/swap-in-place.js +3 -0
- package/dist/es/utils/to-lazy-indexed.js +3 -0
- package/dist/es/utils/to-single.js +4 -0
- package/dist/es/utils/types.js +1 -0
- package/dist/es/utils/with-precision.js +19 -0
- package/dist/metadata.json +48311 -0
- package/dist/types/aria/index.d.ts +2 -0
- package/dist/types/aria/index.d.ts.map +1 -0
- package/dist/types/aria/key-codes.d.ts +26 -0
- package/dist/types/aria/key-codes.d.ts.map +1 -0
- package/dist/types/array/all-pass.d.ts +32 -0
- package/dist/types/array/all-pass.d.ts.map +1 -0
- package/dist/types/array/any-pass.d.ts +32 -0
- package/dist/types/array/any-pass.d.ts.map +1 -0
- package/dist/types/array/chunk.d.ts +29 -0
- package/dist/types/array/chunk.d.ts.map +1 -0
- package/dist/types/array/compact.d.ts +12 -0
- package/dist/types/array/compact.d.ts.map +1 -0
- package/dist/types/array/concat.d.ts +24 -0
- package/dist/types/array/concat.d.ts.map +1 -0
- package/dist/types/array/count-by.d.ts +20 -0
- package/dist/types/array/count-by.d.ts.map +1 -0
- package/dist/types/array/difference-with.d.ts +48 -0
- package/dist/types/array/difference-with.d.ts.map +1 -0
- package/dist/types/array/difference.d.ts +35 -0
- package/dist/types/array/difference.d.ts.map +1 -0
- package/dist/types/array/drop-first-by.d.ts +39 -0
- package/dist/types/array/drop-first-by.d.ts.map +1 -0
- package/dist/types/array/drop-last-while.d.ts +30 -0
- package/dist/types/array/drop-last-while.d.ts.map +1 -0
- package/dist/types/array/drop-last.d.ts +25 -0
- package/dist/types/array/drop-last.d.ts.map +1 -0
- package/dist/types/array/drop-while.d.ts +33 -0
- package/dist/types/array/drop-while.d.ts.map +1 -0
- package/dist/types/array/drop.d.ts +31 -0
- package/dist/types/array/drop.d.ts.map +1 -0
- package/dist/types/array/filter.d.ts +49 -0
- package/dist/types/array/filter.d.ts.map +1 -0
- package/dist/types/array/find-index.d.ts +67 -0
- package/dist/types/array/find-index.d.ts.map +1 -0
- package/dist/types/array/find-last-index.d.ts +43 -0
- package/dist/types/array/find-last-index.d.ts.map +1 -0
- package/dist/types/array/find-last.d.ts +45 -0
- package/dist/types/array/find-last.d.ts.map +1 -0
- package/dist/types/array/find.d.ts +59 -0
- package/dist/types/array/find.d.ts.map +1 -0
- package/dist/types/array/first-by.d.ts +57 -0
- package/dist/types/array/first-by.d.ts.map +1 -0
- package/dist/types/array/first.d.ts +35 -0
- package/dist/types/array/first.d.ts.map +1 -0
- package/dist/types/array/flat-map-to-obj.d.ts +50 -0
- package/dist/types/array/flat-map-to-obj.d.ts.map +1 -0
- package/dist/types/array/flat-map.d.ts +39 -0
- package/dist/types/array/flat-map.d.ts.map +1 -0
- package/dist/types/array/flatten-deep.d.ts +26 -0
- package/dist/types/array/flatten-deep.d.ts.map +1 -0
- package/dist/types/array/flatten.d.ts +23 -0
- package/dist/types/array/flatten.d.ts.map +1 -0
- package/dist/types/array/for-each.d.ts +57 -0
- package/dist/types/array/for-each.d.ts.map +1 -0
- package/dist/types/array/group-by.d.ts +36 -0
- package/dist/types/array/group-by.d.ts.map +1 -0
- package/dist/types/array/has-at-least.d.ts +47 -0
- package/dist/types/array/has-at-least.d.ts.map +1 -0
- package/dist/types/array/index-by.d.ts +34 -0
- package/dist/types/array/index-by.d.ts.map +1 -0
- package/dist/types/array/index.d.ts +66 -0
- package/dist/types/array/index.d.ts.map +1 -0
- package/dist/types/array/intersection-with.d.ts +54 -0
- package/dist/types/array/intersection-with.d.ts.map +1 -0
- package/dist/types/array/intersection.d.ts +30 -0
- package/dist/types/array/intersection.d.ts.map +1 -0
- package/dist/types/array/join.d.ts +45 -0
- package/dist/types/array/join.d.ts.map +1 -0
- package/dist/types/array/last.d.ts +24 -0
- package/dist/types/array/last.d.ts.map +1 -0
- package/dist/types/array/length.d.ts +14 -0
- package/dist/types/array/length.d.ts.map +1 -0
- package/dist/types/array/map-to-obj.d.ts +42 -0
- package/dist/types/array/map-to-obj.d.ts.map +1 -0
- package/dist/types/array/map.d.ts +62 -0
- package/dist/types/array/map.d.ts.map +1 -0
- package/dist/types/array/max-by.d.ts +39 -0
- package/dist/types/array/max-by.d.ts.map +1 -0
- package/dist/types/array/mean-by.d.ts +39 -0
- package/dist/types/array/mean-by.d.ts.map +1 -0
- package/dist/types/array/merge-all.d.ts +16 -0
- package/dist/types/array/merge-all.d.ts.map +1 -0
- package/dist/types/array/min-by.d.ts +39 -0
- package/dist/types/array/min-by.d.ts.map +1 -0
- package/dist/types/array/nth-by.d.ts +45 -0
- package/dist/types/array/nth-by.d.ts.map +1 -0
- package/dist/types/array/only.d.ts +36 -0
- package/dist/types/array/only.d.ts.map +1 -0
- package/dist/types/array/partition.d.ts +60 -0
- package/dist/types/array/partition.d.ts.map +1 -0
- package/dist/types/array/range.d.ts +22 -0
- package/dist/types/array/range.d.ts.map +1 -0
- package/dist/types/array/rank-by.d.ts +41 -0
- package/dist/types/array/rank-by.d.ts.map +1 -0
- package/dist/types/array/reduce.d.ts +35 -0
- package/dist/types/array/reduce.d.ts.map +1 -0
- package/dist/types/array/reject.d.ts +42 -0
- package/dist/types/array/reject.d.ts.map +1 -0
- package/dist/types/array/reverse.d.ts +25 -0
- package/dist/types/array/reverse.d.ts.map +1 -0
- package/dist/types/array/sample.d.ts +54 -0
- package/dist/types/array/sample.d.ts.map +1 -0
- package/dist/types/array/shuffle.d.ts +22 -0
- package/dist/types/array/shuffle.d.ts.map +1 -0
- package/dist/types/array/sort-by.d.ts +99 -0
- package/dist/types/array/sort-by.d.ts.map +1 -0
- package/dist/types/array/sort.d.ts +52 -0
- package/dist/types/array/sort.d.ts.map +1 -0
- package/dist/types/array/splice.d.ts +31 -0
- package/dist/types/array/splice.d.ts.map +1 -0
- package/dist/types/array/split-at.d.ts +26 -0
- package/dist/types/array/split-at.d.ts.map +1 -0
- package/dist/types/array/split-when.d.ts +24 -0
- package/dist/types/array/split-when.d.ts.map +1 -0
- package/dist/types/array/sum-by.d.ts +39 -0
- package/dist/types/array/sum-by.d.ts.map +1 -0
- package/dist/types/array/swap-indices.d.ts +68 -0
- package/dist/types/array/swap-indices.d.ts.map +1 -0
- package/dist/types/array/take-first-by.d.ts +43 -0
- package/dist/types/array/take-first-by.d.ts.map +1 -0
- package/dist/types/array/take-while.d.ts +24 -0
- package/dist/types/array/take-while.d.ts.map +1 -0
- package/dist/types/array/take.d.ts +30 -0
- package/dist/types/array/take.d.ts.map +1 -0
- package/dist/types/array/uniq-by.d.ts +22 -0
- package/dist/types/array/uniq-by.d.ts.map +1 -0
- package/dist/types/array/uniq-with.d.ts +44 -0
- package/dist/types/array/uniq-with.d.ts.map +1 -0
- package/dist/types/array/uniq.d.ts +24 -0
- package/dist/types/array/uniq.d.ts.map +1 -0
- package/dist/types/array/zip-obj.d.ts +26 -0
- package/dist/types/array/zip-obj.d.ts.map +1 -0
- package/dist/types/array/zip-with.d.ts +42 -0
- package/dist/types/array/zip-with.d.ts.map +1 -0
- package/dist/types/array/zip.d.ts +52 -0
- package/dist/types/array/zip.d.ts.map +1 -0
- package/dist/types/function/conditional.d.ts +108 -0
- package/dist/types/function/conditional.d.ts.map +1 -0
- package/dist/types/function/create-pipe.d.ts +19 -0
- package/dist/types/function/create-pipe.d.ts.map +1 -0
- package/dist/types/function/debounce.d.ts +92 -0
- package/dist/types/function/debounce.d.ts.map +1 -0
- package/dist/types/function/identity.d.ts +10 -0
- package/dist/types/function/identity.d.ts.map +1 -0
- package/dist/types/function/index.d.ts +10 -0
- package/dist/types/function/index.d.ts.map +1 -0
- package/dist/types/function/noop.d.ts +10 -0
- package/dist/types/function/noop.d.ts.map +1 -0
- package/dist/types/function/once.d.ts +13 -0
- package/dist/types/function/once.d.ts.map +1 -0
- package/dist/types/function/pipe.d.ts +32 -0
- package/dist/types/function/pipe.d.ts.map +1 -0
- package/dist/types/function/purry.d.ts +32 -0
- package/dist/types/function/purry.d.ts.map +1 -0
- package/dist/types/function/sleep.d.ts +12 -0
- package/dist/types/function/sleep.d.ts.map +1 -0
- package/dist/types/guard/index.d.ts +17 -0
- package/dist/types/guard/index.d.ts.map +1 -0
- package/dist/types/guard/is-array.d.ts +15 -0
- package/dist/types/guard/is-array.d.ts.map +1 -0
- package/dist/types/guard/is-boolean.d.ts +15 -0
- package/dist/types/guard/is-boolean.d.ts.map +1 -0
- package/dist/types/guard/is-date.d.ts +13 -0
- package/dist/types/guard/is-date.d.ts.map +1 -0
- package/dist/types/guard/is-defined.d.ts +22 -0
- package/dist/types/guard/is-defined.d.ts.map +1 -0
- package/dist/types/guard/is-empty.d.ts +19 -0
- package/dist/types/guard/is-empty.d.ts.map +1 -0
- package/dist/types/guard/is-error.d.ts +15 -0
- package/dist/types/guard/is-error.d.ts.map +1 -0
- package/dist/types/guard/is-function.d.ts +15 -0
- package/dist/types/guard/is-function.d.ts.map +1 -0
- package/dist/types/guard/is-nil.d.ts +14 -0
- package/dist/types/guard/is-nil.d.ts.map +1 -0
- package/dist/types/guard/is-non-null.d.ts +15 -0
- package/dist/types/guard/is-non-null.d.ts.map +1 -0
- package/dist/types/guard/is-not.d.ts +15 -0
- package/dist/types/guard/is-not.d.ts.map +1 -0
- package/dist/types/guard/is-number.d.ts +14 -0
- package/dist/types/guard/is-number.d.ts.map +1 -0
- package/dist/types/guard/is-object.d.ts +28 -0
- package/dist/types/guard/is-object.d.ts.map +1 -0
- package/dist/types/guard/is-promise.d.ts +14 -0
- package/dist/types/guard/is-promise.d.ts.map +1 -0
- package/dist/types/guard/is-string.d.ts +14 -0
- package/dist/types/guard/is-string.d.ts.map +1 -0
- package/dist/types/guard/is-symbol.d.ts +14 -0
- package/dist/types/guard/is-symbol.d.ts.map +1 -0
- package/dist/types/guard/is-truthy.d.ts +17 -0
- package/dist/types/guard/is-truthy.d.ts.map +1 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/number/add.d.ts +29 -0
- package/dist/types/number/add.d.ts.map +1 -0
- package/dist/types/number/ceil.d.ts +35 -0
- package/dist/types/number/ceil.d.ts.map +1 -0
- package/dist/types/number/clamp.d.ts +38 -0
- package/dist/types/number/clamp.d.ts.map +1 -0
- package/dist/types/number/divide.d.ts +27 -0
- package/dist/types/number/divide.d.ts.map +1 -0
- package/dist/types/number/floor.d.ts +35 -0
- package/dist/types/number/floor.d.ts.map +1 -0
- package/dist/types/number/index.d.ts +9 -0
- package/dist/types/number/index.d.ts.map +1 -0
- package/dist/types/number/multiply.d.ts +27 -0
- package/dist/types/number/multiply.d.ts.map +1 -0
- package/dist/types/number/round.d.ts +35 -0
- package/dist/types/number/round.d.ts.map +1 -0
- package/dist/types/number/subtract.d.ts +29 -0
- package/dist/types/number/subtract.d.ts.map +1 -0
- package/dist/types/object/add-prop.d.ts +30 -0
- package/dist/types/object/add-prop.d.ts.map +1 -0
- package/dist/types/object/clone.d.ts +10 -0
- package/dist/types/object/clone.d.ts.map +1 -0
- package/dist/types/object/equals.d.ts +30 -0
- package/dist/types/object/equals.d.ts.map +1 -0
- package/dist/types/object/for-each-obj.d.ts +44 -0
- package/dist/types/object/for-each-obj.d.ts.map +1 -0
- package/dist/types/object/from-pairs.d.ts +38 -0
- package/dist/types/object/from-pairs.d.ts.map +1 -0
- package/dist/types/object/index.d.ts +24 -0
- package/dist/types/object/index.d.ts.map +1 -0
- package/dist/types/object/invert.d.ts +28 -0
- package/dist/types/object/invert.d.ts.map +1 -0
- package/dist/types/object/keys.d.ts +34 -0
- package/dist/types/object/keys.d.ts.map +1 -0
- package/dist/types/object/map-keys.d.ts +24 -0
- package/dist/types/object/map-keys.d.ts.map +1 -0
- package/dist/types/object/map-values.d.ts +25 -0
- package/dist/types/object/map-values.d.ts.map +1 -0
- package/dist/types/object/merge-deep.d.ts +32 -0
- package/dist/types/object/merge-deep.d.ts.map +1 -0
- package/dist/types/object/merge.d.ts +25 -0
- package/dist/types/object/merge.d.ts.map +1 -0
- package/dist/types/object/omit-by.d.ts +22 -0
- package/dist/types/object/omit-by.d.ts.map +1 -0
- package/dist/types/object/omit.d.ts +24 -0
- package/dist/types/object/omit.d.ts.map +1 -0
- package/dist/types/object/path-or.d.ts +76 -0
- package/dist/types/object/path-or.d.ts.map +1 -0
- package/dist/types/object/pick-by.d.ts +22 -0
- package/dist/types/object/pick-by.d.ts.map +1 -0
- package/dist/types/object/pick.d.ts +22 -0
- package/dist/types/object/pick.d.ts.map +1 -0
- package/dist/types/object/prop.d.ts +11 -0
- package/dist/types/object/prop.d.ts.map +1 -0
- package/dist/types/object/set-path.d.ts +29 -0
- package/dist/types/object/set-path.d.ts.map +1 -0
- package/dist/types/object/set.d.ts +26 -0
- package/dist/types/object/set.d.ts.map +1 -0
- package/dist/types/object/swap-props.d.ts +44 -0
- package/dist/types/object/swap-props.d.ts.map +1 -0
- package/dist/types/object/to-pairs.d.ts +33 -0
- package/dist/types/object/to-pairs.d.ts.map +1 -0
- package/dist/types/object/values.d.ts +20 -0
- package/dist/types/object/values.d.ts.map +1 -0
- package/dist/types/string/cases-types.d.ts +36 -0
- package/dist/types/string/cases-types.d.ts.map +1 -0
- package/dist/types/string/cases.d.ts +22 -0
- package/dist/types/string/cases.d.ts.map +1 -0
- package/dist/types/string/human-readable-file-size.d.ts +13 -0
- package/dist/types/string/human-readable-file-size.d.ts.map +1 -0
- package/dist/types/string/index.d.ts +6 -0
- package/dist/types/string/index.d.ts.map +1 -0
- package/dist/types/string/random-string.d.ts +10 -0
- package/dist/types/string/random-string.d.ts.map +1 -0
- package/dist/types/string/slugify.d.ts +12 -0
- package/dist/types/string/slugify.d.ts.map +1 -0
- package/dist/types/string/string-to-path.d.ts +11 -0
- package/dist/types/string/string-to-path.d.ts.map +1 -0
- package/dist/types/type/index.d.ts +2 -0
- package/dist/types/type/index.d.ts.map +1 -0
- package/dist/types/type/type.d.ts +19 -0
- package/dist/types/type/type.d.ts.map +1 -0
- package/dist/types/utils/heap.d.ts +24 -0
- package/dist/types/utils/heap.d.ts.map +1 -0
- package/dist/types/utils/narrow.d.ts +52 -0
- package/dist/types/utils/narrow.d.ts.map +1 -0
- package/dist/types/utils/paths.d.ts +9 -0
- package/dist/types/utils/paths.d.ts.map +1 -0
- package/dist/types/utils/purry-on.d.ts +7 -0
- package/dist/types/utils/purry-on.d.ts.map +1 -0
- package/dist/types/utils/purry-order-rules.d.ts +52 -0
- package/dist/types/utils/purry-order-rules.d.ts.map +1 -0
- package/dist/types/utils/quick-select.d.ts +18 -0
- package/dist/types/utils/quick-select.d.ts.map +1 -0
- package/dist/types/utils/reduce-lazy.d.ts +22 -0
- package/dist/types/utils/reduce-lazy.d.ts.map +1 -0
- package/dist/types/utils/swap-in-place.d.ts +5 -0
- package/dist/types/utils/swap-in-place.d.ts.map +1 -0
- package/dist/types/utils/to-lazy-indexed.d.ts +4 -0
- package/dist/types/utils/to-lazy-indexed.d.ts.map +1 -0
- package/dist/types/utils/to-single.d.ts +4 -0
- package/dist/types/utils/to-single.d.ts.map +1 -0
- package/dist/types/utils/types.d.ts +32 -0
- package/dist/types/utils/types.d.ts.map +1 -0
- package/dist/types/utils/with-precision.d.ts +2 -0
- package/dist/types/utils/with-precision.d.ts.map +1 -0
- package/package.json +34 -23
- package/dist/index.cjs +0 -2843
- package/dist/index.d.cts +0 -4175
- package/dist/index.d.ts +0 -4175
- package/dist/index.js +0 -2678
- package/dist/index.min.js +0 -2
- package/dist/index.min.js.map +0 -7
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
interface Debouncer<F extends (...args: any) => unknown, IsNullable extends boolean = true> {
|
|
2
|
+
/**
|
|
3
|
+
* The last computed value of the debounced function.
|
|
4
|
+
*/
|
|
5
|
+
readonly cachedValue: ReturnType<F> | undefined;
|
|
6
|
+
/**
|
|
7
|
+
* Invoke the debounced function.
|
|
8
|
+
* @param args - same as the args for the debounced function.
|
|
9
|
+
* @returns - the last computed value of the debounced function with the
|
|
10
|
+
* latest args provided to it. If `timing` does not include `leading` then the
|
|
11
|
+
* the function would return `undefined` until the first cool-down period is
|
|
12
|
+
* over, otherwise the function would always return the return type of the
|
|
13
|
+
* debounced function.
|
|
14
|
+
*/
|
|
15
|
+
readonly call: (...args: Parameters<F>) => ReturnType<F> | (true extends IsNullable ? undefined : never);
|
|
16
|
+
/**
|
|
17
|
+
* Cancels any debounced functions without calling them, effectively resetting
|
|
18
|
+
* the debouncer to the same state it is when initially created.
|
|
19
|
+
*/
|
|
20
|
+
readonly cancel: () => void;
|
|
21
|
+
/**
|
|
22
|
+
* Similar to `cancel`, but would also trigger the `trailing` invocation if
|
|
23
|
+
* the debouncer would run one at the end of the cool-down period.
|
|
24
|
+
*/
|
|
25
|
+
readonly flush: () => ReturnType<F> | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Is `true` when there is an active cool-down period currently debouncing
|
|
28
|
+
* invocations.
|
|
29
|
+
*/
|
|
30
|
+
readonly isPending: boolean;
|
|
31
|
+
}
|
|
32
|
+
interface DebounceOptions {
|
|
33
|
+
readonly maxWaitMs?: number;
|
|
34
|
+
readonly waitMs?: number;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Wraps `func` with a debouncer object that "debounces" (delays) invocations of the function during a defined cool-down period (`waitMs`). It can be configured to invoke the function either at the start of the cool-down period, the end of it, or at both ends (`timing`).
|
|
38
|
+
* It can also be configured to allow invocations during the cool-down period (`maxWaitMs`).
|
|
39
|
+
* It stores the latest call's arguments so they could be used at the end of the cool-down period when invoking `func` (if configured to invoke the function at the end of the cool-down period).
|
|
40
|
+
* It stores the value returned by `func` whenever its invoked. This value is returned on every call, and is accessible via the `cachedValue` property of the debouncer. Its important to note that the value might be different from the value that would be returned from running `func` with the current arguments as it is a cached value from a previous invocation.
|
|
41
|
+
* **Important**: The cool-down period defines the minimum between two invocations, and not the maximum. The period will be **extended** each time a call is made until a full cool-down period has elapsed without any additional calls.
|
|
42
|
+
* @param func The function to debounce, the returned `call` function will have
|
|
43
|
+
* the exact same signature.
|
|
44
|
+
* @param options An object allowing further customization of the debouncer:
|
|
45
|
+
* - `timing?: 'leading' | 'trailing' |'both'`. The default is `'trailing'`.
|
|
46
|
+
* `leading` would result in the function being invoked at the start of the
|
|
47
|
+
* cool-down period; `trailing` would result in the function being invoked at
|
|
48
|
+
* the end of the cool-down period (using the args from the last call to the
|
|
49
|
+
* debouncer). When `both` is selected the `trailing` invocation would only
|
|
50
|
+
* take place if there were more than one call to the debouncer during the
|
|
51
|
+
* cool-down period. **DEFAULT: 'trailing'**
|
|
52
|
+
* - `waitMs?: number`. The length of the cool-down period in milliseconds. The
|
|
53
|
+
* debouncer would wait until this amount of time has passed without **any**
|
|
54
|
+
* additional calls to the debouncer before triggering the end-of-cool-down-
|
|
55
|
+
* period event. When this happens, the function would be invoked (if `timing`
|
|
56
|
+
* isn't `'leading'`) and the debouncer state would be reset. **DEFAULT: 0**
|
|
57
|
+
* - `maxWaitMs?: number`. The length of time since a debounced call (a call
|
|
58
|
+
* that the debouncer prevented from being invoked) was made until it would be
|
|
59
|
+
* invoked. Because the debouncer can be continually triggered and thus never
|
|
60
|
+
* reach the end of the cool-down period, this allows the function to still
|
|
61
|
+
* be invoked occasionally. IMPORTANT: This param is ignored when `timing` is
|
|
62
|
+
* `'leading'`.
|
|
63
|
+
* @returns a debouncer object. The main function is `call`. In addition to it
|
|
64
|
+
* the debouncer comes with the following additional functions and properties:
|
|
65
|
+
* - `cancel` method to cancel delayed `func` invocations
|
|
66
|
+
* - `flush` method to end the cool-down period immediately.
|
|
67
|
+
* - `cachedValue` the latest return value of an invocation (if one occurred).
|
|
68
|
+
* - `isPending` flag to check if there is an inflight cool-down window.
|
|
69
|
+
* @signature
|
|
70
|
+
* P.debounce(func, options);
|
|
71
|
+
* @example
|
|
72
|
+
* const debouncer = debounce(identity, { timing: 'trailing', waitMs: 1000 });
|
|
73
|
+
* const result1 = debouncer.call(1); // => undefined
|
|
74
|
+
* const result2 = debouncer.call(2); // => undefined
|
|
75
|
+
* // after 1 second
|
|
76
|
+
* const result3 = debouncer.call(3); // => 2
|
|
77
|
+
* // after 1 second
|
|
78
|
+
* debouncer.cachedValue; // => 3
|
|
79
|
+
* @dataFirst
|
|
80
|
+
* @category Function
|
|
81
|
+
* @see https://css-tricks.com/debouncing-throttling-explained-examples/
|
|
82
|
+
*/
|
|
83
|
+
export declare function debounce<F extends (...args: any) => any>(func: F, options: {
|
|
84
|
+
readonly timing?: 'trailing';
|
|
85
|
+
} & DebounceOptions): Debouncer<F>;
|
|
86
|
+
export declare function debounce<F extends (...args: any) => any>(func: F, options: ({
|
|
87
|
+
readonly timing: 'both';
|
|
88
|
+
} & DebounceOptions) | ({
|
|
89
|
+
readonly timing: 'leading';
|
|
90
|
+
} & Omit<DebounceOptions, 'maxWaitMs'>)): Debouncer<F, false>;
|
|
91
|
+
export {};
|
|
92
|
+
//# sourceMappingURL=debounce.d.ts.map
|
|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EAAE,CAAC,EACP,OAAO,EACL,CAAC;IAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,eAAe,CAAC,GAC/C,CAAC;IAAE,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAA;CAAE,GAAG,IAAI,CAAC,eAAe,EAAE,WAAW,CAAC,CAAC,GACtE,SAAS,CAAC,CAAC,EAAE,KAAK,CAA8B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A function that always returns the param passed to it
|
|
3
|
+
* @signature
|
|
4
|
+
* P.identity(data)
|
|
5
|
+
* @example
|
|
6
|
+
* P.identity('foo') // => 'foo'
|
|
7
|
+
* @category Function
|
|
8
|
+
*/
|
|
9
|
+
export declare function identity<T>(value: T): T;
|
|
10
|
+
//# sourceMappingURL=identity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../../src/function/identity.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,KAEnC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './conditional';
|
|
2
|
+
export * from './create-pipe';
|
|
3
|
+
export * from './identity';
|
|
4
|
+
export * from './noop';
|
|
5
|
+
export * from './once';
|
|
6
|
+
export * from './debounce';
|
|
7
|
+
export * from './pipe';
|
|
8
|
+
export * from './purry';
|
|
9
|
+
export * from './sleep';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/function/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"noop.d.ts","sourceRoot":"","sources":["../../../src/function/noop.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,wBAAgB,IAAI,cAEnB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a function that is restricted to invoking `func` once. Repeat calls to the function return the value of the first invocation.
|
|
3
|
+
* @param fn the function to wrap
|
|
4
|
+
* @signature P.once(fn)
|
|
5
|
+
* @example
|
|
6
|
+
* const initialize = P.once(createApplication);
|
|
7
|
+
* initialize();
|
|
8
|
+
* initialize();
|
|
9
|
+
* // => `createApplication` is invoked once
|
|
10
|
+
* @category Function
|
|
11
|
+
*/
|
|
12
|
+
export declare function once<T>(fn: () => T): () => T;
|
|
13
|
+
//# sourceMappingURL=once.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"once.d.ts","sourceRoot":"","sources":["../../../src/function/once.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,wBAAgB,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,MAAM,CAAC,CAU5C"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Perform left-to-right function composition.
|
|
3
|
+
* @param value The initial value.
|
|
4
|
+
* @param arguments the list of operations to apply.
|
|
5
|
+
* @signature P.pipe(data, op1, op2, op3)
|
|
6
|
+
* @example
|
|
7
|
+
* P.pipe(
|
|
8
|
+
* [1, 2, 3, 4],
|
|
9
|
+
* P.map(x => x * 2),
|
|
10
|
+
* arr => [arr[0] + arr[1], arr[2] + arr[3]],
|
|
11
|
+
* ) // => [6, 14]
|
|
12
|
+
*
|
|
13
|
+
*
|
|
14
|
+
* @dataFirst
|
|
15
|
+
* @category Function
|
|
16
|
+
*/
|
|
17
|
+
export declare function pipe<A, B>(value: A, op1: (input: A) => B): B;
|
|
18
|
+
export declare function pipe<A, B, C>(value: A, op1: (input: A) => B, op2: (input: B) => C): C;
|
|
19
|
+
export declare function pipe<A, B, C, D>(value: A, op1: (input: A) => B, op2: (input: B) => C, op3: (input: C) => D): D;
|
|
20
|
+
export declare function pipe<A, B, C, D, E>(value: A, op1: (input: A) => B, op2: (input: B) => C, op3: (input: C) => D, op4: (input: D) => E): E;
|
|
21
|
+
export declare function pipe<A, B, C, D, E, F>(value: A, op1: (input: A) => B, op2: (input: B) => C, op3: (input: C) => D, op4: (input: D) => E, op5: (input: E) => F): F;
|
|
22
|
+
export declare function pipe<A, B, C, D, E, F, G>(value: A, op1: (input: A) => B, op2: (input: B) => C, op3: (input: C) => D, op4: (input: D) => E, op5: (input: E) => F, op6: (input: F) => G): G;
|
|
23
|
+
export declare function pipe<A, B, C, D, E, F, G, H>(value: A, op1: (input: A) => B, op2: (input: B) => C, op3: (input: C) => D, op4: (input: D) => E, op5: (input: E) => F, op6: (input: F) => G, op7: (input: G) => H): H;
|
|
24
|
+
export declare function pipe<A, B, C, D, E, F, G, H, I>(value: A, op1: (input: A) => B, op2: (input: B) => C, op3: (input: C) => D, op4: (input: D) => E, op5: (input: E) => F, op6: (input: F) => G, op7: (input: G) => H, op8: (input: H) => I): I;
|
|
25
|
+
export declare function pipe<A, B, C, D, E, F, G, H, I, J>(value: A, op1: (input: A) => B, op2: (input: B) => C, op3: (input: C) => D, op4: (input: D) => E, op5: (input: E) => F, op6: (input: F) => G, op7: (input: G) => H, op8: (input: H) => I, op9: (input: I) => J): J;
|
|
26
|
+
export declare function pipe<A, B, C, D, E, F, G, H, I, J, K>(value: A, op01: (input: A) => B, op02: (input: B) => C, op03: (input: C) => D, op04: (input: D) => E, op05: (input: E) => F, op06: (input: F) => G, op07: (input: G) => H, op08: (input: H) => I, op09: (input: I) => J, op10: (input: J) => K): K;
|
|
27
|
+
export declare function pipe<A, B, C, D, E, F, G, H, I, J, K, L>(value: A, op01: (input: A) => B, op02: (input: B) => C, op03: (input: C) => D, op04: (input: D) => E, op05: (input: E) => F, op06: (input: F) => G, op07: (input: G) => H, op08: (input: H) => I, op09: (input: I) => J, op10: (input: J) => K, op11: (input: K) => L): L;
|
|
28
|
+
export declare function pipe<A, B, C, D, E, F, G, H, I, J, K, L, M>(value: A, op01: (input: A) => B, op02: (input: B) => C, op03: (input: C) => D, op04: (input: D) => E, op05: (input: E) => F, op06: (input: F) => G, op07: (input: G) => H, op08: (input: H) => I, op09: (input: I) => J, op10: (input: J) => K, op11: (input: K) => L, op12: (input: L) => M): M;
|
|
29
|
+
export declare function pipe<A, B, C, D, E, F, G, H, I, J, K, L, M, N>(value: A, op01: (input: A) => B, op02: (input: B) => C, op03: (input: C) => D, op04: (input: D) => E, op05: (input: E) => F, op06: (input: F) => G, op07: (input: G) => H, op08: (input: H) => I, op09: (input: I) => J, op10: (input: J) => K, op11: (input: K) => L, op12: (input: L) => M, op13: (input: M) => N): N;
|
|
30
|
+
export declare function pipe<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O>(value: A, op01: (input: A) => B, op02: (input: B) => C, op03: (input: C) => D, op04: (input: D) => E, op05: (input: E) => F, op06: (input: F) => G, op07: (input: G) => H, op08: (input: H) => I, op09: (input: I) => J, op10: (input: J) => K, op11: (input: K) => L, op12: (input: L) => M, op13: (input: M) => N, op14: (input: N) => O): O;
|
|
31
|
+
export declare function pipe<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P>(value: A, op01: (input: A) => B, op02: (input: B) => C, op03: (input: C) => D, op04: (input: D) => E, op05: (input: E) => F, op06: (input: F) => G, op07: (input: G) => H, op08: (input: H) => I, op09: (input: I) => J, op10: (input: J) => K, op11: (input: K) => L, op12: (input: L) => M, op13: (input: M) => N, op14: (input: N) => O, op15: (input: O) => P): P;
|
|
32
|
+
//# sourceMappingURL=pipe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|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AAE,CAAC,KAAK,CAAC,EACrB,IAAI,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,EACrB,IAAI,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,EACrB,IAAI,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,EACrB,IAAI,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,EACrB,IAAI,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,EACrB,IAAI,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,EACrB,IAAI,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,EACrB,IAAI,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,EACrB,IAAI,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,GACpB,CAAC,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a function with `data-first` and `data-last` signatures.
|
|
3
|
+
*
|
|
4
|
+
* `purry` is a dynamic function and it's not type safe. It should be wrapped by a function that have proper typings.
|
|
5
|
+
* Refer to the example below for correct usage.
|
|
6
|
+
*
|
|
7
|
+
* @param fn the function to purry.
|
|
8
|
+
* @param args the arguments
|
|
9
|
+
* @signature P.purry(fn, arguments);
|
|
10
|
+
* @exampleRaw
|
|
11
|
+
* function _findIndex(array, fn) {
|
|
12
|
+
* for (let i = 0; i < array.length; i++) {
|
|
13
|
+
* if (fn(array[i])) {
|
|
14
|
+
* return i;
|
|
15
|
+
* }
|
|
16
|
+
* }
|
|
17
|
+
* return -1;
|
|
18
|
+
* }
|
|
19
|
+
*
|
|
20
|
+
* // data-first
|
|
21
|
+
* function findIndex<T>(array: T[], fn: (item: T) => boolean): number;
|
|
22
|
+
*
|
|
23
|
+
* // data-last
|
|
24
|
+
* function findIndex<T>(fn: (item: T) => boolean): (array: T[]) => number;
|
|
25
|
+
*
|
|
26
|
+
* function findIndex() {
|
|
27
|
+
* return P.purry(_findIndex, arguments);
|
|
28
|
+
* }
|
|
29
|
+
* @category Function
|
|
30
|
+
*/
|
|
31
|
+
export declare function purry(fn: any, args: IArguments | ReadonlyArray<any>, lazy?: any): any;
|
|
32
|
+
//# sourceMappingURL=purry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"purry.d.ts","sourceRoot":"","sources":["../../../src/function/purry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,KAAK,CACnB,EAAE,EAAE,GAAG,EACP,IAAI,EAAE,UAAU,GAAG,aAAa,CAAC,GAAG,CAAC,EACrC,IAAI,CAAC,EAAE,GAAG,OAmBX"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Delay execution for a given number of milliseconds.
|
|
3
|
+
*
|
|
4
|
+
* @param timeout the number of milliseconds to wait
|
|
5
|
+
* @signature
|
|
6
|
+
* P.sleep(timeout)
|
|
7
|
+
* @example
|
|
8
|
+
* P.sleep(1000) // => Promise<void>
|
|
9
|
+
* @category Function
|
|
10
|
+
*/
|
|
11
|
+
export declare function sleep(timeout: number): Promise<void>;
|
|
12
|
+
//# sourceMappingURL=sleep.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sleep.d.ts","sourceRoot":"","sources":["../../../src/function/sleep.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,wBAAgB,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAIpD"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export * from './is-array';
|
|
2
|
+
export * from './is-boolean';
|
|
3
|
+
export * from './is-date';
|
|
4
|
+
export * from './is-defined';
|
|
5
|
+
export * from './is-empty';
|
|
6
|
+
export * from './is-error';
|
|
7
|
+
export * from './is-function';
|
|
8
|
+
export * from './is-nil';
|
|
9
|
+
export * from './is-non-null';
|
|
10
|
+
export * from './is-not';
|
|
11
|
+
export * from './is-number';
|
|
12
|
+
export * from './is-object';
|
|
13
|
+
export * from './is-promise';
|
|
14
|
+
export * from './is-string';
|
|
15
|
+
export * from './is-symbol';
|
|
16
|
+
export * from './is-truthy';
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/guard/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { NarrowedTo } from '../utils/types';
|
|
2
|
+
/**
|
|
3
|
+
* A function that checks if the passed parameter is an Array and narrows its type accordingly
|
|
4
|
+
* @param data the variable to check
|
|
5
|
+
* @signature
|
|
6
|
+
* P.isArray(data)
|
|
7
|
+
* @returns true if the passed input is an Array, false otherwise
|
|
8
|
+
* @example
|
|
9
|
+
* P.isArray([5]) //=> true
|
|
10
|
+
* P.isArray([]) //=> true
|
|
11
|
+
* P.isArray('somethingElse') //=> false
|
|
12
|
+
* @category Guard
|
|
13
|
+
*/
|
|
14
|
+
export declare function isArray<T>(data: ArrayLike<unknown> | T): data is NarrowedTo<T, ReadonlyArray<unknown>>;
|
|
15
|
+
//# sourceMappingURL=is-array.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-array.d.ts","sourceRoot":"","sources":["../../../src/guard/is-array.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD;;;;;;;;;;;GAWG;AACH,wBAAgB,OAAO,CAAC,CAAC,EACvB,IAAI,EAAE,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,GAC3B,IAAI,IAAI,UAAU,CAAC,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC,CAE/C"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { NarrowedTo } from '../utils/types';
|
|
2
|
+
/**
|
|
3
|
+
* A function that checks if the passed parameter is a boolean and narrows its type accordingly
|
|
4
|
+
* @param data the variable to check
|
|
5
|
+
* @signature
|
|
6
|
+
* P.isBoolean(data)
|
|
7
|
+
* @returns true if the passed input is a boolean, false otherwise
|
|
8
|
+
* @example
|
|
9
|
+
* P.isBoolean(true) //=> true
|
|
10
|
+
* P.isBoolean(false) //=> true
|
|
11
|
+
* P.isBoolean('somethingElse') //=> false
|
|
12
|
+
* @category Guard
|
|
13
|
+
*/
|
|
14
|
+
export declare function isBoolean<T>(data: T | boolean): data is NarrowedTo<T, boolean>;
|
|
15
|
+
//# sourceMappingURL=is-boolean.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-boolean.d.ts","sourceRoot":"","sources":["../../../src/guard/is-boolean.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD;;;;;;;;;;;GAWG;AACH,wBAAgB,SAAS,CAAC,CAAC,EACzB,IAAI,EAAE,CAAC,GAAG,OAAO,GAChB,IAAI,IAAI,UAAU,CAAC,CAAC,EAAE,OAAO,CAAC,CAEhC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A function that checks if the passed parameter is a Date and narrows its type accordingly
|
|
3
|
+
* @param data the variable to check
|
|
4
|
+
* @signature
|
|
5
|
+
* P.isDate(data)
|
|
6
|
+
* @returns true if the passed input is a Date, false otherwise
|
|
7
|
+
* @example
|
|
8
|
+
* P.isDate(new Date()) //=> true
|
|
9
|
+
* P.isDate('somethingElse') //=> false
|
|
10
|
+
* @category Guard
|
|
11
|
+
*/
|
|
12
|
+
export declare function isDate(data: unknown): data is Date;
|
|
13
|
+
//# sourceMappingURL=is-date.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-date.d.ts","sourceRoot":"","sources":["../../../src/guard/is-date.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,IAAI,CAElD"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A function that checks if the passed parameter is defined and narrows its type accordingly.
|
|
3
|
+
* To test specifically for `undefined` (and not `null`) use the strict variant of this function.
|
|
4
|
+
* @param data the variable to check
|
|
5
|
+
* @signature
|
|
6
|
+
* P.isDefined(data)
|
|
7
|
+
* P.isDefined.strict(data)
|
|
8
|
+
* @returns true if the passed input is defined, false otherwise
|
|
9
|
+
* @example
|
|
10
|
+
* P.isDefined('string') //=> true
|
|
11
|
+
* P.isDefined(null) //=> false
|
|
12
|
+
* P.isDefined(undefined) //=> false
|
|
13
|
+
* P.isDefined.strict(null) //=> true
|
|
14
|
+
* P.isDefined.strict(undefined) //=> false
|
|
15
|
+
* @category Guard
|
|
16
|
+
* @strict
|
|
17
|
+
*/
|
|
18
|
+
export declare function isDefined<T>(data: T): data is NonNullable<T>;
|
|
19
|
+
export declare namespace isDefined {
|
|
20
|
+
function strict<T>(data: T | undefined): data is T;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=is-defined.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-defined.d.ts","sourceRoot":"","sources":["../../../src/guard/is-defined.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,IAAI,IAAI,WAAW,CAAC,CAAC,CAAC,CAE5D;AAED,yBAAiB,SAAS,CAAC;IACzB,SAAgB,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,SAAS,GAAG,IAAI,IAAI,CAAC,CAExD;CACF"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A function that checks if the passed parameter is empty
|
|
3
|
+
* @param data the variable to check
|
|
4
|
+
* @signature
|
|
5
|
+
* P.isEmpty(data)
|
|
6
|
+
* @returns true if the passed input is empty, false otherwise
|
|
7
|
+
* @example
|
|
8
|
+
* P.isEmpty('') //=> true
|
|
9
|
+
* P.isEmpty([]) //=> true
|
|
10
|
+
* P.isEmpty({}) //=> true
|
|
11
|
+
* P.isEmpty('test') //=> false
|
|
12
|
+
* P.isEmpty([1, 2, 3]) //=> false
|
|
13
|
+
* P.isEmpty({ length: 0 }) //=> false
|
|
14
|
+
* @category Function
|
|
15
|
+
*/
|
|
16
|
+
export declare function isEmpty(data: string): data is '';
|
|
17
|
+
export declare function isEmpty(data: [] | ReadonlyArray<unknown>): data is [];
|
|
18
|
+
export declare function isEmpty<T extends Readonly<Record<PropertyKey, unknown>>>(data: T): data is Record<keyof T, never>;
|
|
19
|
+
//# sourceMappingURL=is-empty.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-empty.d.ts","sourceRoot":"","sources":["../../../src/guard/is-empty.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;AAClD,wBAAgB,OAAO,CAAC,IAAI,EAAE,EAAE,GAAG,aAAa,CAAC,OAAO,CAAC,GAAG,IAAI,IAAI,EAAE,CAAC;AACvE,wBAAgB,OAAO,CAAC,CAAC,SAAS,QAAQ,CAAC,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,EACtE,IAAI,EAAE,CAAC,GACN,IAAI,IAAI,MAAM,CAAC,MAAM,CAAC,EAAE,KAAK,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
type DefinitelyError<T> = Extract<T, Error> extends never ? Error : Extract<T, Error>;
|
|
2
|
+
/**
|
|
3
|
+
* A function that checks if the passed parameter is an Error and narrows its type accordingly
|
|
4
|
+
* @param data the variable to check
|
|
5
|
+
* @signature
|
|
6
|
+
* P.isError(data)
|
|
7
|
+
* @returns true if the passed input is an Error, false otherwise
|
|
8
|
+
* @example
|
|
9
|
+
* P.isError(new Error('message')) //=> true
|
|
10
|
+
* P.isError('somethingElse') //=> false
|
|
11
|
+
* @category Guard
|
|
12
|
+
*/
|
|
13
|
+
export declare function isError<T>(data: Error | T): data is DefinitelyError<T>;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=is-error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-error.d.ts","sourceRoot":"","sources":["../../../src/guard/is-error.ts"],"names":[],"mappings":"AAAA,KAAK,eAAe,CAAC,CAAC,IACpB,OAAO,CAAC,CAAC,EAAE,KAAK,CAAC,SAAS,KAAK,GAAG,KAAK,GAAG,OAAO,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;AAE9D;;;;;;;;;;GAUG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,GAAG,CAAC,GAAG,IAAI,IAAI,eAAe,CAAC,CAAC,CAAC,CAEtE"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
type DefinitelyFunction<T> = Extract<T, Function> extends never ? Function : Extract<T, Function>;
|
|
2
|
+
/**
|
|
3
|
+
* A function that checks if the passed parameter is a Function and narrows its type accordingly
|
|
4
|
+
* @param data the variable to check
|
|
5
|
+
* @signature
|
|
6
|
+
* P.isFunction(data)
|
|
7
|
+
* @returns true if the passed input is a Function, false otherwise
|
|
8
|
+
* @example
|
|
9
|
+
* P.isFunction(() => {}) //=> true
|
|
10
|
+
* P.isFunction('somethingElse') //=> false
|
|
11
|
+
* @category Guard
|
|
12
|
+
*/
|
|
13
|
+
export declare function isFunction<T>(data: Function | T): data is DefinitelyFunction<T>;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=is-function.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-function.d.ts","sourceRoot":"","sources":["../../../src/guard/is-function.ts"],"names":[],"mappings":"AAAA,KAAK,kBAAkB,CAAC,CAAC,IACvB,OAAO,CAAC,CAAC,EAAE,QAAQ,CAAC,SAAS,KAAK,GAAG,QAAQ,GAAG,OAAO,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;AAEvE;;;;;;;;;;GAUG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAC1B,IAAI,EAAE,QAAQ,GAAG,CAAC,GACjB,IAAI,IAAI,kBAAkB,CAAC,CAAC,CAAC,CAE/B"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A function that checks if the passed parameter is Nil (null or undefined) and narrows its type accordingly
|
|
3
|
+
* @param data the variable to check
|
|
4
|
+
* @signature
|
|
5
|
+
* P.isNil(data)
|
|
6
|
+
* @returns true if the passed input is Nil (null or undefined), false otherwise
|
|
7
|
+
* @example
|
|
8
|
+
* P.isNil(undefined) //=> true
|
|
9
|
+
* P.isNil(null) //=> true
|
|
10
|
+
* P.isNil('somethingElse') //=> false
|
|
11
|
+
* @category Guard
|
|
12
|
+
*/
|
|
13
|
+
export declare function isNil<T>(data: T): data is Extract<T, null | undefined>;
|
|
14
|
+
//# sourceMappingURL=is-nil.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-nil.d.ts","sourceRoot":"","sources":["../../../src/guard/is-nil.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,IAAI,IAAI,OAAO,CAAC,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC,CAEtE"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A function that checks if the passed parameter is not `null` and narrows its type accordingly.
|
|
3
|
+
* Notice that `undefined` is not null!
|
|
4
|
+
* @param data the variable to check
|
|
5
|
+
* @signature
|
|
6
|
+
* P.isNonNull(data)
|
|
7
|
+
* @returns true if the passed input is defined, false otherwise
|
|
8
|
+
* @example
|
|
9
|
+
* P.isNonNull('string') //=> true
|
|
10
|
+
* P.isNonNull(null) //=> false
|
|
11
|
+
* P.isNonNull(undefined) //=> true
|
|
12
|
+
* @category Guard
|
|
13
|
+
*/
|
|
14
|
+
export declare function isNonNull<T>(data: T | null): data is T;
|
|
15
|
+
//# sourceMappingURL=is-non-null.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-non-null.d.ts","sourceRoot":"","sources":["../../../src/guard/is-non-null.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,IAAI,GAAG,IAAI,IAAI,CAAC,CAEtD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A function that takes a guard function as predicate and returns a guard that negates it
|
|
3
|
+
* @param predicate the guard function to negate
|
|
4
|
+
* @signature
|
|
5
|
+
* P.isNot(P.isTruthy)(data)
|
|
6
|
+
* @returns function A guard function
|
|
7
|
+
* @example
|
|
8
|
+
* P.isNot(P.isTruthy)(false) //=> true
|
|
9
|
+
* P.isNot(P.isTruthy)(true) //=> false
|
|
10
|
+
* @dataLast
|
|
11
|
+
* @category Guard
|
|
12
|
+
*/
|
|
13
|
+
export declare function isNot<T, S extends T>(predicate: (data: T) => data is S): (data: T) => data is Exclude<T, S>;
|
|
14
|
+
export declare function isNot<T>(predicate: (data: T) => any): (data: T) => boolean;
|
|
15
|
+
//# sourceMappingURL=is-not.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-not.d.ts","sourceRoot":"","sources":["../../../src/guard/is-not.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,EAClC,SAAS,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,IAAI,CAAC,GAChC,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACtC,wBAAgB,KAAK,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { NarrowedTo } from '../utils/types';
|
|
2
|
+
/**
|
|
3
|
+
* A function that checks if the passed parameter is a number and narrows its type accordingly
|
|
4
|
+
* @param data the variable to check
|
|
5
|
+
* @signature
|
|
6
|
+
* P.isNumber(data)
|
|
7
|
+
* @returns true if the passed input is a number, false otherwise
|
|
8
|
+
* @example
|
|
9
|
+
* P.isNumber(1) //=> true
|
|
10
|
+
* P.isNumber('notANumber') //=> false
|
|
11
|
+
* @category Guard
|
|
12
|
+
*/
|
|
13
|
+
export declare function isNumber<T>(data: T | number): data is NarrowedTo<T, number>;
|
|
14
|
+
//# sourceMappingURL=is-number.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-number.d.ts","sourceRoot":"","sources":["../../../src/guard/is-number.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD;;;;;;;;;;GAUG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,MAAM,GAAG,IAAI,IAAI,UAAU,CAAC,CAAC,EAAE,MAAM,CAAC,CAE3E"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { NarrowedTo } from '../utils/types';
|
|
2
|
+
/**
|
|
3
|
+
* Checks if `data` is a "plain" object. A plain object is defined as an object with string keys and values of any type, including primitives, other objects, functions, classes, etc (aka struct/shape/record/simple). Technically, a plain object is one whose prototype is either `Object.prototype` or `null`, ensuring it does not inherit properties or methods from other object types.
|
|
4
|
+
*
|
|
5
|
+
* This function is narrower in scope than `isObjectType`, which accepts any entity considered an `"object"` by JavaScript's `typeof`.
|
|
6
|
+
*
|
|
7
|
+
* Note that Maps, Arrays, and Sets are not considered plain objects and would return `false`.
|
|
8
|
+
*
|
|
9
|
+
* @param data - The variable to check.
|
|
10
|
+
* @returns - The input type, narrowed to only plain objects.
|
|
11
|
+
* @signature
|
|
12
|
+
* P.isObject(data)
|
|
13
|
+
* @example
|
|
14
|
+
* // true
|
|
15
|
+
* P.isObject({}) //=> true
|
|
16
|
+
* P.isObject({ a: 123 }) //=> true
|
|
17
|
+
*
|
|
18
|
+
* // false
|
|
19
|
+
* P.isObject([]) //=> false
|
|
20
|
+
* P.isObject(Promise.resolve("something")) //=> false
|
|
21
|
+
* P.isObject(new Date()) //=> false
|
|
22
|
+
* P.isObject(new Error("error")) //=> false
|
|
23
|
+
* P.isObject('somethingElse') //=> false
|
|
24
|
+
* P.isObject(null) //=> false
|
|
25
|
+
* @category Guard
|
|
26
|
+
*/
|
|
27
|
+
export declare function isObject<T>(data: Record<PropertyKey, unknown> | T): data is NarrowedTo<T, Record<PropertyKey, unknown>>;
|
|
28
|
+
//# sourceMappingURL=is-object.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-object.d.ts","sourceRoot":"","sources":["../../../src/guard/is-object.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EACxB,IAAI,EAAE,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,GAAG,CAAC,GACrC,IAAI,IAAI,UAAU,CAAC,CAAC,EAAE,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,CAOrD"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A function that checks if the passed parameter is a Promise and narrows its type accordingly
|
|
3
|
+
* @param data the variable to check
|
|
4
|
+
* @signature
|
|
5
|
+
* P.isPromise(data)
|
|
6
|
+
* @returns true if the passed input is a Promise, false otherwise
|
|
7
|
+
* @example
|
|
8
|
+
* P.isPromise(Promise.resolve(5)) //=> true
|
|
9
|
+
* P.isPromise(Promise.reject(5)) //=> true
|
|
10
|
+
* P.isPromise('somethingElse') //=> false
|
|
11
|
+
* @category Guard
|
|
12
|
+
*/
|
|
13
|
+
export declare function isPromise<T, S>(data: Promise<T> | S): data is Promise<T>;
|
|
14
|
+
//# sourceMappingURL=is-promise.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-promise.d.ts","sourceRoot":"","sources":["../../../src/guard/is-promise.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,IAAI,IAAI,OAAO,CAAC,CAAC,CAAC,CAExE"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { NarrowedTo } from '../utils/types';
|
|
2
|
+
/**
|
|
3
|
+
* A function that checks if the passed parameter is a string and narrows its type accordingly
|
|
4
|
+
* @param data the variable to check
|
|
5
|
+
* @signature
|
|
6
|
+
* P.isString(data)
|
|
7
|
+
* @returns true if the passed input is a string, false otherwise
|
|
8
|
+
* @example
|
|
9
|
+
* P.isString('string') //=> true
|
|
10
|
+
* P.isString(1) //=> false
|
|
11
|
+
* @category Guard
|
|
12
|
+
*/
|
|
13
|
+
export declare function isString<T>(data: T | string): data is NarrowedTo<T, string>;
|
|
14
|
+
//# sourceMappingURL=is-string.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-string.d.ts","sourceRoot":"","sources":["../../../src/guard/is-string.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD;;;;;;;;;;GAUG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,MAAM,GAAG,IAAI,IAAI,UAAU,CAAC,CAAC,EAAE,MAAM,CAAC,CAE3E"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { NarrowedTo } from '../utils/types';
|
|
2
|
+
/**
|
|
3
|
+
* A function that checks if the passed parameter is a symbol and narrows its type accordingly
|
|
4
|
+
* @param data the variable to check
|
|
5
|
+
* @signature
|
|
6
|
+
* P.isSymbol(data)
|
|
7
|
+
* @returns true if the passed input is a symbol, false otherwise
|
|
8
|
+
* @example
|
|
9
|
+
* P.isSymbol(Symbol('foo')) //=> true
|
|
10
|
+
* P.isSymbol(1) //=> false
|
|
11
|
+
* @category Guard
|
|
12
|
+
*/
|
|
13
|
+
export declare function isSymbol<T>(data: T | symbol): data is NarrowedTo<T, symbol>;
|
|
14
|
+
//# sourceMappingURL=is-symbol.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-symbol.d.ts","sourceRoot":"","sources":["../../../src/guard/is-symbol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD;;;;;;;;;;GAUG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,MAAM,GAAG,IAAI,IAAI,UAAU,CAAC,CAAC,EAAE,MAAM,CAAC,CAE3E"}
|