es-toolkit 1.13.1-dev.302 → 1.13.1-dev.303

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/dist/browser.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  compat_exports
3
- } from "./chunk-BVNAXMKC.mjs";
3
+ } from "./chunk-JNHWGDYT.mjs";
4
4
  import "./chunk-NKLIE2OI.mjs";
5
5
  import "./chunk-XT74R35S.mjs";
6
6
  import "./chunk-EYYZQFOP.mjs";
@@ -63,7 +63,7 @@ import "./chunk-SYWMYQYJ.mjs";
63
63
  import "./chunk-G7UQ5PUR.mjs";
64
64
  import "./chunk-TJ4Z5I7M.mjs";
65
65
  import "./chunk-ME352XO7.mjs";
66
- import "./chunk-IQLKIDXF.mjs";
66
+ import "./chunk-N3QYJX4T.mjs";
67
67
  import "./chunk-NTLX2MPV.mjs";
68
68
  import "./chunk-2IXFGSUA.mjs";
69
69
  import "./chunk-O6UXZR3U.mjs";
@@ -156,7 +156,7 @@ import {
156
156
  } from "./chunk-ME352XO7.mjs";
157
157
  import {
158
158
  takeRight
159
- } from "./chunk-IQLKIDXF.mjs";
159
+ } from "./chunk-N3QYJX4T.mjs";
160
160
  import {
161
161
  takeRightWhile
162
162
  } from "./chunk-NTLX2MPV.mjs";
@@ -602,4 +602,4 @@ export {
602
602
  min,
603
603
  compat_exports
604
604
  };
605
- //# sourceMappingURL=chunk-BVNAXMKC.mjs.map
605
+ //# sourceMappingURL=chunk-JNHWGDYT.mjs.map
@@ -1,6 +1,6 @@
1
1
  // src/array/takeRight.ts
2
- function takeRight(arr, count) {
3
- if (count === 0) {
2
+ function takeRight(arr, count = 1) {
3
+ if (count <= 0) {
4
4
  return [];
5
5
  }
6
6
  return arr.slice(-count);
@@ -9,4 +9,4 @@ function takeRight(arr, count) {
9
9
  export {
10
10
  takeRight
11
11
  };
12
- //# sourceMappingURL=chunk-IQLKIDXF.mjs.map
12
+ //# sourceMappingURL=chunk-N3QYJX4T.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/array/takeRight.ts"],"sourcesContent":["/**\n * Returns a new array containing the last `count` elements from the input array `arr`.\n * If `count` is greater than the length of `arr`, the entire array is returned.\n *\n * @template T - The type of elements in the array.\n * @param {T[]} arr - The array to take elements from.\n * @param {number} [count=1] - The number of elements to take.\n * @returns {T[]} A new array containing the last `count` elements from `arr`.\n *\n * @example\n * // Returns [4, 5]\n * takeRight([1, 2, 3, 4, 5], 2);\n *\n * @example\n * // Returns ['b', 'c']\n * takeRight(['a', 'b', 'c'], 2);\n *\n * @example\n * // Returns [1, 2, 3]\n * takeRight([1, 2, 3], 5);\n */\nexport function takeRight<T>(arr: readonly T[], count = 1): T[] {\n if (count <= 0) {\n return [];\n }\n\n return arr.slice(-count);\n}\n"],"mappings":";AAqBO,SAAS,UAAa,KAAmB,QAAQ,GAAQ;AAC9D,MAAI,SAAS,GAAG;AACd,WAAO,CAAC;AAAA,EACV;AAEA,SAAO,IAAI,MAAM,CAAC,KAAK;AACzB;","names":[]}
@@ -467,8 +467,8 @@ function take(arr, count) {
467
467
  }
468
468
 
469
469
  // src/array/takeRight.ts
470
- function takeRight(arr, count) {
471
- if (count === 0) {
470
+ function takeRight(arr, count = 1) {
471
+ if (count <= 0) {
472
472
  return [];
473
473
  }
474
474
  return arr.slice(-count);