es-toolkit 1.9.0-dev.183 → 1.9.0-dev.184

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.
@@ -1,7 +1,4 @@
1
1
  import "../chunk-N6EM6ETS.mjs";
2
- import {
3
- noop
4
- } from "../chunk-LKXCOLNY.mjs";
5
2
  import {
6
3
  once
7
4
  } from "../chunk-CMBC4MXG.mjs";
@@ -11,6 +8,9 @@ import {
11
8
  import {
12
9
  debounce
13
10
  } from "../chunk-3IP4JVLL.mjs";
11
+ import {
12
+ noop
13
+ } from "../chunk-LKXCOLNY.mjs";
14
14
  import "../chunk-2MM5EJJX.mjs";
15
15
  export {
16
16
  debounce,
package/dist/index.d.mts CHANGED
@@ -47,6 +47,7 @@ export { head } from './array/head.mjs';
47
47
  export { tail } from './array/tail.mjs';
48
48
  export { toFilled } from './array/toFilled.mjs';
49
49
  export { last } from './array/last.mjs';
50
+ export { initial } from './array/initial.mjs';
50
51
  export { AbortError } from './error/AbortError.mjs';
51
52
  export { debounce } from './function/debounce.mjs';
52
53
  export { noop } from './function/noop.mjs';
package/dist/index.d.ts CHANGED
@@ -47,6 +47,7 @@ export { head } from './array/head.js';
47
47
  export { tail } from './array/tail.js';
48
48
  export { toFilled } from './array/toFilled.js';
49
49
  export { last } from './array/last.js';
50
+ export { initial } from './array/initial.js';
50
51
  export { AbortError } from './error/AbortError.js';
51
52
  export { debounce } from './function/debounce.js';
52
53
  export { noop } from './function/noop.js';
package/dist/index.js CHANGED
@@ -56,6 +56,7 @@ __export(src_exports, {
56
56
  groupBy: () => groupBy,
57
57
  head: () => head,
58
58
  inRange: () => inRange,
59
+ initial: () => initial,
59
60
  intersection: () => intersection,
60
61
  intersectionBy: () => intersectionBy,
61
62
  intersectionWith: () => intersectionWith,
@@ -618,6 +619,14 @@ function last(arr) {
618
619
  return arr[arr.length - 1];
619
620
  }
620
621
 
622
+ // src/array/initial.ts
623
+ function initial(arr) {
624
+ if (arr.length <= 1) {
625
+ return [];
626
+ }
627
+ return arr.slice(0, -1);
628
+ }
629
+
621
630
  // src/error/AbortError.ts
622
631
  var AbortError = class extends Error {
623
632
  constructor(message = "The operation was aborted") {
@@ -894,6 +903,7 @@ var capitalize = (str) => {
894
903
  groupBy,
895
904
  head,
896
905
  inRange,
906
+ initial,
897
907
  intersection,
898
908
  intersectionBy,
899
909
  intersectionWith,