es-toolkit 1.48.1 → 1.49.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/dist/array/chunkBy.d.mts +32 -0
- package/dist/array/chunkBy.d.ts +32 -0
- package/dist/array/chunkBy.js +42 -0
- package/dist/array/chunkBy.mjs +42 -0
- package/dist/array/index.d.mts +2 -1
- package/dist/array/index.d.ts +2 -1
- package/dist/array/index.js +2 -0
- package/dist/array/index.mjs +2 -1
- package/dist/array/take.d.mts +1 -7
- package/dist/array/take.d.ts +1 -7
- package/dist/array/take.js +1 -9
- package/dist/array/take.mjs +1 -9
- package/dist/array/takeRight.d.mts +2 -2
- package/dist/array/takeRight.d.ts +2 -2
- package/dist/array/takeRight.js +2 -4
- package/dist/array/takeRight.mjs +2 -4
- package/dist/array/windowed.d.mts +1 -1
- package/dist/array/windowed.d.ts +1 -1
- package/dist/browser.global.js +3 -3
- package/dist/compat/array/chunk.js +4 -2
- package/dist/compat/array/chunk.mjs +4 -2
- package/dist/compat/array/differenceBy.js +5 -5
- package/dist/compat/array/differenceBy.mjs +5 -5
- package/dist/compat/array/drop.d.mts +2 -3
- package/dist/compat/array/drop.d.ts +2 -3
- package/dist/compat/array/drop.js +4 -4
- package/dist/compat/array/drop.mjs +4 -4
- package/dist/compat/array/dropRight.js +1 -1
- package/dist/compat/array/dropRight.mjs +1 -1
- package/dist/compat/array/dropRightWhile.d.mts +1 -1
- package/dist/compat/array/dropRightWhile.d.ts +1 -1
- package/dist/compat/array/dropRightWhile.js +5 -4
- package/dist/compat/array/dropRightWhile.mjs +5 -4
- package/dist/compat/array/dropWhile.d.mts +2 -2
- package/dist/compat/array/dropWhile.d.ts +2 -2
- package/dist/compat/array/dropWhile.js +4 -4
- package/dist/compat/array/dropWhile.mjs +4 -4
- package/dist/compat/array/findLast.js +1 -1
- package/dist/compat/array/findLast.mjs +1 -1
- package/dist/compat/array/includes.js +1 -1
- package/dist/compat/array/includes.mjs +1 -1
- package/dist/compat/array/nth.js +1 -1
- package/dist/compat/array/nth.mjs +1 -1
- package/dist/compat/array/slice.js +1 -1
- package/dist/compat/array/slice.mjs +1 -1
- package/dist/compat/array/sortedIndexBy.js +1 -1
- package/dist/compat/array/sortedIndexBy.mjs +1 -1
- package/dist/compat/array/take.js +2 -2
- package/dist/compat/array/take.mjs +2 -2
- package/dist/compat/array/takeRight.js +1 -1
- package/dist/compat/array/takeRight.mjs +1 -1
- package/dist/compat/compat.js +4 -4
- package/dist/compat/compat.mjs +4 -4
- package/dist/compat/index.js +4 -4
- package/dist/compat/index.mjs +4 -4
- package/dist/compat/math/add.js +1 -1
- package/dist/compat/math/add.mjs +1 -1
- package/dist/compat/math/divide.js +1 -1
- package/dist/compat/math/divide.mjs +1 -1
- package/dist/compat/math/multiply.js +1 -1
- package/dist/compat/math/multiply.mjs +1 -1
- package/dist/compat/math/random.js +3 -1
- package/dist/compat/math/random.mjs +3 -1
- package/dist/compat/math/subtract.js +1 -1
- package/dist/compat/math/subtract.mjs +1 -1
- package/dist/compat/object/get.js +1 -1
- package/dist/compat/object/get.mjs +1 -1
- package/dist/compat/object/omitBy.js +1 -1
- package/dist/compat/object/omitBy.mjs +1 -1
- package/dist/compat/object/pick.js +1 -1
- package/dist/compat/object/pick.mjs +1 -1
- package/dist/compat/object/pickBy.js +1 -1
- package/dist/compat/object/pickBy.mjs +1 -1
- package/dist/compat/string/repeat.js +1 -1
- package/dist/compat/string/repeat.mjs +1 -1
- package/dist/fp/_internal/lazy.js +58 -0
- package/dist/fp/_internal/lazy.mjs +57 -0
- package/dist/fp/array/at.d.mts +20 -0
- package/dist/fp/array/at.d.ts +20 -0
- package/dist/fp/array/at.js +25 -0
- package/dist/fp/array/at.mjs +25 -0
- package/dist/fp/array/cartesianProduct.d.mts +61 -0
- package/dist/fp/array/cartesianProduct.d.ts +61 -0
- package/dist/fp/array/cartesianProduct.js +9 -0
- package/dist/fp/array/cartesianProduct.mjs +9 -0
- package/dist/fp/array/chunk.d.mts +19 -0
- package/dist/fp/array/chunk.d.ts +19 -0
- package/dist/fp/array/chunk.js +24 -0
- package/dist/fp/array/chunk.mjs +24 -0
- package/dist/fp/array/chunkBy.d.mts +20 -0
- package/dist/fp/array/chunkBy.d.ts +20 -0
- package/dist/fp/array/chunkBy.js +25 -0
- package/dist/fp/array/chunkBy.mjs +25 -0
- package/dist/fp/array/combinations.d.mts +21 -0
- package/dist/fp/array/combinations.d.ts +21 -0
- package/dist/fp/array/combinations.js +26 -0
- package/dist/fp/array/combinations.mjs +26 -0
- package/dist/fp/array/compact.d.mts +22 -0
- package/dist/fp/array/compact.d.ts +22 -0
- package/dist/fp/array/compact.js +31 -0
- package/dist/fp/array/compact.mjs +30 -0
- package/dist/fp/array/countBy.d.mts +21 -0
- package/dist/fp/array/countBy.d.ts +21 -0
- package/dist/fp/array/countBy.js +26 -0
- package/dist/fp/array/countBy.mjs +26 -0
- package/dist/fp/array/difference.d.mts +21 -0
- package/dist/fp/array/difference.d.ts +21 -0
- package/dist/fp/array/difference.js +32 -0
- package/dist/fp/array/difference.mjs +31 -0
- package/dist/fp/array/differenceBy.d.mts +22 -0
- package/dist/fp/array/differenceBy.d.ts +22 -0
- package/dist/fp/array/differenceBy.js +33 -0
- package/dist/fp/array/differenceBy.mjs +32 -0
- package/dist/fp/array/differenceWith.d.mts +22 -0
- package/dist/fp/array/differenceWith.d.ts +22 -0
- package/dist/fp/array/differenceWith.js +32 -0
- package/dist/fp/array/differenceWith.mjs +31 -0
- package/dist/fp/array/drop.d.mts +20 -0
- package/dist/fp/array/drop.d.ts +20 -0
- package/dist/fp/array/drop.js +31 -0
- package/dist/fp/array/drop.mjs +30 -0
- package/dist/fp/array/dropRight.d.mts +20 -0
- package/dist/fp/array/dropRight.d.ts +20 -0
- package/dist/fp/array/dropRight.js +25 -0
- package/dist/fp/array/dropRight.mjs +25 -0
- package/dist/fp/array/dropRightWhile.d.mts +20 -0
- package/dist/fp/array/dropRightWhile.d.ts +20 -0
- package/dist/fp/array/dropRightWhile.js +25 -0
- package/dist/fp/array/dropRightWhile.mjs +25 -0
- package/dist/fp/array/dropWhile.d.mts +20 -0
- package/dist/fp/array/dropWhile.d.ts +20 -0
- package/dist/fp/array/dropWhile.js +36 -0
- package/dist/fp/array/dropWhile.mjs +36 -0
- package/dist/fp/array/filter.d.mts +45 -0
- package/dist/fp/array/filter.d.ts +45 -0
- package/dist/fp/array/filter.js +13 -0
- package/dist/fp/array/filter.mjs +12 -0
- package/dist/fp/array/find.d.mts +39 -0
- package/dist/fp/array/find.d.ts +39 -0
- package/dist/fp/array/find.js +8 -0
- package/dist/fp/array/find.mjs +8 -0
- package/dist/fp/array/findIndex.d.mts +20 -0
- package/dist/fp/array/findIndex.d.ts +20 -0
- package/dist/fp/array/findIndex.js +24 -0
- package/dist/fp/array/findIndex.mjs +24 -0
- package/dist/fp/array/findLast.d.mts +39 -0
- package/dist/fp/array/findLast.d.ts +39 -0
- package/dist/fp/array/findLast.js +11 -0
- package/dist/fp/array/findLast.mjs +11 -0
- package/dist/fp/array/findLastIndex.d.mts +20 -0
- package/dist/fp/array/findLastIndex.d.ts +20 -0
- package/dist/fp/array/findLastIndex.js +25 -0
- package/dist/fp/array/findLastIndex.mjs +25 -0
- package/dist/fp/array/flatMap.d.mts +28 -0
- package/dist/fp/array/flatMap.d.ts +28 -0
- package/dist/fp/array/flatMap.js +39 -0
- package/dist/fp/array/flatMap.mjs +38 -0
- package/dist/fp/array/flatMapDeep.d.mts +23 -0
- package/dist/fp/array/flatMapDeep.d.ts +23 -0
- package/dist/fp/array/flatMapDeep.js +38 -0
- package/dist/fp/array/flatMapDeep.mjs +37 -0
- package/dist/fp/array/flatten.d.mts +21 -0
- package/dist/fp/array/flatten.d.ts +21 -0
- package/dist/fp/array/flatten.js +39 -0
- package/dist/fp/array/flatten.mjs +38 -0
- package/dist/fp/array/flattenDeep.d.mts +21 -0
- package/dist/fp/array/flattenDeep.d.ts +21 -0
- package/dist/fp/array/flattenDeep.js +36 -0
- package/dist/fp/array/flattenDeep.mjs +35 -0
- package/dist/fp/array/forEach.d.mts +22 -0
- package/dist/fp/array/forEach.d.ts +22 -0
- package/dist/fp/array/forEach.js +33 -0
- package/dist/fp/array/forEach.mjs +32 -0
- package/dist/fp/array/groupBy.d.mts +21 -0
- package/dist/fp/array/groupBy.d.ts +21 -0
- package/dist/fp/array/groupBy.js +26 -0
- package/dist/fp/array/groupBy.mjs +26 -0
- package/dist/fp/array/head.d.mts +35 -0
- package/dist/fp/array/head.d.ts +35 -0
- package/dist/fp/array/head.js +9 -0
- package/dist/fp/array/head.mjs +9 -0
- package/dist/fp/array/index.d.mts +69 -0
- package/dist/fp/array/index.d.ts +69 -0
- package/dist/fp/array/index.js +68 -0
- package/dist/fp/array/index.mjs +68 -0
- package/dist/fp/array/initial.d.mts +19 -0
- package/dist/fp/array/initial.d.ts +19 -0
- package/dist/fp/array/initial.js +24 -0
- package/dist/fp/array/initial.mjs +24 -0
- package/dist/fp/array/intersection.d.mts +21 -0
- package/dist/fp/array/intersection.d.ts +21 -0
- package/dist/fp/array/intersection.js +32 -0
- package/dist/fp/array/intersection.mjs +31 -0
- package/dist/fp/array/intersectionBy.d.mts +22 -0
- package/dist/fp/array/intersectionBy.d.ts +22 -0
- package/dist/fp/array/intersectionBy.js +33 -0
- package/dist/fp/array/intersectionBy.mjs +32 -0
- package/dist/fp/array/intersectionWith.d.mts +22 -0
- package/dist/fp/array/intersectionWith.d.ts +22 -0
- package/dist/fp/array/intersectionWith.js +32 -0
- package/dist/fp/array/intersectionWith.mjs +31 -0
- package/dist/fp/array/isSubset.d.mts +20 -0
- package/dist/fp/array/isSubset.d.ts +20 -0
- package/dist/fp/array/isSubset.js +25 -0
- package/dist/fp/array/isSubset.mjs +25 -0
- package/dist/fp/array/isSubsetWith.d.mts +21 -0
- package/dist/fp/array/isSubsetWith.d.ts +21 -0
- package/dist/fp/array/isSubsetWith.js +26 -0
- package/dist/fp/array/isSubsetWith.mjs +26 -0
- package/dist/fp/array/join.d.mts +20 -0
- package/dist/fp/array/join.d.ts +20 -0
- package/dist/fp/array/join.js +24 -0
- package/dist/fp/array/join.mjs +24 -0
- package/dist/fp/array/keyBy.d.mts +21 -0
- package/dist/fp/array/keyBy.d.ts +21 -0
- package/dist/fp/array/keyBy.js +26 -0
- package/dist/fp/array/keyBy.mjs +26 -0
- package/dist/fp/array/last.d.mts +35 -0
- package/dist/fp/array/last.d.ts +35 -0
- package/dist/fp/array/last.js +9 -0
- package/dist/fp/array/last.mjs +9 -0
- package/dist/fp/array/length.d.mts +18 -0
- package/dist/fp/array/length.d.ts +18 -0
- package/dist/fp/array/length.js +22 -0
- package/dist/fp/array/length.mjs +22 -0
- package/dist/fp/array/map.d.mts +27 -0
- package/dist/fp/array/map.d.ts +27 -0
- package/dist/fp/array/map.js +36 -0
- package/dist/fp/array/map.mjs +35 -0
- package/dist/fp/array/maxBy.d.mts +37 -0
- package/dist/fp/array/maxBy.d.ts +37 -0
- package/dist/fp/array/maxBy.js +9 -0
- package/dist/fp/array/maxBy.mjs +9 -0
- package/dist/fp/array/minBy.d.mts +37 -0
- package/dist/fp/array/minBy.d.ts +37 -0
- package/dist/fp/array/minBy.js +9 -0
- package/dist/fp/array/minBy.mjs +9 -0
- package/dist/fp/array/orderBy.d.mts +21 -0
- package/dist/fp/array/orderBy.d.ts +21 -0
- package/dist/fp/array/orderBy.js +26 -0
- package/dist/fp/array/orderBy.mjs +26 -0
- package/dist/fp/array/partition.d.mts +39 -0
- package/dist/fp/array/partition.d.ts +39 -0
- package/dist/fp/array/partition.js +9 -0
- package/dist/fp/array/partition.mjs +9 -0
- package/dist/fp/array/reverse.d.mts +19 -0
- package/dist/fp/array/reverse.d.ts +19 -0
- package/dist/fp/array/reverse.js +23 -0
- package/dist/fp/array/reverse.mjs +23 -0
- package/dist/fp/array/sample.d.mts +18 -0
- package/dist/fp/array/sample.d.ts +18 -0
- package/dist/fp/array/sample.js +23 -0
- package/dist/fp/array/sample.mjs +23 -0
- package/dist/fp/array/sampleSize.d.mts +20 -0
- package/dist/fp/array/sampleSize.d.ts +20 -0
- package/dist/fp/array/sampleSize.js +25 -0
- package/dist/fp/array/sampleSize.mjs +25 -0
- package/dist/fp/array/shuffle.d.mts +19 -0
- package/dist/fp/array/shuffle.d.ts +19 -0
- package/dist/fp/array/shuffle.js +24 -0
- package/dist/fp/array/shuffle.mjs +24 -0
- package/dist/fp/array/sortBy.d.mts +26 -0
- package/dist/fp/array/sortBy.d.ts +26 -0
- package/dist/fp/array/sortBy.js +31 -0
- package/dist/fp/array/sortBy.mjs +31 -0
- package/dist/fp/array/tail.d.mts +19 -0
- package/dist/fp/array/tail.d.ts +19 -0
- package/dist/fp/array/tail.js +24 -0
- package/dist/fp/array/tail.mjs +24 -0
- package/dist/fp/array/take.d.mts +26 -0
- package/dist/fp/array/take.d.ts +26 -0
- package/dist/fp/array/take.js +39 -0
- package/dist/fp/array/take.mjs +38 -0
- package/dist/fp/array/takeRight.d.mts +20 -0
- package/dist/fp/array/takeRight.d.ts +20 -0
- package/dist/fp/array/takeRight.js +25 -0
- package/dist/fp/array/takeRight.mjs +25 -0
- package/dist/fp/array/takeRightWhile.d.mts +20 -0
- package/dist/fp/array/takeRightWhile.d.ts +20 -0
- package/dist/fp/array/takeRightWhile.js +25 -0
- package/dist/fp/array/takeRightWhile.mjs +25 -0
- package/dist/fp/array/takeWhile.d.mts +21 -0
- package/dist/fp/array/takeWhile.d.ts +21 -0
- package/dist/fp/array/takeWhile.js +32 -0
- package/dist/fp/array/takeWhile.mjs +31 -0
- package/dist/fp/array/toFilled.d.mts +23 -0
- package/dist/fp/array/toFilled.d.ts +23 -0
- package/dist/fp/array/toFilled.js +30 -0
- package/dist/fp/array/toFilled.mjs +30 -0
- package/dist/fp/array/union.d.mts +20 -0
- package/dist/fp/array/union.d.ts +20 -0
- package/dist/fp/array/union.js +25 -0
- package/dist/fp/array/union.mjs +25 -0
- package/dist/fp/array/unionBy.d.mts +22 -0
- package/dist/fp/array/unionBy.d.ts +22 -0
- package/dist/fp/array/unionBy.js +27 -0
- package/dist/fp/array/unionBy.mjs +27 -0
- package/dist/fp/array/unionWith.d.mts +21 -0
- package/dist/fp/array/unionWith.d.ts +21 -0
- package/dist/fp/array/unionWith.js +26 -0
- package/dist/fp/array/unionWith.mjs +26 -0
- package/dist/fp/array/uniq.d.mts +21 -0
- package/dist/fp/array/uniq.d.ts +21 -0
- package/dist/fp/array/uniq.js +36 -0
- package/dist/fp/array/uniq.mjs +36 -0
- package/dist/fp/array/uniqBy.d.mts +21 -0
- package/dist/fp/array/uniqBy.d.ts +21 -0
- package/dist/fp/array/uniqBy.js +38 -0
- package/dist/fp/array/uniqBy.mjs +38 -0
- package/dist/fp/array/uniqWith.d.mts +20 -0
- package/dist/fp/array/uniqWith.d.ts +20 -0
- package/dist/fp/array/uniqWith.js +35 -0
- package/dist/fp/array/uniqWith.mjs +35 -0
- package/dist/fp/array/unzip.d.mts +20 -0
- package/dist/fp/array/unzip.d.ts +20 -0
- package/dist/fp/array/unzip.js +24 -0
- package/dist/fp/array/unzip.mjs +24 -0
- package/dist/fp/array/unzipWith.d.mts +21 -0
- package/dist/fp/array/unzipWith.d.ts +21 -0
- package/dist/fp/array/unzipWith.js +26 -0
- package/dist/fp/array/unzipWith.mjs +26 -0
- package/dist/fp/array/windowed.d.mts +25 -0
- package/dist/fp/array/windowed.d.ts +25 -0
- package/dist/fp/array/windowed.js +50 -0
- package/dist/fp/array/windowed.mjs +50 -0
- package/dist/fp/array/without.d.mts +19 -0
- package/dist/fp/array/without.d.ts +19 -0
- package/dist/fp/array/without.js +30 -0
- package/dist/fp/array/without.mjs +29 -0
- package/dist/fp/array/xor.d.mts +20 -0
- package/dist/fp/array/xor.d.ts +20 -0
- package/dist/fp/array/xor.js +25 -0
- package/dist/fp/array/xor.mjs +25 -0
- package/dist/fp/array/xorBy.d.mts +22 -0
- package/dist/fp/array/xorBy.d.ts +22 -0
- package/dist/fp/array/xorBy.js +27 -0
- package/dist/fp/array/xorBy.mjs +27 -0
- package/dist/fp/array/xorWith.d.mts +21 -0
- package/dist/fp/array/xorWith.d.ts +21 -0
- package/dist/fp/array/xorWith.js +26 -0
- package/dist/fp/array/xorWith.mjs +26 -0
- package/dist/fp/array/zip.d.mts +61 -0
- package/dist/fp/array/zip.d.ts +61 -0
- package/dist/fp/array/zip.js +9 -0
- package/dist/fp/array/zip.mjs +9 -0
- package/dist/fp/array/zipObject.d.mts +21 -0
- package/dist/fp/array/zipObject.d.ts +21 -0
- package/dist/fp/array/zipObject.js +26 -0
- package/dist/fp/array/zipObject.mjs +26 -0
- package/dist/fp/array/zipWith.d.mts +57 -0
- package/dist/fp/array/zipWith.d.ts +57 -0
- package/dist/fp/array/zipWith.js +9 -0
- package/dist/fp/array/zipWith.mjs +9 -0
- package/dist/fp/index.d.mts +75 -0
- package/dist/fp/index.d.ts +75 -0
- package/dist/fp/index.js +150 -0
- package/dist/fp/index.mjs +77 -0
- package/dist/fp/math/add.d.mts +17 -0
- package/dist/fp/math/add.d.ts +17 -0
- package/dist/fp/math/add.js +21 -0
- package/dist/fp/math/add.mjs +21 -0
- package/dist/fp/math/index.d.mts +2 -0
- package/dist/fp/math/index.d.ts +2 -0
- package/dist/fp/math/index.js +2 -0
- package/dist/fp/math/index.mjs +2 -0
- package/dist/fp/math/multiply.d.mts +17 -0
- package/dist/fp/math/multiply.d.ts +17 -0
- package/dist/fp/math/multiply.js +21 -0
- package/dist/fp/math/multiply.mjs +21 -0
- package/dist/fp/object/index.d.mts +2 -0
- package/dist/fp/object/index.d.ts +2 -0
- package/dist/fp/object/index.js +2 -0
- package/dist/fp/object/index.mjs +2 -0
- package/dist/fp/object/omit.d.mts +18 -0
- package/dist/fp/object/omit.d.ts +18 -0
- package/dist/fp/object/omit.js +23 -0
- package/dist/fp/object/omit.mjs +23 -0
- package/dist/fp/object/pick.d.mts +19 -0
- package/dist/fp/object/pick.d.ts +19 -0
- package/dist/fp/object/pick.js +24 -0
- package/dist/fp/object/pick.mjs +24 -0
- package/dist/fp/pipe.d.mts +235 -0
- package/dist/fp/pipe.d.ts +235 -0
- package/dist/fp/pipe.js +116 -0
- package/dist/fp/pipe.mjs +116 -0
- package/dist/index.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +4 -0
- package/dist/index.mjs +3 -1
- package/dist/predicate/index.d.mts +2 -1
- package/dist/predicate/index.d.ts +2 -1
- package/dist/predicate/index.js +2 -0
- package/dist/predicate/index.mjs +2 -1
- package/dist/predicate/isIterable.d.mts +26 -0
- package/dist/predicate/isIterable.d.ts +26 -0
- package/dist/predicate/isIterable.js +28 -0
- package/dist/predicate/isIterable.mjs +28 -0
- package/dist/string/trimStart.js +1 -0
- package/dist/string/trimStart.mjs +1 -0
- package/fp.d.ts +1 -0
- package/fp.js +1 -0
- package/package.json +22 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const require_dropRightWhile = require("../../array/dropRightWhile.js");
|
|
2
2
|
const require_identity = require("../../function/identity.js");
|
|
3
|
+
const require_toArray = require("../_internal/toArray.js");
|
|
3
4
|
const require_isArrayLike = require("../predicate/isArrayLike.js");
|
|
4
5
|
const require_property = require("../object/property.js");
|
|
5
6
|
const require_matches = require("../predicate/matches.js");
|
|
@@ -12,7 +13,7 @@ const require_matchesProperty = require("../predicate/matchesProperty.js");
|
|
|
12
13
|
* predicate function returns false. It then returns a new array with the remaining elements.
|
|
13
14
|
*
|
|
14
15
|
* @template T - The type of elements in the array.
|
|
15
|
-
* @param
|
|
16
|
+
* @param array - The array from which to drop elements.
|
|
16
17
|
* @param predicate - A predicate function that determines
|
|
17
18
|
* whether to continue dropping elements. The function is called with each element, index, and array, and dropping
|
|
18
19
|
* continues as long as it returns true.
|
|
@@ -23,9 +24,9 @@ const require_matchesProperty = require("../predicate/matchesProperty.js");
|
|
|
23
24
|
* const result = dropRightWhile(array, (item, index, arr) => index >= 1);
|
|
24
25
|
* // Returns: [3]
|
|
25
26
|
*/
|
|
26
|
-
function dropRightWhile(
|
|
27
|
-
if (!require_isArrayLike.isArrayLike(
|
|
28
|
-
return dropRightWhileImpl(
|
|
27
|
+
function dropRightWhile(array, predicate = require_identity.identity) {
|
|
28
|
+
if (!require_isArrayLike.isArrayLike(array)) return [];
|
|
29
|
+
return dropRightWhileImpl(require_toArray.toArray(array), predicate);
|
|
29
30
|
}
|
|
30
31
|
function dropRightWhileImpl(arr, predicate) {
|
|
31
32
|
switch (typeof predicate) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { dropRightWhile as dropRightWhile$1 } from "../../array/dropRightWhile.mjs";
|
|
2
2
|
import { identity } from "../../function/identity.mjs";
|
|
3
|
+
import { toArray } from "../_internal/toArray.mjs";
|
|
3
4
|
import { isArrayLike } from "../predicate/isArrayLike.mjs";
|
|
4
5
|
import { property } from "../object/property.mjs";
|
|
5
6
|
import { matches } from "../predicate/matches.mjs";
|
|
@@ -12,7 +13,7 @@ import { matchesProperty } from "../predicate/matchesProperty.mjs";
|
|
|
12
13
|
* predicate function returns false. It then returns a new array with the remaining elements.
|
|
13
14
|
*
|
|
14
15
|
* @template T - The type of elements in the array.
|
|
15
|
-
* @param
|
|
16
|
+
* @param array - The array from which to drop elements.
|
|
16
17
|
* @param predicate - A predicate function that determines
|
|
17
18
|
* whether to continue dropping elements. The function is called with each element, index, and array, and dropping
|
|
18
19
|
* continues as long as it returns true.
|
|
@@ -23,9 +24,9 @@ import { matchesProperty } from "../predicate/matchesProperty.mjs";
|
|
|
23
24
|
* const result = dropRightWhile(array, (item, index, arr) => index >= 1);
|
|
24
25
|
* // Returns: [3]
|
|
25
26
|
*/
|
|
26
|
-
function dropRightWhile(
|
|
27
|
-
if (!isArrayLike(
|
|
28
|
-
return dropRightWhileImpl(
|
|
27
|
+
function dropRightWhile(array, predicate = identity) {
|
|
28
|
+
if (!isArrayLike(array)) return [];
|
|
29
|
+
return dropRightWhileImpl(toArray(array), predicate);
|
|
29
30
|
}
|
|
30
31
|
function dropRightWhileImpl(arr, predicate) {
|
|
31
32
|
switch (typeof predicate) {
|
|
@@ -7,7 +7,7 @@ import { ListIteratee } from "../_internal/ListIteratee.mjs";
|
|
|
7
7
|
* The predicate is invoked with three arguments: (value, index, array).
|
|
8
8
|
*
|
|
9
9
|
* @template T - The type of elements in the array
|
|
10
|
-
* @param
|
|
10
|
+
* @param array - The array to query
|
|
11
11
|
* @param [predicate=identity] - The function invoked per iteration
|
|
12
12
|
* @returns Returns the slice of array
|
|
13
13
|
*
|
|
@@ -24,6 +24,6 @@ import { ListIteratee } from "../_internal/ListIteratee.mjs";
|
|
|
24
24
|
* dropWhile([{ a: 1, b: 2 }, { a: 1, b: 3 }], 'a')
|
|
25
25
|
* // => []
|
|
26
26
|
*/
|
|
27
|
-
declare function dropWhile<T>(
|
|
27
|
+
declare function dropWhile<T>(array: ArrayLike<T> | null | undefined, predicate?: ListIteratee<T>): T[];
|
|
28
28
|
//#endregion
|
|
29
29
|
export { dropWhile };
|
|
@@ -7,7 +7,7 @@ import { ListIteratee } from "../_internal/ListIteratee.js";
|
|
|
7
7
|
* The predicate is invoked with three arguments: (value, index, array).
|
|
8
8
|
*
|
|
9
9
|
* @template T - The type of elements in the array
|
|
10
|
-
* @param
|
|
10
|
+
* @param array - The array to query
|
|
11
11
|
* @param [predicate=identity] - The function invoked per iteration
|
|
12
12
|
* @returns Returns the slice of array
|
|
13
13
|
*
|
|
@@ -24,6 +24,6 @@ import { ListIteratee } from "../_internal/ListIteratee.js";
|
|
|
24
24
|
* dropWhile([{ a: 1, b: 2 }, { a: 1, b: 3 }], 'a')
|
|
25
25
|
* // => []
|
|
26
26
|
*/
|
|
27
|
-
declare function dropWhile<T>(
|
|
27
|
+
declare function dropWhile<T>(array: ArrayLike<T> | null | undefined, predicate?: ListIteratee<T>): T[];
|
|
28
28
|
//#endregion
|
|
29
29
|
export { dropWhile };
|
|
@@ -12,7 +12,7 @@ const require_matchesProperty = require("../predicate/matchesProperty.js");
|
|
|
12
12
|
* The predicate is invoked with three arguments: (value, index, array).
|
|
13
13
|
*
|
|
14
14
|
* @template T - The type of elements in the array
|
|
15
|
-
* @param
|
|
15
|
+
* @param array - The array to query
|
|
16
16
|
* @param [predicate=identity] - The function invoked per iteration
|
|
17
17
|
* @returns Returns the slice of array
|
|
18
18
|
*
|
|
@@ -29,9 +29,9 @@ const require_matchesProperty = require("../predicate/matchesProperty.js");
|
|
|
29
29
|
* dropWhile([{ a: 1, b: 2 }, { a: 1, b: 3 }], 'a')
|
|
30
30
|
* // => []
|
|
31
31
|
*/
|
|
32
|
-
function dropWhile(
|
|
33
|
-
if (!require_isArrayLike.isArrayLike(
|
|
34
|
-
return dropWhileImpl(require_toArray.toArray(
|
|
32
|
+
function dropWhile(array, predicate = require_identity.identity) {
|
|
33
|
+
if (!require_isArrayLike.isArrayLike(array)) return [];
|
|
34
|
+
return dropWhileImpl(require_toArray.toArray(array), predicate);
|
|
35
35
|
}
|
|
36
36
|
function dropWhileImpl(arr, predicate) {
|
|
37
37
|
switch (typeof predicate) {
|
|
@@ -12,7 +12,7 @@ import { matchesProperty } from "../predicate/matchesProperty.mjs";
|
|
|
12
12
|
* The predicate is invoked with three arguments: (value, index, array).
|
|
13
13
|
*
|
|
14
14
|
* @template T - The type of elements in the array
|
|
15
|
-
* @param
|
|
15
|
+
* @param array - The array to query
|
|
16
16
|
* @param [predicate=identity] - The function invoked per iteration
|
|
17
17
|
* @returns Returns the slice of array
|
|
18
18
|
*
|
|
@@ -29,9 +29,9 @@ import { matchesProperty } from "../predicate/matchesProperty.mjs";
|
|
|
29
29
|
* dropWhile([{ a: 1, b: 2 }, { a: 1, b: 3 }], 'a')
|
|
30
30
|
* // => []
|
|
31
31
|
*/
|
|
32
|
-
function dropWhile(
|
|
33
|
-
if (!isArrayLike(
|
|
34
|
-
return dropWhileImpl(toArray(
|
|
32
|
+
function dropWhile(array, predicate = identity) {
|
|
33
|
+
if (!isArrayLike(array)) return [];
|
|
34
|
+
return dropWhileImpl(toArray(array), predicate);
|
|
35
35
|
}
|
|
36
36
|
function dropWhileImpl(arr, predicate) {
|
|
37
37
|
switch (typeof predicate) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const require_toInteger = require("../util/toInteger.js");
|
|
2
1
|
const require_identity = require("../../function/identity.js");
|
|
3
2
|
const require_iteratee = require("../util/iteratee.js");
|
|
3
|
+
const require_toInteger = require("../util/toInteger.js");
|
|
4
4
|
//#region src/compat/array/findLast.ts
|
|
5
5
|
/**
|
|
6
6
|
* Finds the last item in an object that has a specific property, where the property name is provided as a PropertyKey.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { toInteger } from "../util/toInteger.mjs";
|
|
2
1
|
import { identity } from "../../function/identity.mjs";
|
|
3
2
|
import { iteratee } from "../util/iteratee.mjs";
|
|
3
|
+
import { toInteger } from "../util/toInteger.mjs";
|
|
4
4
|
//#region src/compat/array/findLast.ts
|
|
5
5
|
/**
|
|
6
6
|
* Finds the last item in an object that has a specific property, where the property name is provided as a PropertyKey.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const require_toInteger = require("../util/toInteger.js");
|
|
2
1
|
const require_isEqualsSameValueZero = require("../../_internal/isEqualsSameValueZero.js");
|
|
3
2
|
require("../util/eq.js");
|
|
3
|
+
const require_toInteger = require("../util/toInteger.js");
|
|
4
4
|
const require_isString = require("../predicate/isString.js");
|
|
5
5
|
//#region src/compat/array/includes.ts
|
|
6
6
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { toInteger } from "../util/toInteger.mjs";
|
|
2
1
|
import { isEqualsSameValueZero } from "../../_internal/isEqualsSameValueZero.mjs";
|
|
3
2
|
import "../util/eq.mjs";
|
|
3
|
+
import { toInteger } from "../util/toInteger.mjs";
|
|
4
4
|
import { isString } from "../predicate/isString.mjs";
|
|
5
5
|
//#region src/compat/array/includes.ts
|
|
6
6
|
/**
|
package/dist/compat/array/nth.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_toInteger = require("../util/toInteger.js");
|
|
2
1
|
const require_isArrayLikeObject = require("../predicate/isArrayLikeObject.js");
|
|
2
|
+
const require_toInteger = require("../util/toInteger.js");
|
|
3
3
|
//#region src/compat/array/nth.ts
|
|
4
4
|
/**
|
|
5
5
|
* Gets the element at index `n` of `array`. If `n` is negative, the nth element from the end is returned.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { toInteger } from "../util/toInteger.mjs";
|
|
2
1
|
import { isArrayLikeObject } from "../predicate/isArrayLikeObject.mjs";
|
|
2
|
+
import { toInteger } from "../util/toInteger.mjs";
|
|
3
3
|
//#region src/compat/array/nth.ts
|
|
4
4
|
/**
|
|
5
5
|
* Gets the element at index `n` of `array`. If `n` is negative, the nth element from the end is returned.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_toInteger = require("../util/toInteger.js");
|
|
2
1
|
const require_isArrayLike = require("../predicate/isArrayLike.js");
|
|
2
|
+
const require_toInteger = require("../util/toInteger.js");
|
|
3
3
|
const require_isIterateeCall = require("../_internal/isIterateeCall.js");
|
|
4
4
|
//#region src/compat/array/slice.ts
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { toInteger } from "../util/toInteger.mjs";
|
|
2
1
|
import { isArrayLike } from "../predicate/isArrayLike.mjs";
|
|
2
|
+
import { toInteger } from "../util/toInteger.mjs";
|
|
3
3
|
import { isIterateeCall } from "../_internal/isIterateeCall.mjs";
|
|
4
4
|
//#region src/compat/array/slice.ts
|
|
5
5
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const require_isSymbol = require("../predicate/isSymbol.js");
|
|
2
1
|
const require_isNull = require("../../predicate/isNull.js");
|
|
3
2
|
const require_isUndefined = require("../../predicate/isUndefined.js");
|
|
4
3
|
const require_iteratee = require("../util/iteratee.js");
|
|
4
|
+
const require_isSymbol = require("../predicate/isSymbol.js");
|
|
5
5
|
const require_identity = require("../function/identity.js");
|
|
6
6
|
const require_isNil = require("../predicate/isNil.js");
|
|
7
7
|
const require_isNaN = require("../predicate/isNaN.js");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { isSymbol } from "../predicate/isSymbol.mjs";
|
|
2
1
|
import { isNull } from "../../predicate/isNull.mjs";
|
|
3
2
|
import { isUndefined } from "../../predicate/isUndefined.mjs";
|
|
4
3
|
import { iteratee } from "../util/iteratee.mjs";
|
|
4
|
+
import { isSymbol } from "../predicate/isSymbol.mjs";
|
|
5
5
|
import { identity } from "../function/identity.mjs";
|
|
6
6
|
import { isNil } from "../predicate/isNil.mjs";
|
|
7
7
|
import { isNaN } from "../predicate/isNaN.mjs";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const require_toInteger = require("../util/toInteger.js");
|
|
2
1
|
const require_take = require("../../array/take.js");
|
|
3
2
|
const require_toArray = require("../_internal/toArray.js");
|
|
4
3
|
const require_isArrayLike = require("../predicate/isArrayLike.js");
|
|
4
|
+
const require_toInteger = require("../util/toInteger.js");
|
|
5
5
|
//#region src/compat/array/take.ts
|
|
6
6
|
/**
|
|
7
7
|
* Returns a new array containing the first `count` elements from the input array `arr`.
|
|
@@ -27,7 +27,7 @@ const require_isArrayLike = require("../predicate/isArrayLike.js");
|
|
|
27
27
|
* take([1, 2, 3], 5);
|
|
28
28
|
*/
|
|
29
29
|
function take(arr, count = 1, guard) {
|
|
30
|
-
count = guard ? 1 : require_toInteger.toInteger(count);
|
|
30
|
+
count = guard || count === void 0 ? 1 : require_toInteger.toInteger(count);
|
|
31
31
|
if (count < 1 || !require_isArrayLike.isArrayLike(arr)) return [];
|
|
32
32
|
return require_take.take(require_toArray.toArray(arr), count);
|
|
33
33
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { toInteger } from "../util/toInteger.mjs";
|
|
2
1
|
import { take as take$1 } from "../../array/take.mjs";
|
|
3
2
|
import { toArray } from "../_internal/toArray.mjs";
|
|
4
3
|
import { isArrayLike } from "../predicate/isArrayLike.mjs";
|
|
4
|
+
import { toInteger } from "../util/toInteger.mjs";
|
|
5
5
|
//#region src/compat/array/take.ts
|
|
6
6
|
/**
|
|
7
7
|
* Returns a new array containing the first `count` elements from the input array `arr`.
|
|
@@ -27,7 +27,7 @@ import { isArrayLike } from "../predicate/isArrayLike.mjs";
|
|
|
27
27
|
* take([1, 2, 3], 5);
|
|
28
28
|
*/
|
|
29
29
|
function take(arr, count = 1, guard) {
|
|
30
|
-
count = guard ? 1 : toInteger(count);
|
|
30
|
+
count = guard || count === void 0 ? 1 : toInteger(count);
|
|
31
31
|
if (count < 1 || !isArrayLike(arr)) return [];
|
|
32
32
|
return take$1(toArray(arr), count);
|
|
33
33
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const require_toInteger = require("../util/toInteger.js");
|
|
2
1
|
const require_takeRight = require("../../array/takeRight.js");
|
|
3
2
|
const require_toArray = require("../_internal/toArray.js");
|
|
4
3
|
const require_isArrayLike = require("../predicate/isArrayLike.js");
|
|
4
|
+
const require_toInteger = require("../util/toInteger.js");
|
|
5
5
|
//#region src/compat/array/takeRight.ts
|
|
6
6
|
/**
|
|
7
7
|
* Returns a new array containing the last `count` elements from the input array `arr`.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { toInteger } from "../util/toInteger.mjs";
|
|
2
1
|
import { takeRight as takeRight$1 } from "../../array/takeRight.mjs";
|
|
3
2
|
import { toArray } from "../_internal/toArray.mjs";
|
|
4
3
|
import { isArrayLike } from "../predicate/isArrayLike.mjs";
|
|
4
|
+
import { toInteger } from "../util/toInteger.mjs";
|
|
5
5
|
//#region src/compat/array/takeRight.ts
|
|
6
6
|
/**
|
|
7
7
|
* Returns a new array containing the last `count` elements from the input array `arr`.
|
package/dist/compat/compat.js
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
const require_runtime = require("../_virtual/_rolldown/runtime.js");
|
|
2
|
-
const require_isSymbol = require("./predicate/isSymbol.js");
|
|
3
|
-
const require_toNumber = require("./util/toNumber.js");
|
|
4
|
-
const require_toFinite = require("./util/toFinite.js");
|
|
5
|
-
const require_toInteger = require("./util/toInteger.js");
|
|
6
2
|
const require_isArray = require("./predicate/isArray.js");
|
|
7
3
|
const require_isPlainObject = require("./predicate/isPlainObject.js");
|
|
8
4
|
const require_isEqualsSameValueZero = require("../_internal/isEqualsSameValueZero.js");
|
|
@@ -34,6 +30,10 @@ const require_difference = require("./array/difference.js");
|
|
|
34
30
|
const require_last = require("./array/last.js");
|
|
35
31
|
const require_differenceBy = require("./array/differenceBy.js");
|
|
36
32
|
const require_differenceWith = require("./array/differenceWith.js");
|
|
33
|
+
const require_isSymbol = require("./predicate/isSymbol.js");
|
|
34
|
+
const require_toNumber = require("./util/toNumber.js");
|
|
35
|
+
const require_toFinite = require("./util/toFinite.js");
|
|
36
|
+
const require_toInteger = require("./util/toInteger.js");
|
|
37
37
|
const require_drop = require("./array/drop.js");
|
|
38
38
|
const require_dropRight = require("./array/dropRight.js");
|
|
39
39
|
const require_dropRightWhile = require("./array/dropRightWhile.js");
|
package/dist/compat/compat.mjs
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
import { __exportAll } from "../_virtual/_rolldown/runtime.mjs";
|
|
2
|
-
import { isSymbol } from "./predicate/isSymbol.mjs";
|
|
3
|
-
import { toNumber } from "./util/toNumber.mjs";
|
|
4
|
-
import { toFinite } from "./util/toFinite.mjs";
|
|
5
|
-
import { toInteger } from "./util/toInteger.mjs";
|
|
6
2
|
import { isArray } from "./predicate/isArray.mjs";
|
|
7
3
|
import { isPlainObject } from "./predicate/isPlainObject.mjs";
|
|
8
4
|
import { isEqualsSameValueZero } from "../_internal/isEqualsSameValueZero.mjs";
|
|
@@ -34,6 +30,10 @@ import { difference } from "./array/difference.mjs";
|
|
|
34
30
|
import { last } from "./array/last.mjs";
|
|
35
31
|
import { differenceBy } from "./array/differenceBy.mjs";
|
|
36
32
|
import { differenceWith } from "./array/differenceWith.mjs";
|
|
33
|
+
import { isSymbol } from "./predicate/isSymbol.mjs";
|
|
34
|
+
import { toNumber } from "./util/toNumber.mjs";
|
|
35
|
+
import { toFinite } from "./util/toFinite.mjs";
|
|
36
|
+
import { toInteger } from "./util/toInteger.mjs";
|
|
37
37
|
import { drop } from "./array/drop.mjs";
|
|
38
38
|
import { dropRight } from "./array/dropRight.mjs";
|
|
39
39
|
import { dropRightWhile } from "./array/dropRightWhile.mjs";
|
package/dist/compat/index.js
CHANGED
|
@@ -2,10 +2,6 @@ Object.defineProperties(exports, {
|
|
|
2
2
|
__esModule: { value: true },
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
|
-
const require_isSymbol = require("./predicate/isSymbol.js");
|
|
6
|
-
const require_toNumber = require("./util/toNumber.js");
|
|
7
|
-
const require_toFinite = require("./util/toFinite.js");
|
|
8
|
-
const require_toInteger = require("./util/toInteger.js");
|
|
9
5
|
const require_isArray = require("./predicate/isArray.js");
|
|
10
6
|
const require_isPlainObject = require("./predicate/isPlainObject.js");
|
|
11
7
|
const require_isEqualsSameValueZero = require("../_internal/isEqualsSameValueZero.js");
|
|
@@ -36,6 +32,10 @@ const require_difference = require("./array/difference.js");
|
|
|
36
32
|
const require_last = require("./array/last.js");
|
|
37
33
|
const require_differenceBy = require("./array/differenceBy.js");
|
|
38
34
|
const require_differenceWith = require("./array/differenceWith.js");
|
|
35
|
+
const require_isSymbol = require("./predicate/isSymbol.js");
|
|
36
|
+
const require_toNumber = require("./util/toNumber.js");
|
|
37
|
+
const require_toFinite = require("./util/toFinite.js");
|
|
38
|
+
const require_toInteger = require("./util/toInteger.js");
|
|
39
39
|
const require_drop = require("./array/drop.js");
|
|
40
40
|
const require_dropRight = require("./array/dropRight.js");
|
|
41
41
|
const require_dropRightWhile = require("./array/dropRightWhile.js");
|
package/dist/compat/index.mjs
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import { isSymbol } from "./predicate/isSymbol.mjs";
|
|
2
|
-
import { toNumber } from "./util/toNumber.mjs";
|
|
3
|
-
import { toFinite } from "./util/toFinite.mjs";
|
|
4
|
-
import { toInteger } from "./util/toInteger.mjs";
|
|
5
1
|
import { isArray } from "./predicate/isArray.mjs";
|
|
6
2
|
import { isPlainObject } from "./predicate/isPlainObject.mjs";
|
|
7
3
|
import { isEqualsSameValueZero } from "../_internal/isEqualsSameValueZero.mjs";
|
|
@@ -32,6 +28,10 @@ import { difference } from "./array/difference.mjs";
|
|
|
32
28
|
import { last } from "./array/last.mjs";
|
|
33
29
|
import { differenceBy } from "./array/differenceBy.mjs";
|
|
34
30
|
import { differenceWith } from "./array/differenceWith.mjs";
|
|
31
|
+
import { isSymbol } from "./predicate/isSymbol.mjs";
|
|
32
|
+
import { toNumber } from "./util/toNumber.mjs";
|
|
33
|
+
import { toFinite } from "./util/toFinite.mjs";
|
|
34
|
+
import { toInteger } from "./util/toInteger.mjs";
|
|
35
35
|
import { drop } from "./array/drop.mjs";
|
|
36
36
|
import { dropRight } from "./array/dropRight.mjs";
|
|
37
37
|
import { dropRightWhile } from "./array/dropRightWhile.mjs";
|
package/dist/compat/math/add.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_toNumber = require("../util/toNumber.js");
|
|
2
1
|
const require_toString = require("../util/toString.js");
|
|
2
|
+
const require_toNumber = require("../util/toNumber.js");
|
|
3
3
|
//#region src/compat/math/add.ts
|
|
4
4
|
/**
|
|
5
5
|
* Adds two numbers while safely handling `NaN` values.
|
package/dist/compat/math/add.mjs
CHANGED
|
@@ -27,6 +27,7 @@ function random(...args) {
|
|
|
27
27
|
case 2: if (typeof args[1] === "boolean") {
|
|
28
28
|
maximum = args[0];
|
|
29
29
|
floating = args[1];
|
|
30
|
+
break;
|
|
30
31
|
} else {
|
|
31
32
|
minimum = args[0];
|
|
32
33
|
maximum = args[1];
|
|
@@ -46,10 +47,11 @@ function random(...args) {
|
|
|
46
47
|
if (!minimum) minimum = 0;
|
|
47
48
|
if (!maximum) maximum = 0;
|
|
48
49
|
if (minimum > maximum) [minimum, maximum] = [maximum, minimum];
|
|
50
|
+
if (!floating && (!Number.isInteger(minimum) || !Number.isInteger(maximum))) floating = true;
|
|
49
51
|
minimum = require_clamp.clamp(minimum, -Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER);
|
|
50
52
|
maximum = require_clamp.clamp(maximum, -Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER);
|
|
51
53
|
if (minimum === maximum) return minimum;
|
|
52
|
-
if (floating) return require_random.random(minimum, maximum
|
|
54
|
+
if (floating) return require_random.random(minimum, maximum);
|
|
53
55
|
else return require_randomInt.randomInt(minimum, maximum + 1);
|
|
54
56
|
}
|
|
55
57
|
//#endregion
|
|
@@ -27,6 +27,7 @@ function random(...args) {
|
|
|
27
27
|
case 2: if (typeof args[1] === "boolean") {
|
|
28
28
|
maximum = args[0];
|
|
29
29
|
floating = args[1];
|
|
30
|
+
break;
|
|
30
31
|
} else {
|
|
31
32
|
minimum = args[0];
|
|
32
33
|
maximum = args[1];
|
|
@@ -46,10 +47,11 @@ function random(...args) {
|
|
|
46
47
|
if (!minimum) minimum = 0;
|
|
47
48
|
if (!maximum) maximum = 0;
|
|
48
49
|
if (minimum > maximum) [minimum, maximum] = [maximum, minimum];
|
|
50
|
+
if (!floating && (!Number.isInteger(minimum) || !Number.isInteger(maximum))) floating = true;
|
|
49
51
|
minimum = clamp(minimum, -Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER);
|
|
50
52
|
maximum = clamp(maximum, -Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER);
|
|
51
53
|
if (minimum === maximum) return minimum;
|
|
52
|
-
if (floating) return random$1(minimum, maximum
|
|
54
|
+
if (floating) return random$1(minimum, maximum);
|
|
53
55
|
else return randomInt(minimum, maximum + 1);
|
|
54
56
|
}
|
|
55
57
|
//#endregion
|
|
@@ -28,7 +28,7 @@ function get(object, path, defaultValue) {
|
|
|
28
28
|
case "string": {
|
|
29
29
|
if (require_isUnsafeProperty.isUnsafeProperty(path)) return defaultValue;
|
|
30
30
|
const result = object[path];
|
|
31
|
-
if (result === void 0) if (require_isDeepKey.isDeepKey(path)) return get(object, require_toPath.toPath(path), defaultValue);
|
|
31
|
+
if (result === void 0) if (require_isDeepKey.isDeepKey(path) && !Object.hasOwn(object, path)) return get(object, require_toPath.toPath(path), defaultValue);
|
|
32
32
|
else return defaultValue;
|
|
33
33
|
return result;
|
|
34
34
|
}
|
|
@@ -28,7 +28,7 @@ function get(object, path, defaultValue) {
|
|
|
28
28
|
case "string": {
|
|
29
29
|
if (isUnsafeProperty(path)) return defaultValue;
|
|
30
30
|
const result = object[path];
|
|
31
|
-
if (result === void 0) if (isDeepKey(path)) return get(object, toPath(path), defaultValue);
|
|
31
|
+
if (result === void 0) if (isDeepKey(path) && !Object.hasOwn(object, path)) return get(object, toPath(path), defaultValue);
|
|
32
32
|
else return defaultValue;
|
|
33
33
|
return result;
|
|
34
34
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_isSymbol = require("../predicate/isSymbol.js");
|
|
2
1
|
const require_iteratee = require("../util/iteratee.js");
|
|
2
|
+
const require_isSymbol = require("../predicate/isSymbol.js");
|
|
3
3
|
const require_identity = require("../function/identity.js");
|
|
4
4
|
const require_keysIn = require("./keysIn.js");
|
|
5
5
|
const require_getSymbolsIn = require("../_internal/getSymbolsIn.js");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { isSymbol } from "../predicate/isSymbol.mjs";
|
|
2
1
|
import { iteratee } from "../util/iteratee.mjs";
|
|
2
|
+
import { isSymbol } from "../predicate/isSymbol.mjs";
|
|
3
3
|
import { identity } from "../function/identity.mjs";
|
|
4
4
|
import { keysIn } from "./keysIn.mjs";
|
|
5
5
|
import { getSymbolsIn } from "../_internal/getSymbolsIn.mjs";
|
|
@@ -50,7 +50,7 @@ function pick(object, ...keysArr) {
|
|
|
50
50
|
for (const key of keys) {
|
|
51
51
|
const value = require_get.get(object, key);
|
|
52
52
|
if (value === void 0 && !require_has.has(object, key)) continue;
|
|
53
|
-
if (typeof key === "string" && Object.hasOwn(object, key)) result[key] =
|
|
53
|
+
if (typeof key === "string" && Object.hasOwn(object, key)) result[key] = object[key];
|
|
54
54
|
else require_set.set(result, key, value);
|
|
55
55
|
}
|
|
56
56
|
}
|
|
@@ -50,7 +50,7 @@ function pick(object, ...keysArr) {
|
|
|
50
50
|
for (const key of keys) {
|
|
51
51
|
const value = get(object, key);
|
|
52
52
|
if (value === void 0 && !has(object, key)) continue;
|
|
53
|
-
if (typeof key === "string" && Object.hasOwn(object, key)) result[key] =
|
|
53
|
+
if (typeof key === "string" && Object.hasOwn(object, key)) result[key] = object[key];
|
|
54
54
|
else set(result, key, value);
|
|
55
55
|
}
|
|
56
56
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const require_isSymbol = require("../predicate/isSymbol.js");
|
|
2
1
|
const require_range = require("../../math/range.js");
|
|
3
2
|
const require_isArrayLike = require("../predicate/isArrayLike.js");
|
|
4
3
|
const require_iteratee = require("../util/iteratee.js");
|
|
4
|
+
const require_isSymbol = require("../predicate/isSymbol.js");
|
|
5
5
|
const require_identity = require("../function/identity.js");
|
|
6
6
|
const require_keysIn = require("./keysIn.js");
|
|
7
7
|
const require_getSymbolsIn = require("../_internal/getSymbolsIn.js");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { isSymbol } from "../predicate/isSymbol.mjs";
|
|
2
1
|
import { range } from "../../math/range.mjs";
|
|
3
2
|
import { isArrayLike } from "../predicate/isArrayLike.mjs";
|
|
4
3
|
import { iteratee } from "../util/iteratee.mjs";
|
|
4
|
+
import { isSymbol } from "../predicate/isSymbol.mjs";
|
|
5
5
|
import { identity } from "../function/identity.mjs";
|
|
6
6
|
import { keysIn } from "./keysIn.mjs";
|
|
7
7
|
import { getSymbolsIn } from "../_internal/getSymbolsIn.mjs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_toInteger = require("../util/toInteger.js");
|
|
2
1
|
const require_toString = require("../util/toString.js");
|
|
2
|
+
const require_toInteger = require("../util/toInteger.js");
|
|
3
3
|
const require_isIterateeCall = require("../_internal/isIterateeCall.js");
|
|
4
4
|
const require_MAX_SAFE_INTEGER = require("../_internal/MAX_SAFE_INTEGER.js");
|
|
5
5
|
//#region src/compat/string/repeat.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { toInteger } from "../util/toInteger.mjs";
|
|
2
1
|
import { toString } from "../util/toString.mjs";
|
|
2
|
+
import { toInteger } from "../util/toInteger.mjs";
|
|
3
3
|
import { isIterateeCall } from "../_internal/isIterateeCall.mjs";
|
|
4
4
|
import { MAX_SAFE_INTEGER } from "../_internal/MAX_SAFE_INTEGER.mjs";
|
|
5
5
|
//#region src/compat/string/repeat.ts
|