es-toolkit 1.13.0 → 1.13.1-dev.295

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/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import "./chunk-SPKLWVNJ.mjs";
1
+ import "./chunk-NKLIE2OI.mjs";
2
2
  import "./chunk-XT74R35S.mjs";
3
3
  import {
4
4
  kebabCase
@@ -96,7 +96,32 @@ import {
96
96
  import {
97
97
  range
98
98
  } from "./chunk-DPH2KE6O.mjs";
99
+ import "./chunk-236H5JZJ.mjs";
100
+ import {
101
+ debounce
102
+ } from "./chunk-3IP4JVLL.mjs";
103
+ import {
104
+ negate
105
+ } from "./chunk-BOOQBJN2.mjs";
106
+ import {
107
+ noop
108
+ } from "./chunk-LKXCOLNY.mjs";
109
+ import {
110
+ once
111
+ } from "./chunk-CMBC4MXG.mjs";
112
+ import {
113
+ throttle
114
+ } from "./chunk-QOJGMVVR.mjs";
99
115
  import "./chunk-DDH7K4QM.mjs";
116
+ import {
117
+ zipObject
118
+ } from "./chunk-6GWEY5EL.mjs";
119
+ import {
120
+ zipWith
121
+ } from "./chunk-4KYXHZ4R.mjs";
122
+ import {
123
+ unzip
124
+ } from "./chunk-UYZKMBDO.mjs";
100
125
  import {
101
126
  unzipWith
102
127
  } from "./chunk-IFNXROZR.mjs";
@@ -116,11 +141,11 @@ import {
116
141
  zip
117
142
  } from "./chunk-IDCUZVJL.mjs";
118
143
  import {
119
- zipObject
120
- } from "./chunk-6GWEY5EL.mjs";
144
+ takeRightWhile
145
+ } from "./chunk-NTLX2MPV.mjs";
121
146
  import {
122
- zipWith
123
- } from "./chunk-4KYXHZ4R.mjs";
147
+ takeWhile
148
+ } from "./chunk-2IXFGSUA.mjs";
124
149
  import {
125
150
  toFilled
126
151
  } from "./chunk-OP4OAKQJ.mjs";
@@ -133,6 +158,9 @@ import {
133
158
  import {
134
159
  unionWith
135
160
  } from "./chunk-2ZCITDMK.mjs";
161
+ import {
162
+ uniqWith
163
+ } from "./chunk-237HGSZS.mjs";
136
164
  import {
137
165
  uniq
138
166
  } from "./chunk-DVK2N4KC.mjs";
@@ -140,11 +168,11 @@ import {
140
168
  uniqBy
141
169
  } from "./chunk-B4COTK4K.mjs";
142
170
  import {
143
- uniqWith
144
- } from "./chunk-237HGSZS.mjs";
171
+ orderBy
172
+ } from "./chunk-7B7W36UP.mjs";
145
173
  import {
146
- unzip
147
- } from "./chunk-UYZKMBDO.mjs";
174
+ partition
175
+ } from "./chunk-DN3NOZ3H.mjs";
148
176
  import {
149
177
  sample
150
178
  } from "./chunk-2KNLZB7V.mjs";
@@ -170,11 +198,11 @@ import {
170
198
  takeRight
171
199
  } from "./chunk-IQLKIDXF.mjs";
172
200
  import {
173
- takeRightWhile
174
- } from "./chunk-NTLX2MPV.mjs";
201
+ initial
202
+ } from "./chunk-XPSOKBRZ.mjs";
175
203
  import {
176
- takeWhile
177
- } from "./chunk-2IXFGSUA.mjs";
204
+ intersection
205
+ } from "./chunk-FVVSE2F2.mjs";
178
206
  import {
179
207
  intersectionBy
180
208
  } from "./chunk-O6UXZR3U.mjs";
@@ -194,14 +222,17 @@ import {
194
222
  minBy
195
223
  } from "./chunk-IJD7FE2Z.mjs";
196
224
  import {
197
- orderBy
198
- } from "./chunk-7B7W36UP.mjs";
225
+ fill
226
+ } from "./chunk-YFN6KOC4.mjs";
199
227
  import {
200
- partition
201
- } from "./chunk-DN3NOZ3H.mjs";
228
+ flatMap
229
+ } from "./chunk-UY76KTPE.mjs";
202
230
  import {
203
231
  flattenDeep
204
232
  } from "./chunk-ML727RRJ.mjs";
233
+ import {
234
+ flatten
235
+ } from "./chunk-33MSBDC6.mjs";
205
236
  import {
206
237
  forEachRight
207
238
  } from "./chunk-IEA53J7P.mjs";
@@ -212,11 +243,11 @@ import {
212
243
  head
213
244
  } from "./chunk-HM2JT2RX.mjs";
214
245
  import {
215
- initial
216
- } from "./chunk-XPSOKBRZ.mjs";
246
+ countBy
247
+ } from "./chunk-CRSKT4WW.mjs";
217
248
  import {
218
- intersection
219
- } from "./chunk-FVVSE2F2.mjs";
249
+ difference
250
+ } from "./chunk-JPUKH67K.mjs";
220
251
  import {
221
252
  differenceBy
222
253
  } from "./chunk-LVWX5B43.mjs";
@@ -235,27 +266,6 @@ import {
235
266
  import {
236
267
  dropWhile
237
268
  } from "./chunk-LJ2C6MVP.mjs";
238
- import {
239
- fill
240
- } from "./chunk-YFN6KOC4.mjs";
241
- import {
242
- flatMap
243
- } from "./chunk-UY76KTPE.mjs";
244
- import {
245
- flatten
246
- } from "./chunk-33MSBDC6.mjs";
247
- import {
248
- chunk
249
- } from "./chunk-E6C5EZQA.mjs";
250
- import {
251
- compact
252
- } from "./chunk-DTJJIMKJ.mjs";
253
- import {
254
- countBy
255
- } from "./chunk-CRSKT4WW.mjs";
256
- import {
257
- difference
258
- } from "./chunk-JPUKH67K.mjs";
259
269
  import "./chunk-F47GLYUU.mjs";
260
270
  import {
261
271
  AbortError
@@ -263,22 +273,12 @@ import {
263
273
  import {
264
274
  TimeoutError
265
275
  } from "./chunk-KIOYQRMQ.mjs";
266
- import "./chunk-236H5JZJ.mjs";
267
276
  import {
268
- negate
269
- } from "./chunk-BOOQBJN2.mjs";
270
- import {
271
- noop
272
- } from "./chunk-LKXCOLNY.mjs";
273
- import {
274
- once
275
- } from "./chunk-CMBC4MXG.mjs";
276
- import {
277
- throttle
278
- } from "./chunk-QOJGMVVR.mjs";
277
+ chunk
278
+ } from "./chunk-E6C5EZQA.mjs";
279
279
  import {
280
- debounce
281
- } from "./chunk-3IP4JVLL.mjs";
280
+ compact
281
+ } from "./chunk-DTJJIMKJ.mjs";
282
282
  import "./chunk-24FKGR6U.mjs";
283
283
  export {
284
284
  AbortError,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "es-toolkit",
3
3
  "description": "A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.",
4
- "version": "1.13.0",
4
+ "version": "1.13.1-dev.295+7bfc3e09",
5
5
  "homepage": "https://es-toolkit.slash.page",
6
6
  "bugs": "https://github.com/toss/es-toolkit/issues",
7
7
  "repository": {
@@ -1,2 +1,2 @@
1
- "use strict";(()=>{var N=Object.defineProperty;var I=Object.getOwnPropertySymbols;var tr=Object.prototype.hasOwnProperty,nr=Object.prototype.propertyIsEnumerable;var z=(e,r,t)=>r in e?N(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,V=(e,r)=>{for(var t in r||(r={}))tr.call(r,t)&&z(e,t,r[t]);if(I)for(var t of I(r))nr.call(r,t)&&z(e,t,r[t]);return e};var or=(e,r)=>{for(var t in r)N(e,t,{get:r[t],enumerable:!0})};var y=(e,r,t)=>new Promise((n,o)=>{var i=f=>{try{a(t.next(f))}catch(x){o(x)}},u=f=>{try{a(t.throw(f))}catch(x){o(x)}},a=f=>f.done?n(f.value):Promise.resolve(f.value).then(i,u);a((t=t.apply(e,r)).next())});var M={};or(M,{AbortError:()=>m,TimeoutError:()=>p,camelCase:()=>Je,capitalize:()=>K,chunk:()=>j,clamp:()=>Fe,clone:()=>De,compact:()=>D,countBy:()=>C,debounce:()=>Re,delay:()=>E,difference:()=>d,differenceBy:()=>h,differenceWith:()=>b,drop:()=>L,dropRight:()=>q,dropRightWhile:()=>_,dropWhile:()=>$,fill:()=>Z,flatMap:()=>G,flatten:()=>s,flattenDeep:()=>H,flattenObject:()=>Ce,forEachRight:()=>X,groupBy:()=>J,head:()=>ge,inRange:()=>Ee,initial:()=>Ae,intersection:()=>g,intersectionBy:()=>w,intersectionWith:()=>U,invert:()=>je,isEqual:()=>B,isLength:()=>Ge,isNil:()=>qe,isNotNil:()=>_e,isNull:()=>$e,isPlainObject:()=>F,isUndefined:()=>Ze,kebabCase:()=>Ye,keyBy:()=>Q,last:()=>ke,lowerCase:()=>er,maxBy:()=>Y,mean:()=>P,meanBy:()=>Ke,minBy:()=>ee,negate:()=>Pe,noop:()=>ve,omit:()=>Ie,omitBy:()=>ze,once:()=>We,orderBy:()=>re,partition:()=>te,pick:()=>Ne,pickBy:()=>Ve,random:()=>k,randomInt:()=>A,range:()=>Se,round:()=>Be,sample:()=>ne,sampleSize:()=>oe,shuffle:()=>ie,snakeCase:()=>Qe,startCase:()=>rr,sum:()=>T,sumBy:()=>Me,tail:()=>we,take:()=>ue,takeRight:()=>ae,takeRightWhile:()=>fe,takeWhile:()=>le,throttle:()=>Oe,toFilled:()=>Ue,union:()=>c,unionBy:()=>v,unionWith:()=>O,uniq:()=>R,uniqBy:()=>se,uniqWith:()=>W,unzip:()=>ce,unzipWith:()=>me,withTimeout:()=>Xe,without:()=>be,xor:()=>pe,xorBy:()=>Te,xorWith:()=>xe,zip:()=>ye,zipObject:()=>de,zipWith:()=>he});function j(e,r){if(!Number.isInteger(r)||r<=0)throw new Error("Size must be an integer greater than zero.");let t=Math.ceil(e.length/r),n=Array(t);for(let o=0;o<t;o++){let i=o*r,u=i+r;n[o]=e.slice(i,u)}return n}function D(e){let r=[];for(let t of e)t&&r.push(t);return r}function C(e,r){var n;let t={};for(let o of e){let i=r(o);t[i]=((n=t[i])!=null?n:0)+1}return t}function d(e,r){let t=new Set(r);return e.filter(n=>!t.has(n))}function h(e,r,t){let n=new Set(r.map(o=>t(o)));return e.filter(o=>!n.has(t(o)))}function b(e,r,t){return e.filter(n=>r.every(o=>!t(n,o)))}function L(e,r){return r=Math.max(r,0),e.slice(r)}function q(e,r){return r=Math.min(-r,0),r===0?e.slice():e.slice(0,r)}function _(e,r){for(let t=e.length-1;t>=0;t--)if(!r(e[t]))return e.slice(0,t+1);return[]}function $(e,r){let t=e.findIndex(n=>!r(n));return t===-1?[]:e.slice(t)}function Z(e,r,t=0,n=e.length){let o=e.length,i=Math.max(t>=0?t:o+t,0),u=Math.min(n>=0?n:o+n,o);for(let a=i;a<u;a++)e[a]=r;return e}function s(e,r=1){let t=[],n=Math.floor(r),o=(i,u)=>{for(let a of i)Array.isArray(a)&&u<n?o(a,u+1):t.push(a)};return o(e,0),t}function G(e,r,t=1){return s(e.map(n=>r(n)),t)}function H(e){return s(e,1/0)}function X(e,r){for(let t=e.length-1;t>=0;t--){let n=e[t];r(n,t,e)}}function J(e,r){let t={};for(let n of e){let o=r(n);t[o]==null&&(t[o]=[]),t[o].push(n)}return t}function g(e,r){let t=new Set(r);return e.filter(n=>t.has(n))}function w(e,r,t){let n=new Set(r.map(t));return e.filter(o=>n.has(t(o)))}function U(e,r,t){return e.filter(n=>r.some(o=>t(n,o)))}function Q(e,r){let t={};for(let n of e){let o=r(n);t[o]=n}return t}function Y(e,r){let t=e[0],n=-1/0;for(let o of e){let i=r(o);i>n&&(n=i,t=o)}return t}function ee(e,r){let t=e[0],n=1/0;for(let o of e){let i=r(o);i<n&&(n=i,t=o)}return t}function re(e,r,t){let n=(i,u,a)=>i<u?a==="asc"?-1:1:i>u?a==="asc"?1:-1:0,o=r.map((i,u)=>t[u]||t[t.length-1]);return e.slice().sort((i,u)=>{for(let a=0;a<r.length;a++){let f=r[a],x=o[a],S=n(i[f],u[f],x);if(S!==0)return S}return 0})}function te(e,r){let t=[],n=[];for(let o of e)r(o)?t.push(o):n.push(o);return[t,n]}function ne(e){let r=Math.floor(Math.random()*e.length);return e[r]}function k(e,r){if(r==null&&(r=e,e=0),e>=r)throw new Error("Invalid input: The maximum value must be greater than the minimum value.");return Math.random()*(r-e)+e}function A(e,r){return Math.floor(k(e,r))}function oe(e,r){if(r>e.length)throw new Error("Size must be less than or equal to the length of array.");let t=new Array(r),n=new Set;for(let o=e.length-r,i=0;o<e.length;o++,i++){let u=A(0,o+1);n.has(u)&&(u=o),n.add(u),t[i]=e[u]}return t}function ie(e){let r=e.slice();for(let t=r.length-1;t>=1;t--){let n=Math.floor(Math.random()*(t+1));[r[t],r[n]]=[r[n],r[t]]}return r}function ue(e,r){return e.slice(0,r)}function ae(e,r){return r===0?[]:e.slice(-r)}function fe(e,r){for(let t=e.length-1;t>=0;t--)if(!r(e[t]))return e.slice(t+1);return e.slice()}function le(e,r){let t=[];for(let n of e){if(!r(n))break;t.push(n)}return t}function R(e){return Array.from(new Set(e))}function c(e,r){return R(e.concat(r))}function v(e,r,t){let n=new Map;for(let o of[...e,...r]){let i=t(o);n.has(i)||n.set(i,o)}return Array.from(n.values())}function W(e,r){let t=[];for(let n of e)t.every(i=>!r(i,n))&&t.push(n);return t}function O(e,r,t){return W(e.concat(r),t)}function se(e,r){let t=new Map;for(let n of e){let o=r(n);t.has(o)||t.set(o,n)}return Array.from(t.values())}function ce(e){let r=0;for(let n=0;n<e.length;n++)e[n].length>r&&(r=e[n].length);let t=new Array(r);for(let n=0;n<r;n++){t[n]=new Array(e.length);for(let o=0;o<e.length;o++)t[n][o]=e[o][n]}return t}function me(e,r){let t=Math.max(...e.map(o=>o.length)),n=new Array(t);for(let o=0;o<t;o++){let i=new Array(e.length);for(let u=0;u<e.length;u++)i[u]=e[u][o];n[o]=r(...i)}return n}function pe(e,r){return d(c(e,r),g(e,r))}function Te(e,r,t){let n=v(e,r,t),o=w(e,r,t);return h(n,o,t)}function xe(e,r,t){let n=O(e,r,t),o=U(e,r,t);return b(n,o,t)}function ye(...e){let r=[],t=Math.max(...e.map(n=>n.length));for(let n=0;n<t;n++){let o=[];for(let i of e)o.push(i[n]);r.push(o)}return r}function de(e,r){let t={};for(let n=0;n<e.length;n++)t[e[n]]=r[n];return t}function he(e,...r){let t=[e,...r.slice(0,-1)],n=r[r.length-1],o=[],i=Math.max(...t.map(u=>u.length));for(let u=0;u<i;u++){let a=t.map(f=>f[u]);o.push(n(...a))}return o}function be(e,...r){let t=new Set(r);return e.filter(n=>!t.has(n))}function ge(e){return e[0]}function we(e){let r=e.length;if(r<=1)return[];let t=new Array(r-1);for(let n=1;n<r;n++)t[n-1]=e[n];return t}function Ue(e,r,t=0,n=e.length){let o=e.length,i=Math.max(t>=0?t:o+t,0),u=Math.min(n>=0?n:o+n,o),a=e.slice();for(let f=i;f<u;f++)a[f]=r;return a}function ke(e){return e[e.length-1]}function Ae(e){return e.length<=1?[]:e.slice(0,-1)}var m=class extends Error{constructor(r="The operation was aborted"){super(r),this.name="AbortError"}};var p=class extends Error{constructor(r="The operation was timed out"){super(r),this.name="TimeoutError"}};function Re(e,r,{signal:t}={}){let n=null,o=function(...u){n!==null&&clearTimeout(n),!(t!=null&&t.aborted)&&(n=setTimeout(()=>{e(...u),n=null},r))},i=function(){o.cancel()};return o.cancel=function(){n!==null&&(clearTimeout(n),n=null)},t==null||t.addEventListener("abort",i,{once:!0}),o}function ve(){}function We(e){let r=!1,t;return function(){if(r)return t;let n=e();return r=!0,t=n,n}}function Oe(e,r){let t;return function(...o){let i=Date.now();(t==null||i-t>=r)&&(t=i,e(...o))}}function Pe(e){return(...r)=>!e(...r)}function Fe(e,r,t){return t==null?Math.min(e,r):Math.min(Math.max(e,r),t)}function Ee(e,r,t){if(t==null&&(t=r,r=0),r>=t)throw new Error("The maximum value must be greater than the minimum value.");return r<=e&&e<t}function T(e){let r=0;for(let t=0;t<e.length;t++)r+=e[t];return r}function P(e){return T(e)/e.length}function Ke(e,r){let t=e.map(n=>r(n));return P(t)}function Be(e,r=0){if(!Number.isInteger(r))throw new Error("Precision must be an integer.");let t=Math.pow(10,r);return Math.round(e*t)/t}function Me(e,r){let t=e.map(n=>r(n));return T(t)}function Se(e,r,t){if(r==null&&(r=e,e=0),t==null&&(t=1),!Number.isInteger(t)||t===0)throw new Error("The step value must be a non-zero integer.");let n=Math.max(Math.ceil((r-e)/t),0),o=new Array(n);for(let i=0;i<n;i++)o[i]=e+i*t;return o}function Ie(e,r){let t=V({},e);for(let n of r)delete t[n];return t}function ze(e,r){let t={};for(let[n,o]of Object.entries(e))r(o,n)||(t[n]=o);return t}function Ne(e,r){let t={};for(let n of r)t[n]=e[n];return t}function Ve(e,r){let t={};for(let[n,o]of Object.entries(e))r(o,n)&&(t[n]=o);return t}function je(e){let r={},t=Object.keys(e);for(let n=0;n<t.length;n++){let o=t[n],i=e[o];r[i]=o}return r}function De(e){if(ir(e))return e;if(Array.isArray(e))return e.slice();if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e.source,e.flags);if(e instanceof Map){let r=new Map;for(let[t,n]of e)r.set(t,n);return r}if(e instanceof Set){let r=new Set;for(let t of e)r.add(t);return r}return typeof e=="object"?Object.assign({},e):e}function ir(e){return e==null||typeof e!="object"&&typeof e!="function"}function F(e){if(typeof e!="object"||e==null)return!1;if(Object.getPrototypeOf(e)===null)return!0;if(e.toString()!=="[object Object]")return!1;let r=e;for(;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(e)===r}function Ce(e){return Le(e)}function Le(e,r=""){let t={},n=Object.keys(e);for(let o=0;o<n.length;o++){let i=n[o],u=e[i],a=r?`${r}.${i}`:i;if(F(u)&&Object.keys(u).length>0){Object.assign(t,Le(u,a));continue}if(Array.isArray(u)){for(let f=0;f<u.length;f++)t[`${a}.${f}`]=u[f];continue}t[a]=u}return t}function B(e,r){if(Object.is(e,r))return!0;if(e instanceof Date&&r instanceof Date)return e.getTime()===r.getTime();if(e instanceof RegExp&&r instanceof RegExp)return e.source===r.source&&e.flags===r.flags;if(typeof e!="object"||typeof r!="object"||e===null||r===null)return!1;let t=Object.keys(e),n=Object.keys(r);if(t.length!==n.length||c(t,n).length!==t.length)return!1;for(let o=0;o<t.length;o++){let i=t[o],u=e[i],a=r[i];if(!B(u,a))return!1}return!0}function qe(e){return e==null}function _e(e){return e!=null}function $e(e){return e===null}function Ze(e){return e===void 0}function Ge(e){return typeof e=="number"&&e>-1&&e%1===0&&e<=Number.MAX_SAFE_INTEGER}function E(e,{signal:r}={}){return new Promise((t,n)=>{let o=()=>{n(new m)},i=()=>{clearTimeout(u),o()};if(r!=null&&r.aborted)return o();let u=setTimeout(t,e);r==null||r.addEventListener("abort",i,{once:!0})})}function He(e){return y(this,null,function*(){throw yield E(e),new p})}function Xe(e,r){return y(this,null,function*(){return Promise.race([e(),He(r)])})}var K=e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase();var ur=/[A-Z]?[a-z]+|[0-9]+|[A-Z]+(?![a-z])/g;function l(e){var r;return Array.from((r=e.match(ur))!=null?r:[])}function Je(e){let r=l(e);if(r.length===0)return"";let[t,...n]=r;return`${t.toLowerCase()}${n.map(o=>K(o)).join("")}`}var Qe=e=>l(e).map(t=>t.toLowerCase()).join("_");var Ye=e=>l(e).map(t=>t.toLowerCase()).join("-");var er=e=>l(e).map(t=>t.toLowerCase()).join(" ");function rr(e){let r=l(e.trim()),t="";for(let n of r)t&&(t+=" "),n===n.toUpperCase()?t+=n:t+=n[0].toUpperCase()+n.slice(1).toLowerCase();return t}window._=M;})();
1
+ "use strict";(()=>{var z=Object.defineProperty;var V=Object.getOwnPropertySymbols;var xt=Object.prototype.hasOwnProperty,yt=Object.prototype.propertyIsEnumerable;var N=(e,t,r)=>t in e?z(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,C=(e,t)=>{for(var r in t||(t={}))xt.call(t,r)&&N(e,r,t[r]);if(V)for(var r of V(t))yt.call(t,r)&&N(e,r,t[r]);return e};var ht=(e,t)=>{for(var r in t)z(e,r,{get:t[r],enumerable:!0})};var y=(e,t,r)=>new Promise((n,o)=>{var i=a=>{try{f(r.next(a))}catch(c){o(c)}},u=a=>{try{f(r.throw(a))}catch(c){o(c)}},f=a=>a.done?n(a.value):Promise.resolve(a.value).then(i,u);f((r=r.apply(e,t)).next())});var B={};ht(B,{AbortError:()=>p,TimeoutError:()=>T,camelCase:()=>Qe,capitalize:()=>D,chunk:()=>ot,clamp:()=>We,clone:()=>Ce,compact:()=>L,concat:()=>it,countBy:()=>q,debounce:()=>Ue,delay:()=>v,difference:()=>ut,differenceBy:()=>b,differenceWith:()=>g,drop:()=>$,dropRight:()=>G,dropRightWhile:()=>X,dropWhile:()=>Z,endsWith:()=>pt,fill:()=>H,first:()=>F,flatMap:()=>Y,flatten:()=>l,flattenDeep:()=>J,flattenObject:()=>Le,forEachRight:()=>Q,get:()=>st,groupBy:()=>ee,head:()=>F,inRange:()=>ve,initial:()=>Ae,intersection:()=>K,intersectionBy:()=>k,intersectionWith:()=>w,invert:()=>ze,isEqual:()=>M,isLength:()=>He,isNil:()=>$e,isNotNil:()=>Ge,isNull:()=>Xe,isPlainObject:()=>ct,isUndefined:()=>Ze,kebabCase:()=>tt,keyBy:()=>te,last:()=>Pe,lowerCase:()=>rt,max:()=>Tt,maxBy:()=>re,mean:()=>W,meanBy:()=>De,min:()=>dt,minBy:()=>ne,negate:()=>je,noop:()=>Re,omit:()=>Me,omitBy:()=>Be,once:()=>Ee,orderBy:()=>oe,partition:()=>ie,pick:()=>Ve,pickBy:()=>Ne,random:()=>P,randomInt:()=>A,range:()=>Fe,round:()=>Se,sample:()=>ue,sampleSize:()=>fe,set:()=>I,shuffle:()=>ae,snakeCase:()=>et,startCase:()=>nt,startsWith:()=>mt,sum:()=>d,sumBy:()=>Ie,tail:()=>ke,take:()=>le,takeRight:()=>se,takeRightWhile:()=>ce,takeWhile:()=>me,throttle:()=>Oe,toFilled:()=>we,union:()=>m,unionBy:()=>R,unionWith:()=>O,uniq:()=>U,uniqBy:()=>pe,uniqWith:()=>E,unzip:()=>Te,unzipWith:()=>de,withTimeout:()=>Je,without:()=>Ke,xor:()=>xe,xorBy:()=>ye,xorWith:()=>he,zip:()=>j,zipObject:()=>be,zipObjectDeep:()=>at,zipWith:()=>ge});function _(e,t){if(!Number.isInteger(t)||t<=0)throw new Error("Size must be an integer greater than zero.");let r=Math.ceil(e.length/t),n=Array(r);for(let o=0;o<r;o++){let i=o*t,u=i+t;n[o]=e.slice(i,u)}return n}function L(e){let t=[];for(let r of e)r&&t.push(r);return t}function q(e,t){var n;let r={};for(let o of e){let i=t(o);r[i]=((n=r[i])!=null?n:0)+1}return r}function h(e,t){let r=new Set(t);return e.filter(n=>!r.has(n))}function b(e,t,r){let n=new Set(t.map(o=>r(o)));return e.filter(o=>!n.has(r(o)))}function g(e,t,r){return e.filter(n=>t.every(o=>!r(n,o)))}function $(e,t){return t=Math.max(t,0),e.slice(t)}function G(e,t){return t=Math.min(-t,0),t===0?e.slice():e.slice(0,t)}function X(e,t){for(let r=e.length-1;r>=0;r--)if(!t(e[r]))return e.slice(0,r+1);return[]}function Z(e,t){let r=e.findIndex(n=>!t(n));return r===-1?[]:e.slice(r)}function H(e,t,r=0,n=e.length){let o=e.length,i=Math.max(r>=0?r:o+r,0),u=Math.min(n>=0?n:o+n,o);for(let f=i;f<u;f++)e[f]=t;return e}function l(e,t=1){let r=[],n=Math.floor(t),o=(i,u)=>{for(let f of i)Array.isArray(f)&&u<n?o(f,u+1):r.push(f)};return o(e,0),r}function Y(e,t,r=1){return l(e.map(n=>t(n)),r)}function J(e){return l(e,1/0)}function Q(e,t){for(let r=e.length-1;r>=0;r--){let n=e[r];t(n,r,e)}}function ee(e,t){let r={};for(let n of e){let o=t(n);r[o]==null&&(r[o]=[]),r[o].push(n)}return r}function K(e,t){let r=new Set(t);return e.filter(n=>r.has(n))}function k(e,t,r){let n=new Set(t.map(r));return e.filter(o=>n.has(r(o)))}function w(e,t,r){return e.filter(n=>t.some(o=>r(n,o)))}function te(e,t){let r={};for(let n of e){let o=t(n);r[o]=n}return r}function re(e,t){let r=e[0],n=-1/0;for(let o of e){let i=t(o);i>n&&(n=i,r=o)}return r}function ne(e,t){let r=e[0],n=1/0;for(let o of e){let i=t(o);i<n&&(n=i,r=o)}return r}function oe(e,t,r){let n=(i,u,f)=>i<u?f==="asc"?-1:1:i>u?f==="asc"?1:-1:0,o=t.map((i,u)=>r[u]||r[r.length-1]);return e.slice().sort((i,u)=>{for(let f=0;f<t.length;f++){let a=t[f],c=o[f],x=n(i[a],u[a],c);if(x!==0)return x}return 0})}function ie(e,t){let r=[],n=[];for(let o of e)t(o)?r.push(o):n.push(o);return[r,n]}function ue(e){let t=Math.floor(Math.random()*e.length);return e[t]}function P(e,t){if(t==null&&(t=e,e=0),e>=t)throw new Error("Invalid input: The maximum value must be greater than the minimum value.");return Math.random()*(t-e)+e}function A(e,t){return Math.floor(P(e,t))}function fe(e,t){if(t>e.length)throw new Error("Size must be less than or equal to the length of array.");let r=new Array(t),n=new Set;for(let o=e.length-t,i=0;o<e.length;o++,i++){let u=A(0,o+1);n.has(u)&&(u=o),n.add(u),r[i]=e[u]}return r}function ae(e){let t=e.slice();for(let r=t.length-1;r>=1;r--){let n=Math.floor(Math.random()*(r+1));[t[r],t[n]]=[t[n],t[r]]}return t}function le(e,t){return e.slice(0,t)}function se(e,t){return t===0?[]:e.slice(-t)}function ce(e,t){for(let r=e.length-1;r>=0;r--)if(!t(e[r]))return e.slice(r+1);return e.slice()}function me(e,t){let r=[];for(let n of e){if(!t(n))break;r.push(n)}return r}function U(e){return Array.from(new Set(e))}function m(e,t){return U(e.concat(t))}function R(e,t,r){let n=new Map;for(let o of[...e,...t]){let i=r(o);n.has(i)||n.set(i,o)}return Array.from(n.values())}function E(e,t){let r=[];for(let n of e)r.every(i=>!t(i,n))&&r.push(n);return r}function O(e,t,r){return E(e.concat(t),r)}function pe(e,t){let r=new Map;for(let n of e){let o=t(n);r.has(o)||r.set(o,n)}return Array.from(r.values())}function Te(e){let t=0;for(let n=0;n<e.length;n++)e[n].length>t&&(t=e[n].length);let r=new Array(t);for(let n=0;n<t;n++){r[n]=new Array(e.length);for(let o=0;o<e.length;o++)r[n][o]=e[o][n]}return r}function de(e,t){let r=Math.max(...e.map(o=>o.length)),n=new Array(r);for(let o=0;o<r;o++){let i=new Array(e.length);for(let u=0;u<e.length;u++)i[u]=e[u][o];n[o]=t(...i)}return n}function xe(e,t){return h(m(e,t),K(e,t))}function ye(e,t,r){let n=R(e,t,r),o=k(e,t,r);return b(n,o,r)}function he(e,t,r){let n=O(e,t,r),o=w(e,t,r);return g(n,o,r)}function j(...e){let t=[],r=Math.max(...e.map(n=>n.length));for(let n=0;n<r;n++){let o=[];for(let i of e)o.push(i[n]);t.push(o)}return t}function be(e,t){let r={};for(let n=0;n<e.length;n++)r[e[n]]=t[n];return r}function ge(e,...t){let r=[e,...t.slice(0,-1)],n=t[t.length-1],o=[],i=Math.max(...r.map(u=>u.length));for(let u=0;u<i;u++){let f=r.map(a=>a[u]);o.push(n(...f))}return o}function Ke(e,...t){let r=new Set(t);return e.filter(n=>!r.has(n))}function F(e){return e[0]}function ke(e){let t=e.length;if(t<=1)return[];let r=new Array(t-1);for(let n=1;n<t;n++)r[n-1]=e[n];return r}function we(e,t,r=0,n=e.length){let o=e.length,i=Math.max(r>=0?r:o+r,0),u=Math.min(n>=0?n:o+n,o),f=e.slice();for(let a=i;a<u;a++)f[a]=t;return f}function Pe(e){return e[e.length-1]}function Ae(e){return e.length<=1?[]:e.slice(0,-1)}var p=class extends Error{constructor(t="The operation was aborted"){super(t),this.name="AbortError"}};var T=class extends Error{constructor(t="The operation was timed out"){super(t),this.name="TimeoutError"}};function Ue(e,t,{signal:r}={}){let n=null,o=function(...u){n!==null&&clearTimeout(n),!(r!=null&&r.aborted)&&(n=setTimeout(()=>{e(...u),n=null},t))},i=function(){o.cancel()};return o.cancel=function(){n!==null&&(clearTimeout(n),n=null)},r==null||r.addEventListener("abort",i,{once:!0}),o}function Re(){}function Ee(e){let t=!1,r;return function(){if(t)return r;let n=e();return t=!0,r=n,n}}function Oe(e,t){let r;return function(...o){let i=Date.now();(r==null||i-r>=t)&&(r=i,e(...o))}}function je(e){return(...t)=>!e(...t)}function We(e,t,r){return r==null?Math.min(e,t):Math.min(Math.max(e,t),r)}function ve(e,t,r){if(r==null&&(r=t,t=0),t>=r)throw new Error("The maximum value must be greater than the minimum value.");return t<=e&&e<r}function d(e){let t=0;for(let r=0;r<e.length;r++)t+=e[r];return t}function W(e){return d(e)/e.length}function De(e,t){let r=e.map(n=>t(n));return W(r)}function Se(e,t=0){if(!Number.isInteger(t))throw new Error("Precision must be an integer.");let r=Math.pow(10,t);return Math.round(e*r)/r}function Ie(e,t){let r=e.map(n=>t(n));return d(r)}function Fe(e,t,r){if(t==null&&(t=e,e=0),r==null&&(r=1),!Number.isInteger(r)||r===0)throw new Error("The step value must be a non-zero integer.");let n=Math.max(Math.ceil((t-e)/r),0),o=new Array(n);for(let i=0;i<n;i++)o[i]=e+i*r;return o}function Me(e,t){let r=C({},e);for(let n of t)delete r[n];return r}function Be(e,t){let r={};for(let[n,o]of Object.entries(e))t(o,n)||(r[n]=o);return r}function Ve(e,t){let r={};for(let n of t)r[n]=e[n];return r}function Ne(e,t){let r={};for(let[n,o]of Object.entries(e))t(o,n)&&(r[n]=o);return r}function ze(e){let t={},r=Object.keys(e);for(let n=0;n<r.length;n++){let o=r[n],i=e[o];t[i]=o}return t}function Ce(e){if(bt(e))return e;if(Array.isArray(e))return e.slice();if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e.source,e.flags);if(e instanceof Map){let t=new Map;for(let[r,n]of e)t.set(r,n);return t}if(e instanceof Set){let t=new Set;for(let r of e)t.add(r);return t}return typeof e=="object"?Object.assign({},e):e}function bt(e){return e==null||typeof e!="object"&&typeof e!="function"}function _e(e){if(typeof e!="object"||e==null)return!1;if(Object.getPrototypeOf(e)===null)return!0;if(e.toString()!=="[object Object]")return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function Le(e){return qe(e)}function qe(e,t=""){let r={},n=Object.keys(e);for(let o=0;o<n.length;o++){let i=n[o],u=e[i],f=t?`${t}.${i}`:i;if(_e(u)&&Object.keys(u).length>0){Object.assign(r,qe(u,f));continue}if(Array.isArray(u)){for(let a=0;a<u.length;a++)r[`${f}.${a}`]=u[a];continue}r[f]=u}return r}function M(e,t){if(Object.is(e,t))return!0;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(e instanceof RegExp&&t instanceof RegExp)return e.source===t.source&&e.flags===t.flags;if(typeof e!="object"||typeof t!="object"||e===null||t===null)return!1;let r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length||m(r,n).length!==r.length)return!1;for(let o=0;o<r.length;o++){let i=r[o],u=e[i],f=t[i];if(!M(u,f))return!1}return!0}function $e(e){return e==null}function Ge(e){return e!=null}function Xe(e){return e===null}function Ze(e){return e===void 0}function He(e){return typeof e=="number"&&e>-1&&e%1===0&&e<=Number.MAX_SAFE_INTEGER}function v(e,{signal:t}={}){return new Promise((r,n)=>{let o=()=>{n(new p)},i=()=>{clearTimeout(u),o()};if(t!=null&&t.aborted)return o();let u=setTimeout(r,e);t==null||t.addEventListener("abort",i,{once:!0})})}function Ye(e){return y(this,null,function*(){throw yield v(e),new T})}function Je(e,t){return y(this,null,function*(){return Promise.race([e(),Ye(t)])})}var D=e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase();var gt=/[A-Z]?[a-z]+|[0-9]+|[A-Z]+(?![a-z])/g;function s(e){var t;return Array.from((t=e.match(gt))!=null?t:[])}function Qe(e){let t=s(e);if(t.length===0)return"";let[r,...n]=t;return`${r.toLowerCase()}${n.map(o=>D(o)).join("")}`}var et=e=>s(e).map(r=>r.toLowerCase()).join("_");var tt=e=>s(e).map(r=>r.toLowerCase()).join("-");var rt=e=>s(e).map(r=>r.toLowerCase()).join(" ");function nt(e){let t=s(e.trim()),r="";for(let n of t)r&&(r+=" "),n===n.toUpperCase()?r+=n:r+=n[0].toUpperCase()+n.slice(1).toLowerCase();return r}function ot(e,t=1){return t=Math.max(Math.floor(t),0),t===0?[]:_(e,t)}function it(...e){return l(e)}function ut(e,...t){let r=e,n=l(t);return h(r,n)}var Kt=/^(?:0|[1-9]\d*)$/;function ft(e){switch(typeof e){case"number":return Number.isInteger(e)&&e>=0&&e<Number.MAX_SAFE_INTEGER;case"symbol":return!1;case"string":return Kt.test(e)}}function S(e){let t=/\\(\\)?/g,r=RegExp(`[^.[\\]]+|\\[(?:([^"'][^[]*)|(["'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))`,"g"),n=[];e[0]==="."&&n.push("");let o,i=0,u=0;for(;(o=r.exec(e))!==null;){let[f,a,c,x]=o;c?f=x.replace(t,"$1"):a&&(f=a),n.push(f),r.lastIndex===i?r.lastIndex++:i=r.lastIndex}return n}function I(e,t,r){let n=Array.isArray(t)?t:typeof t=="string"?S(t):[t],o=e;for(let u=0;u<n.length-1;u++){let f=n[u],a=n[u+1];o[f]==null&&(o[f]=ft(a)?[]:{}),o=o[f]}let i=n[n.length-1];return o[i]=r,e}function at(e,t){let r={},n=j(e,t);for(let o=0;o<n.length;o++){let[i,u]=n[o];i!=null&&I(r,i,u)}return r}var kt=/^\w*$/,wt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/;function lt(e){switch(typeof e){case"number":case"symbol":return!1;case"string":return!kt.test(e)&&wt.test(e)}}function st(e,t,r){let n;if(Array.isArray(t)?n=t:typeof t=="string"&&lt(t)&&(e==null?void 0:e[t])==null?n=S(t):n=[t],n.length===0)return r;let o=e,i;for(i=0;i<n.length&&o!=null;i++){let u=n[i];Object.is(u.valueOf(),-0)&&(u="-0"),o=o[u]}return o===null&&i===n.length||o!=null?o:r}function ct(e){var r;if(typeof e!="object"||e==null)return!1;if(Object.getPrototypeOf(e)===null)return!0;if(e.toString()!=="[object Object]"){let n=e[Symbol.toStringTag];return n==null||!((r=Object.getOwnPropertyDescriptor(e,Symbol.toStringTag))!=null&&r.writable)?!1:e.toString()===`[object ${n}]`}let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}var mt=(e,t,r=0)=>e.startsWith(t,r);var pt=(e,t,r=e.length)=>e.endsWith(t,r);function Tt(e=[]){let t=e[0],r;for(let n of e)(r==null||n>r)&&(r=n,t=n);return t}function dt(e=[]){let t=e[0],r;for(let n of e)(r==null||n<r)&&(r=n,t=n);return t}window._=B;})();
2
2
  //# sourceMappingURL=browser.global.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * es-toolkit\n * ====================================\n * A modern JavaScript utility library that's 2-3 times faster and up to 97% smaller—a major upgrade to lodash.\n *\n * es-toolkit is a state-of-the-art, high-performance JavaScript utility library\n * with a small bundle size and strong type annotations.\n *\n * - es-toolkit offers a variety of everyday utility functions with modern implementations, such as [debounce](https://es-toolkit.slash.page/reference/function/debounce.html), [delay](https://es-toolkit.slash.page/reference/promise/delay.html), [chunk](https://es-toolkit.slash.page/reference/array/chunk.html), [sum](https://es-toolkit.slash.page/reference/math/sum.html), and [pick](https://es-toolkit.slash.page/reference/object/pick.html).\n * - Designed with performance in mind, es-toolkit achieves [2-3× better performance](https://es-toolkit.slash.page/performance.html) in modern JavaScript environments.\n * - es-toolkit supports tree shaking out of the box, and [reduces JavaScript code by up to 97%](https://es-toolkit.slash.page/bundle-size.html) compared to other libraries.\n * - es-toolkit includes built-in TypeScript support, with straightforward yet robust types. It also provides useful type guards such as [isNotNil](https://es-toolkit.slash.page/reference/predicate/isNotNil.html).\n * - es-toolkit is battle-tested with 100% test coverage, ensuring reliability and robustness.\n *\n * ## Features\n *\n * Here are some of the features es-toolkit offers:\n *\n * - **Array**: Utilities for array manipulation, such as [uniq](https://es-toolkit.slash.page/reference/array/uniq.html) and [difference](https://es-toolkit.slash.page/reference/array/difference.html).\n * - **Function**: Tools for controlling function execution, including [debounce](https://es-toolkit.slash.page/reference/function/debounce.html) and [throttle](https://es-toolkit.slash.page/reference/function/throttle.html).\n * - **Math**: Numerical utilities like [sum](https://es-toolkit.slash.page/reference/math/sum.html) and [round](https://es-toolkit.slash.page/reference/math/round.html).\n * - **Object**: Tools for manipulating JavaScript objects, such as [pick](https://es-toolkit.slash.page/reference/object/pick.html) and [omit](https://es-toolkit.slash.page/reference/object/omit.html).\n * - **Predicate**: Type guard functions like [isNotNil](https://es-toolkit.slash.page/reference/predicate/isNotNil.html).\n * - **Promise**: Asynchronous utilities like [delay](https://es-toolkit.slash.page/reference/promise/delay.html).\n * - **String**: Utilities for string manipulation, such as [snakeCase](https://es-toolkit.slash.page/reference/string/snakeCase.html)\n *\n * ## Examples\n *\n * ```typescript\n * // import from '@es-toolkit/es-toolkit' in jsr.\n * import { debounce, chunk } from 'es-toolkit';\n *\n * const debouncedLog = debounce(message => {\n * console.log(message);\n * }, 300);\n *\n * // This call will be debounced\n * debouncedLog('Hello, world!');\n *\n * const array = [1, 2, 3, 4, 5, 6];\n * const chunkedArray = chunk(array, 2);\n *\n * console.log(chunkedArray);\n * // Output: [[1, 2], [3, 4], [5, 6]]\n * ```\n *\n * ## Resources\n *\n * If you want to know more about the project, please take a look at the\n * following resources:\n *\n * - [GitHub](https://github.com/toss/es-toolkit)\n * - [Documentation](https://es-toolkit.slash.page)\n *\n * @module\n */\nexport * from './array/index.ts';\nexport * from './error/index.ts';\nexport * from './function/index.ts';\nexport * from './math/index.ts';\nexport * from './object/index.ts';\nexport * from './predicate/index.ts';\nexport * from './promise/index.ts';\nexport * from './string/index.ts';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;","names":[]}