@vinicunca/perkakas 0.1.0 → 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 +35 -24
- package/dist/index.cjs +0 -2403
- package/dist/index.d.cts +0 -3378
- package/dist/index.d.ts +0 -3378
- package/dist/index.js +0 -2260
- package/dist/index.min.js +0 -2
- package/dist/index.min.js.map +0 -7
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/string/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Random a non-cryptographic random string from characters a-zA-Z0-9.
|
|
3
|
+
* @param length the length of the random string
|
|
4
|
+
* @signature randomString(length)
|
|
5
|
+
* @example
|
|
6
|
+
* randomString(5) // => aB92J
|
|
7
|
+
* @category String
|
|
8
|
+
*/
|
|
9
|
+
export declare function randomString(length: number): string;
|
|
10
|
+
//# sourceMappingURL=random-string.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"random-string.d.ts","sourceRoot":"","sources":["../../../src/string/random-string.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,UAO1C"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Turn any string into a URL/DOM safe string.
|
|
3
|
+
* @param str the string to slugify
|
|
4
|
+
* @signature
|
|
5
|
+
* P.slugify(str)
|
|
6
|
+
* @example
|
|
7
|
+
* P.slugify('FooBar') // => 'foobar'
|
|
8
|
+
* P.slugify('This!-is*&%#@^up!') // => 'this-is-up'
|
|
9
|
+
* @category String
|
|
10
|
+
*/
|
|
11
|
+
export declare function slugify(str: string): string;
|
|
12
|
+
//# sourceMappingURL=slugify.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slugify.d.ts","sourceRoot":"","sources":["../../../src/string/slugify.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAQ3C"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts a path string to an array of keys.
|
|
3
|
+
* @param path a string path
|
|
4
|
+
* @signature P.stringToPathArray(path)
|
|
5
|
+
* @example P.stringToPathArray('a.b[0].c') // => ['a', 'b', 0, 'c']
|
|
6
|
+
* @dataFirst
|
|
7
|
+
* @category String
|
|
8
|
+
*/
|
|
9
|
+
export declare function stringToPath<Path extends string>(path: Path): StringToPath<Path>;
|
|
10
|
+
export type StringToPath<T extends string> = T extends '' ? [] : T extends `[${infer Head}].${infer Tail}` ? [Head, ...StringToPath<Tail>] : T extends `.${infer Head}${infer Tail}` ? [Head, ...StringToPath<Tail>] : T extends `${infer Head}${infer Tail}` ? [Head, ...StringToPath<Tail>] : [T];
|
|
11
|
+
//# sourceMappingURL=string-to-path.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"string-to-path.d.ts","sourceRoot":"","sources":["../../../src/string/string-to-path.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,IAAI,SAAS,MAAM,EAC9C,IAAI,EAAE,IAAI,GACT,YAAY,CAAC,IAAI,CAAC,CAEpB;AAiBD,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,MAAM,IAAI,CAAC,SAAS,EAAE,GACrD,EAAE,GACF,CAAC,SAAS,IAAI,MAAM,IAAI,KAAK,MAAM,IAAI,EAAE,GACvC,CAAC,IAAI,EAAE,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC,GAC7B,CAAC,SAAS,IAAI,MAAM,IAAI,GAAG,MAAM,IAAI,EAAE,GACrC,CAAC,IAAI,EAAE,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC,GAC7B,CAAC,SAAS,GAAG,MAAM,IAAI,GAAG,MAAM,IAAI,EAAE,GACpC,CAAC,IAAI,EAAE,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC,GAC7B,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/type/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gives a single-word string description of the (native) type of a value, returning such answers as 'Object', 'Number', 'Array', or 'Null'. Does not attempt to distinguish user Object types any further, reporting them all as 'Object'.
|
|
3
|
+
* @param val
|
|
4
|
+
* @signature
|
|
5
|
+
* P.type(obj)
|
|
6
|
+
* @example
|
|
7
|
+
* P.type({}); //=> "Object"
|
|
8
|
+
* P.type(1); //=> "Number"
|
|
9
|
+
* P.type(false); //=> "Boolean"
|
|
10
|
+
* P.type('s'); //=> "String"
|
|
11
|
+
* P.type(null); //=> "Null"
|
|
12
|
+
* P.type([]); //=> "Array"
|
|
13
|
+
* P.type(/[A-z]/); //=> "RegExp"
|
|
14
|
+
* P.type(() => {}); //=> "Function"
|
|
15
|
+
* P.type(undefined); //=> "Undefined"
|
|
16
|
+
* @category Type
|
|
17
|
+
*/
|
|
18
|
+
export declare function type(val: unknown): string;
|
|
19
|
+
//# sourceMappingURL=type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../../src/type/type.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,IAAI,CAAC,GAAG,EAAE,OAAO,UAUhC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { CompareFunction } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Mutates an array into a "max"-heap based on `compareFn` so that for any `item` in the heap, `compareFn(heap[0], item) > 0`
|
|
4
|
+
*
|
|
5
|
+
* @param heap - The array to be heapified. The array would be mutated!
|
|
6
|
+
* @param compareFn - The comparator used to order items in the heap. Use the
|
|
7
|
+
* same function in all calls mutating the same heap otherwise you'd get
|
|
8
|
+
* unexpected results.
|
|
9
|
+
*/
|
|
10
|
+
export declare function heapify<T>(heap: Array<T>, compareFn: CompareFunction<T>): void;
|
|
11
|
+
/**
|
|
12
|
+
* Insert an item into a heap if it's "smaller" (in regards to `compareFn`) than
|
|
13
|
+
* the current head of the heap (which is the "largest" value in the heap). If
|
|
14
|
+
* the item is inserted, the previous head of the heap is returned, otherwise
|
|
15
|
+
* `undefined` is returned and the heap is unchanged.
|
|
16
|
+
*
|
|
17
|
+
* @param heap - a *mutable* array representing a heap (see `heapify`).
|
|
18
|
+
* @param compareFn - The comparator used to order items in the heap. Use the
|
|
19
|
+
* @param item - The item to be inserted into the heap.
|
|
20
|
+
* @returns `undefined` if the heap is unchanged, or the previous head of the
|
|
21
|
+
* heap if the item was inserted.
|
|
22
|
+
*/
|
|
23
|
+
export declare function heapMaybeInsert<T>(heap: Array<T>, compareFn: CompareFunction<T>, item: T): T | undefined;
|
|
24
|
+
//# sourceMappingURL=heap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"heap.d.ts","sourceRoot":"","sources":["../../../src/utils/heap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAK/C;;;;;;;GAOG;AACH,wBAAgB,OAAO,CAAC,CAAC,EACvB,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,EACd,SAAS,EAAE,eAAe,CAAC,CAAC,CAAC,GAC5B,IAAI,CAIN;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAC/B,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,EACd,SAAS,EAAE,eAAe,CAAC,CAAC,CAAC,EAC7B,IAAI,EAAE,CAAC,GACN,CAAC,GAAG,SAAS,CAef"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copied from ts-toolbelt
|
|
3
|
+
* https://github.com/millsp/ts-toolbelt/blob/master/sources/Function/Narrow.ts
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Similar to [[Cast]] but with a custom fallback `Catch`. If it fails,
|
|
7
|
+
* it will enforce `Catch` instead of `A2`.
|
|
8
|
+
* @param A1 to check against
|
|
9
|
+
* @param A2 to try/test with
|
|
10
|
+
* @param Catch to fallback to if the test failed
|
|
11
|
+
* @returns `A1 | Catch`
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* import {A} from 'ts-toolbelt'
|
|
15
|
+
*
|
|
16
|
+
* type test0 = A.Try<'42', string> // '42'
|
|
17
|
+
* type test1 = A.Try<'42', number> // never
|
|
18
|
+
* type test1 = A.Try<'42', number, 'tried'> // 'tried'
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export type Try<A1, A2, Catch = never> = A1 extends A2 ? A1 : Catch;
|
|
22
|
+
/**
|
|
23
|
+
* Describes types that can be narrowed
|
|
24
|
+
*/
|
|
25
|
+
export type Narrowable = bigint | boolean | number | string;
|
|
26
|
+
/**
|
|
27
|
+
* @hidden
|
|
28
|
+
*/
|
|
29
|
+
type NarrowRaw<A> = {
|
|
30
|
+
[K in keyof A]: A[K] extends (...args: Array<any>) => any ? A[K] : NarrowRaw<A[K]>;
|
|
31
|
+
} | (A extends [] ? [] : never) | (A extends Narrowable ? A : never);
|
|
32
|
+
/**
|
|
33
|
+
* Prevent type widening on generic function parameters
|
|
34
|
+
* @param A to narrow
|
|
35
|
+
* @returns `A`
|
|
36
|
+
* @example
|
|
37
|
+
* ```ts
|
|
38
|
+
* import {F} from 'ts-toolbelt'
|
|
39
|
+
*
|
|
40
|
+
* declare function foo<A extends any[]>(x: F.Narrow<A>): A;
|
|
41
|
+
* declare function bar<A extends object>(x: F.Narrow<A>): A;
|
|
42
|
+
*
|
|
43
|
+
* const test0 = foo(['e', 2, true, {f: ['g', ['h']]}])
|
|
44
|
+
* // `A` inferred : ['e', 2, true, {f: ['g']}]
|
|
45
|
+
*
|
|
46
|
+
* const test1 = bar({a: 1, b: 'c', d: ['e', 2, true, {f: ['g']}]})
|
|
47
|
+
* // `A` inferred : {a: 1, b: 'c', d: ['e', 2, true, {f: ['g']}]}
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
export type Narrow<A> = Try<A, [], NarrowRaw<A>>;
|
|
51
|
+
export {};
|
|
52
|
+
//# sourceMappingURL=narrow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"narrow.d.ts","sourceRoot":"","sources":["../../../src/utils/narrow.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,GAAG,CAAC,EAAE,EAAE,EAAE,EAAE,KAAK,GAAG,KAAK,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,KAAK,CAAC;AAEpE;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;AAE5D;;GAEG;AACH,KAAK,SAAS,CAAC,CAAC,IACZ;KACC,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,GAAG,GACrD,CAAC,CAAC,CAAC,CAAC,GACJ,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACpB,GACC,CAAC,CAAC,SAAS,EAAE,GAAG,EAAE,GAAG,KAAK,CAAC,GAC3B,CAAC,CAAC,SAAS,UAAU,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC;AAEvC;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,MAAM,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type Path<Obj, Prefix extends Array<PropertyKey> = []> = Obj extends Primitive ? Prefix : Obj extends Array<infer Item> ? Path<Item, [...Prefix, number]> | Prefix : PathsOfObject<Obj, Prefix> | Prefix;
|
|
2
|
+
type PathsOfObject<Obj, Prefix extends Array<PropertyKey>> = {
|
|
3
|
+
[K in keyof Obj]: Path<Obj[K], [...Prefix, K]>;
|
|
4
|
+
}[keyof Obj];
|
|
5
|
+
export type ValueAtPath<Obj, ObjPath extends Array<PropertyKey> = []> = ObjPath extends [] ? Obj : ObjPath extends [infer Head, ...infer Tail] ? Tail extends Array<PropertyKey> ? Head extends keyof Obj ? ValueAtPath<Obj[Head], Tail> : never : never : never;
|
|
6
|
+
export type SupportsValueAtPath<Obj, Path extends Array<PropertyKey>, Value> = Value extends ValueAtPath<Obj, Path> ? Obj : never;
|
|
7
|
+
type Primitive = boolean | null | number | string | symbol | undefined;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=paths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../../src/utils/paths.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,IAAI,CACd,GAAG,EACH,MAAM,SAAS,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE,IACpC,GAAG,SAAS,SAAS,GACrB,MAAM,GACN,GAAG,SAAS,KAAK,CAAC,MAAM,IAAI,CAAC,GAC3B,IAAI,CAAC,IAAI,EAAE,CAAC,GAAG,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,MAAM,GACxC,aAAa,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,MAAM,CAAC;AAE1C,KAAK,aAAa,CAAC,GAAG,EAAE,MAAM,SAAS,KAAK,CAAC,WAAW,CAAC,IAAI;KAC1D,CAAC,IAAI,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,CAAC,CAAC;CAC/C,CAAC,MAAM,GAAG,CAAC,CAAC;AAEb,MAAM,MAAM,WAAW,CACrB,GAAG,EACH,OAAO,SAAS,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE,IACrC,OAAO,SAAS,EAAE,GAClB,GAAG,GACH,OAAO,SAAS,CAAC,MAAM,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,GACzC,IAAI,SAAS,KAAK,CAAC,WAAW,CAAC,GAC7B,IAAI,SAAS,MAAM,GAAG,GACpB,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,GAC5B,KAAK,GACP,KAAK,GACP,KAAK,CAAC;AAEZ,MAAM,MAAM,mBAAmB,CAC7B,GAAG,EACH,IAAI,SAAS,KAAK,CAAC,WAAW,CAAC,EAC/B,KAAK,IACH,KAAK,SAAS,WAAW,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,GAAG,GAAG,KAAK,CAAC;AAEvD,KAAK,SAAS,GAAG,OAAO,GAAG,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility for purrying functions based on a predicate for the first argument.
|
|
3
|
+
*
|
|
4
|
+
* This is useful for purrying functions with a variadic argument list.
|
|
5
|
+
*/
|
|
6
|
+
export declare function purryOn<T>(isArg: (firstArg: unknown) => firstArg is T, implementation: (firstArg: T, ...args: Array<any>) => unknown, args: any): unknown;
|
|
7
|
+
//# sourceMappingURL=purry-on.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"purry-on.d.ts","sourceRoot":"","sources":["../../../src/utils/purry-on.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,CAAC,EACvB,KAAK,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,QAAQ,IAAI,CAAC,EAC3C,cAAc,EAAE,CAAC,QAAQ,EAAE,CAAC,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,OAAO,EAC7D,IAAI,EAAE,GAAG,GACR,OAAO,CAOT"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { CompareFunction } from './types';
|
|
2
|
+
declare const COMPARATORS: {
|
|
3
|
+
readonly asc: <T>(x: T, y: T) => boolean;
|
|
4
|
+
readonly desc: <T_1>(x: T_1, y: T_1) => boolean;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* An order rule defines a projection/extractor that returns a comparable from
|
|
8
|
+
* the data being compared. It would be run on each item being compared, and a
|
|
9
|
+
* comparator would then be used on the results to determine the order.
|
|
10
|
+
*
|
|
11
|
+
* There are 2 forms of the order rule, a simple one which only provides the
|
|
12
|
+
* projection function and assumes ordering is ascending, and a 2-tuple where
|
|
13
|
+
* the first element is the projection function and the second is the direction;
|
|
14
|
+
* this allows changing the direction without defining a more complex projection
|
|
15
|
+
* to simply negate the value (e.g. `(x) => -x`).
|
|
16
|
+
*
|
|
17
|
+
* We rely on the javascript implementation of `<` and `>` for comparison, which
|
|
18
|
+
* will attempt to transform both operands into a primitive comparable value via
|
|
19
|
+
* the built in `valueOf` function (and then `toString`). It's up to the caller
|
|
20
|
+
* to make sure that the projection is returning a value that makes sense for
|
|
21
|
+
* this logic.
|
|
22
|
+
*
|
|
23
|
+
* It's important to note that there is no built-in caching/memoization of
|
|
24
|
+
* projection function and therefore no guarantee that it would only be called
|
|
25
|
+
* once.
|
|
26
|
+
*/
|
|
27
|
+
export type OrderRule<T> = Projection<T> | readonly [projection: Projection<T>, direction: keyof typeof COMPARATORS];
|
|
28
|
+
type Projection<T> = (x: T) => Comparable;
|
|
29
|
+
type Comparable = {
|
|
30
|
+
[Symbol.toPrimitive](hint: string): ComparablePrimitive;
|
|
31
|
+
} | {
|
|
32
|
+
toString(): string;
|
|
33
|
+
} | {
|
|
34
|
+
valueOf(): ComparablePrimitive;
|
|
35
|
+
} | ComparablePrimitive;
|
|
36
|
+
type ComparablePrimitive = boolean | number | string;
|
|
37
|
+
/**
|
|
38
|
+
* Allows functions that want to handle a variadic number of order rules a
|
|
39
|
+
* a simplified API that hides most of the implementation details. The only
|
|
40
|
+
* thing users of this function need to do is provide a function that would take
|
|
41
|
+
* the data, and a compare function that can be used to determine the order
|
|
42
|
+
* between the items of the array.
|
|
43
|
+
* This functions takes care of the rest; it will parse rules, built the
|
|
44
|
+
* comparer, and manage the purrying of the input arguments.
|
|
45
|
+
*/
|
|
46
|
+
export declare function purryOrderRules<T>(func: (data: ReadonlyArray<T>, compareFn: CompareFunction<T>) => unknown, inputArgs: IArguments | ReadonlyArray<unknown>): unknown;
|
|
47
|
+
/**
|
|
48
|
+
* Some functions need an extra number argument, this helps facilitate that.
|
|
49
|
+
*/
|
|
50
|
+
export declare function purryOrderRulesWithArgument(func: <T>(data: ReadonlyArray<T>, compareFn: CompareFunction<T>, arg: any) => unknown, inputArgs: any[]): unknown;
|
|
51
|
+
export {};
|
|
52
|
+
//# sourceMappingURL=purry-order-rules.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"purry-order-rules.d.ts","sourceRoot":"","sources":["../../../src/utils/purry-order-rules.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAiB,MAAM,SAAS,CAAC;AAG9D,QAAA,MAAM,WAAW;;;CAGP,CAAC;AAEX;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,MAAM,SAAS,CAAC,CAAC,IACnB,UAAU,CAAC,CAAC,CAAC,GACb,SAAS,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,MAAM,OAAO,WAAW,CAAC,CAAC;AAE9E,KAAK,UAAU,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,UAAU,CAAC;AAK1C,KAAK,UAAU,GACX;IAAE,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,IAAI,EAAE,MAAM,GAAG,mBAAmB,CAAA;CAAE,GAC3D;IAAE,QAAQ,IAAI,MAAM,CAAA;CAAE,GACtB;IAAE,OAAO,IAAI,mBAAmB,CAAA;CAAE,GAClC,mBAAmB,CAAC;AAIxB,KAAK,mBAAmB,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;AAErD;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAC/B,IAAI,EAAE,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,eAAe,CAAC,CAAC,CAAC,KAAK,OAAO,EACxE,SAAS,EAAE,UAAU,GAAG,aAAa,CAAC,OAAO,CAAC,GAC7C,OAAO,CA0BT;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,CAAC,CAAC,EACN,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,EACtB,SAAS,EAAE,eAAe,CAAC,CAAC,CAAC,EAC7B,GAAG,EAAE,GAAG,KACL,OAAO,EACZ,SAAS,EAAE,GAAG,EAAE,GACf,OAAO,CAiBT"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A simple implementation of the *QuickSelect* algorithm.
|
|
3
|
+
* @see https://en.wikipedia.org/wiki/Quickselect
|
|
4
|
+
*/
|
|
5
|
+
import type { CompareFunction } from './types';
|
|
6
|
+
/**
|
|
7
|
+
* Perform QuickSelect on the given data. Notice that the data would be cloned
|
|
8
|
+
* shallowly so that it could be mutated in-place, and then discarded once the
|
|
9
|
+
* algorithm is done. This means that running this function multiple times on
|
|
10
|
+
* the same array might be slower then sorting the array before.
|
|
11
|
+
* @param data - The data to perform the selection on.
|
|
12
|
+
* @param index - The index of the item we are looking for.
|
|
13
|
+
* @param compareFn - The compare function to use for sorting.
|
|
14
|
+
* @returns The item at the given index, or `undefined` if the index is out-of-
|
|
15
|
+
* bounds.
|
|
16
|
+
*/
|
|
17
|
+
export declare function quickSelect<T>(data: ReadonlyArray<T>, index: number, compareFn: CompareFunction<T>): T | undefined;
|
|
18
|
+
//# sourceMappingURL=quick-select.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quick-select.d.ts","sourceRoot":"","sources":["../../../src/utils/quick-select.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAI/C;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,EACnD,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,eAAe,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,SAAS,CAY9C"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type LazyResult<T> = LazyEmpty | LazyMany<T> | LazyNext<T>;
|
|
2
|
+
interface LazyEmpty {
|
|
3
|
+
done: boolean;
|
|
4
|
+
hasMany?: false | undefined;
|
|
5
|
+
hasNext: false;
|
|
6
|
+
next?: undefined;
|
|
7
|
+
}
|
|
8
|
+
interface LazyNext<T> {
|
|
9
|
+
done: boolean;
|
|
10
|
+
hasMany?: false | undefined;
|
|
11
|
+
hasNext: true;
|
|
12
|
+
next: T;
|
|
13
|
+
}
|
|
14
|
+
interface LazyMany<T> {
|
|
15
|
+
done: boolean;
|
|
16
|
+
hasMany: true;
|
|
17
|
+
hasNext: true;
|
|
18
|
+
next: Array<T>;
|
|
19
|
+
}
|
|
20
|
+
export declare function reduceLazy<T, K>(array: ReadonlyArray<T>, lazy: (item: T, index?: number, array?: ReadonlyArray<T>) => LazyResult<K>, indexed?: boolean): Array<K>;
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=reduce-lazy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reduce-lazy.d.ts","sourceRoot":"","sources":["../../../src/utils/reduce-lazy.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI,SAAS,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;AAElE,UAAU,SAAS;IACjB,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,CAAC,EAAE,KAAK,GAAG,SAAS,CAAC;IAC5B,OAAO,EAAE,KAAK,CAAC;IACf,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAED,UAAU,QAAQ,CAAC,CAAC;IAClB,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,CAAC,EAAE,KAAK,GAAG,SAAS,CAAC;IAC5B,OAAO,EAAE,IAAI,CAAC;IACd,IAAI,EAAE,CAAC,CAAC;CACT;AAED,UAAU,QAAQ,CAAC,CAAC;IAClB,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,IAAI,CAAC;IACd,OAAO,EAAE,IAAI,CAAC;IACd,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;CAChB;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,CAAC,EAC7B,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,EACvB,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,UAAU,CAAC,CAAC,CAAC,EAC1E,OAAO,CAAC,EAAE,OAAO,GAChB,KAAK,CAAC,CAAC,CAAC,CAaV"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"swap-in-place.d.ts","sourceRoot":"","sources":["../../../src/utils/swap-in-place.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAI5E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"to-lazy-indexed.d.ts","sourceRoot":"","sources":["../../../src/utils/to-lazy-indexed.ts"],"names":[],"mappings":"AAAA,wBAAgB,aAAa,CAAC,IAAI,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,KAAK,OAAO,EAAE,EAAE,EAAE,IAAI,GAAG,IAAI,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAA;CAAE,CAEjH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"to-single.d.ts","sourceRoot":"","sources":["../../../src/utils/to-single.ts"],"names":[],"mappings":"AAAA,wBAAgB,QAAQ,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG;IAAE,MAAM,EAAE,IAAI,CAAA;CAAE,CAGvD"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { IsAny } from 'type-fest';
|
|
2
|
+
export type Pred<T, K> = (input: T) => K;
|
|
3
|
+
export type PredIndexed<T, K> = (input: T, index: number, array: Array<T>) => K;
|
|
4
|
+
export type PredIndexedOptional<T, K> = (input: T, index?: number, array?: ReadonlyArray<T>) => K;
|
|
5
|
+
export type NonEmptyArray<T> = [T, ...Array<T>];
|
|
6
|
+
/**
|
|
7
|
+
* This should only be used for defining generics which extend any kind of JS
|
|
8
|
+
* array under the hood, this includes arrays *AND* tuples (of the form [x, y],
|
|
9
|
+
* and of the form [x, ...y[]], etc...), and their readonly equivalent. This
|
|
10
|
+
* allows us to be more inclusive to what functions can process.
|
|
11
|
+
*
|
|
12
|
+
* @example map<T extends ArrayLike>(items: T) { ... }
|
|
13
|
+
*
|
|
14
|
+
* We would've named this `ArrayLike`, but that's already used by typescript...
|
|
15
|
+
*
|
|
16
|
+
* @see This was inspired by the type-definition of Promise.all (https://github.com/microsoft/TypeScript/blob/1df5717b120cddd325deab8b0f2b2c3eecaf2b01/src/lib/es2015.promise.d.ts#L21)
|
|
17
|
+
*/
|
|
18
|
+
export type IterableContainer<T = unknown> = [] | ReadonlyArray<T>;
|
|
19
|
+
/**
|
|
20
|
+
* A compare function that is compatible with the native `Array.sort` function.
|
|
21
|
+
* @returns >0 if `a` should come after `b`, 0 if they are equal, and <0 if `a` should come before `b`.
|
|
22
|
+
*/
|
|
23
|
+
export type CompareFunction<T> = (a: T, b: T) => number;
|
|
24
|
+
export type ObjectKeys<T extends object> = `${Exclude<keyof T, symbol>}`;
|
|
25
|
+
/**
|
|
26
|
+
* An extension of Extract for type predicates which falls back to the base
|
|
27
|
+
* in order to narrow the `unknown` case.
|
|
28
|
+
* @example
|
|
29
|
+
* function isMyType<T>(data: T | MyType): data is NarrowedTo<T, MyType> { ... }
|
|
30
|
+
*/
|
|
31
|
+
export type NarrowedTo<T, Base> = Extract<T, Base> extends never ? Base : IsAny<T> extends true ? Base : Extract<T, Base>;
|
|
32
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/utils/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAEvC,MAAM,MAAM,IAAI,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,CAAC;AACzC,MAAM,MAAM,WAAW,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;AAChF,MAAM,MAAM,mBAAmB,CAAC,CAAC,EAAE,CAAC,IAAI,CACtC,KAAK,EAAE,CAAC,EACR,KAAK,CAAC,EAAE,MAAM,EACd,KAAK,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,KACrB,CAAC,CAAC;AAEP,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AAEhD;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,iBAAiB,CAAC,CAAC,GAAG,OAAO,IAAI,EAAE,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;AAEnE;;;GAGG;AACH,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,MAAM,CAAC;AAIxD,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,EAAE,CAAC;AAEzE;;;;;GAKG;AACH,MAAM,MAAM,UAAU,CAAC,CAAC,EAAE,IAAI,IAC5B,OAAO,CAAC,CAAC,EAAE,IAAI,CAAC,SAAS,KAAK,GAC1B,IAAI,GACJ,KAAK,CAAC,CAAC,CAAC,SAAS,IAAI,GACnB,IAAI,GACJ,OAAO,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"with-precision.d.ts","sourceRoot":"","sources":["../../../src/utils/with-precision.ts"],"names":[],"mappings":"AAKA,wBAAgB,aAAa,CAAC,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,WAClD,MAAM,aAAa,MAAM,YAqBzC"}
|
package/package.json
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vinicunca/perkakas",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1
|
|
4
|
+
"version": "0.3.1",
|
|
5
|
+
"packageManager": "pnpm@8.10.5",
|
|
5
6
|
"description": "Utility for JavaScript and Typescript.",
|
|
6
|
-
"author":
|
|
7
|
-
"name": "praburangki",
|
|
8
|
-
"email": "praburangki@gmail.com",
|
|
9
|
-
"url": "https://praburangki.dev"
|
|
10
|
-
},
|
|
7
|
+
"author": "praburangki<https://github.com/praburangki>",
|
|
11
8
|
"license": "MIT",
|
|
12
9
|
"homepage": "https://github.com/vinicunca/perkakas#readme",
|
|
13
10
|
"repository": {
|
|
@@ -25,33 +22,47 @@
|
|
|
25
22
|
"javascript helpers",
|
|
26
23
|
"typescript helpers"
|
|
27
24
|
],
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
},
|
|
34
|
-
"main": "./dist/index.js",
|
|
35
|
-
"types": "./dist/index.d.ts",
|
|
25
|
+
"sideEffects": false,
|
|
26
|
+
"main": "dist/commonjs/index.js",
|
|
27
|
+
"module": "dist/es/index.js",
|
|
28
|
+
"jsnext:main": "dist/es/index.js",
|
|
29
|
+
"types": "dist/types/index.d.ts",
|
|
36
30
|
"files": [
|
|
37
|
-
"dist"
|
|
31
|
+
"dist/*"
|
|
38
32
|
],
|
|
39
33
|
"engines": {
|
|
40
|
-
"node": ">=
|
|
34
|
+
"node": ">=20.0.0"
|
|
41
35
|
},
|
|
42
36
|
"devDependencies": {
|
|
37
|
+
"@tsconfig/recommended": "^1.0.3",
|
|
43
38
|
"@types/fs-extra": "^11.0.4",
|
|
44
|
-
"@
|
|
39
|
+
"@vinicunca/eslint-config": "^2.1.5",
|
|
40
|
+
"@vitest/coverage-v8": "^1.3.1",
|
|
41
|
+
"bumpp": "^9.3.1",
|
|
42
|
+
"eslint": "^8.57.0",
|
|
45
43
|
"fs-extra": "^11.2.0",
|
|
46
|
-
"
|
|
47
|
-
"
|
|
44
|
+
"is-ci": "^3.0.1",
|
|
45
|
+
"prettier": "^3.2.5",
|
|
46
|
+
"rimraf": "^5.0.5",
|
|
47
|
+
"tiny-invariant": "^1.3.3",
|
|
48
|
+
"type-fest": "^4.10.3",
|
|
49
|
+
"typedoc": "^0.25.10",
|
|
50
|
+
"typescript": "^5.3.3",
|
|
51
|
+
"vitest": "^1.3.1"
|
|
48
52
|
},
|
|
49
53
|
"scripts": {
|
|
50
|
-
"stub": "tsup src/index.ts --format esm",
|
|
51
|
-
"lint": "pnpm run stub && eslint . --fix",
|
|
52
|
-
"test:coverage": "vitest run --coverage",
|
|
53
54
|
"test": "vitest",
|
|
54
|
-
"
|
|
55
|
-
"
|
|
55
|
+
"test:coverage": "vitest run --coverage",
|
|
56
|
+
"postinstall": "is-ci || pnpm -r run stub",
|
|
57
|
+
"prepublish": "pnpm run build",
|
|
58
|
+
"release": "bumpp package.json --commit --push --tag --commit 'chore: release v'",
|
|
59
|
+
"typedoc": "typedoc --json dist/metadata.json",
|
|
60
|
+
"build": "pnpm run clean && pnpm run build:es && pnpm run build:cjs && npm run build:types && pnpm run typedoc",
|
|
61
|
+
"build:cjs": "tsc --project tsconfig.build.json --module commonjs --outDir \"./dist/commonjs\"",
|
|
62
|
+
"build:es": "tsc --project tsconfig.build.json --module esnext --outDir \"./dist/es\"",
|
|
63
|
+
"build:types": "tsc --project tsconfig.build.types.json --outDir \"./dist/types\"",
|
|
64
|
+
"clean": "rm -rf ./dist && mkdir dist",
|
|
65
|
+
"lint": "pnpm run stub && eslint . --fix",
|
|
66
|
+
"registry": "pnpm publish --access public --no-git-checks"
|
|
56
67
|
}
|
|
57
68
|
}
|