@vinicunca/perkakas 1.1.0 → 1.2.2

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.
Files changed (76) hide show
  1. package/dist/add.d.cts +0 -1
  2. package/dist/add.d.ts +0 -1
  3. package/dist/chunk-6YAVWI3X.cjs +1 -0
  4. package/dist/chunk-AWXJSK4F.js +1 -0
  5. package/dist/chunk-C3NLWEGJ.js +1 -0
  6. package/dist/{chunk-TW3AOKT4.js → chunk-CUCNZMQN.js} +1 -1
  7. package/dist/{chunk-3TLR3L2W.cjs → chunk-EGUKWDAK.cjs} +1 -1
  8. package/dist/chunk-ETVIOWIV.js +1 -0
  9. package/dist/chunk-GOUUMCT7.cjs +1 -0
  10. package/dist/chunk-I2Z6A55T.js +1 -0
  11. package/dist/chunk-SJMGQLYS.cjs +1 -0
  12. package/dist/{chunk-WP5D3YAQ.cjs → chunk-YNCQNUT4.cjs} +1 -1
  13. package/dist/chunk.cjs +1 -1
  14. package/dist/chunk.d.cts +1 -4
  15. package/dist/chunk.d.ts +1 -4
  16. package/dist/chunk.js +1 -1
  17. package/dist/count-by.cjs +1 -0
  18. package/dist/count-by.d.cts +41 -0
  19. package/dist/count-by.d.ts +41 -0
  20. package/dist/count-by.js +1 -0
  21. package/dist/funnel.cjs +1 -0
  22. package/dist/funnel.d.cts +147 -0
  23. package/dist/funnel.d.ts +147 -0
  24. package/dist/funnel.js +1 -0
  25. package/dist/funnel.lodash-debounce-with-cached-value.test.cjs +1 -0
  26. package/dist/funnel.lodash-debounce-with-cached-value.test.d.cts +2 -0
  27. package/dist/funnel.lodash-debounce-with-cached-value.test.d.ts +2 -0
  28. package/dist/funnel.lodash-debounce-with-cached-value.test.js +1 -0
  29. package/dist/funnel.lodash-debounce.test.cjs +1 -0
  30. package/dist/funnel.lodash-debounce.test.d.cts +2 -0
  31. package/dist/funnel.lodash-debounce.test.d.ts +2 -0
  32. package/dist/funnel.lodash-debounce.test.js +1 -0
  33. package/dist/funnel.lodash-throttle-with-cached-value.test.cjs +1 -0
  34. package/dist/funnel.lodash-throttle-with-cached-value.test.d.cts +2 -0
  35. package/dist/funnel.lodash-throttle-with-cached-value.test.d.ts +2 -0
  36. package/dist/funnel.lodash-throttle-with-cached-value.test.js +1 -0
  37. package/dist/funnel.lodash-throttle.test.cjs +1 -0
  38. package/dist/funnel.lodash-throttle.test.d.cts +2 -0
  39. package/dist/funnel.lodash-throttle.test.d.ts +2 -0
  40. package/dist/funnel.lodash-throttle.test.js +1 -0
  41. package/dist/funnel.reference-batch.test.cjs +1 -0
  42. package/dist/funnel.reference-batch.test.d.cts +2 -0
  43. package/dist/funnel.reference-batch.test.d.ts +2 -0
  44. package/dist/funnel.reference-batch.test.js +1 -0
  45. package/dist/funnel.remeda-debounce.test.cjs +1 -0
  46. package/dist/funnel.remeda-debounce.test.d.cts +2 -0
  47. package/dist/funnel.remeda-debounce.test.d.ts +2 -0
  48. package/dist/funnel.remeda-debounce.test.js +1 -0
  49. package/dist/funnel.test-d.cjs +1 -0
  50. package/dist/funnel.test-d.d.cts +2 -0
  51. package/dist/funnel.test-d.d.ts +2 -0
  52. package/dist/funnel.test-d.js +1 -0
  53. package/dist/funnel.test.cjs +1 -0
  54. package/dist/funnel.test.d.cts +2 -0
  55. package/dist/funnel.test.d.ts +2 -0
  56. package/dist/funnel.test.js +1 -0
  57. package/dist/index.cjs +1 -1
  58. package/dist/index.d.cts +5 -2
  59. package/dist/index.d.ts +5 -2
  60. package/dist/index.js +1 -1
  61. package/dist/int-range-inclusive-Cn-qsrAN.d.cts +12 -0
  62. package/dist/int-range-inclusive-Cn-qsrAN.d.ts +12 -0
  63. package/dist/prop.cjs +1 -1
  64. package/dist/prop.d.cts +1 -0
  65. package/dist/prop.d.ts +1 -0
  66. package/dist/prop.js +1 -1
  67. package/dist/random-integer.cjs +1 -1
  68. package/dist/random-integer.d.cts +3 -2
  69. package/dist/random-integer.d.ts +3 -2
  70. package/dist/random-integer.js +1 -1
  71. package/dist/swap-indices.d.cts +1 -1
  72. package/dist/swap-indices.d.ts +1 -1
  73. package/package.json +9 -9
  74. package/dist/chunk-HE3Z4UIX.js +0 -1
  75. package/dist/chunk-IOSBDH5J.cjs +0 -1
  76. package/dist/chunk-QT66COHU.js +0 -1
@@ -0,0 +1 @@
1
+ "use strict"; function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }var _chunkDOH2U2KJcjs = require('./chunk-DOH2U2KJ.cjs');var _chunkGOUUMCT7cjs = require('./chunk-GOUUMCT7.cjs');var _chunkWYRK6YJUcjs = require('./chunk-WYRK6YJU.cjs');require('./chunk-4MAOF3ZP.cjs');require('./chunk-4YUDBZFA.cjs');function i(e,a,n=0){let l=_chunkGOUUMCT7cjs.a.call(void 0, s=>{e(s.map(({params:t})=>t)).then(t=>{for(let[o,{params:r,promiseCallbacks:[c]}]of s.entries()){let y=a(t,o,...r);c(y)}}).catch(t=>{for(let{promiseCallbacks:[,o]}of s)o(t)})},{reducer:(s,t)=>[..._nullishCoalesce(s, () => ([])),t],maxBurstDurationMs:n,triggerAt:"end"});return{...l,call:async(...s)=>new Promise((...t)=>{l.call({promiseCallbacks:t,params:s})})}}describe("showcase",()=>{it("results as object",async()=>{let e=vi.fn(async o=>_chunkDOH2U2KJcjs.a.call(void 0, o,r=>r.length)),a=i(async o=>await e(o.flat()),(o,r,c)=>o[c]),n=[a.call("short"),a.call("medium"),a.call("loooooooooooooong")];expect(e).toHaveBeenCalledTimes(0);let[l,s,t]=await Promise.all(n);expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["short","medium","loooooooooooooong"]),expect(e).toHaveLastResolvedWith({short:5,medium:6,loooooooooooooong:17}),expect(l).toBe(5),expect(s).toBe(6),expect(t).toBe(17)}),it("results as array",async()=>{let e=vi.fn(async o=>o.map(r=>r.length)),a=i(async o=>await e(o.flat()),(o,r)=>o[r]),n=[a.call("short"),a.call("medium"),a.call("loooooooooooooong")];expect(e).toHaveBeenCalledTimes(0);let[l,s,t]=await Promise.all(n);expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["short","medium","loooooooooooooong"]),expect(e).toHaveLastResolvedWith([5,6,17]),expect(l).toBe(5),expect(s).toBe(6),expect(t).toBe(17)}),it("error handling",async()=>{let e=i(async a=>{if(a.length>1)throw new Error(`Batch too big! ${JSON.stringify(a)}`)},_chunkWYRK6YJUcjs.a.call(void 0, ));await expect(e.call("a")).resolves.toBeUndefined(),await expect(Promise.all([e.call("hello"),e.call("world")])).rejects.toThrow('Batch too big! [["hello"],["world"]]')})});
@@ -0,0 +1,2 @@
1
+
2
+ export { }
@@ -0,0 +1,2 @@
1
+
2
+ export { }
@@ -0,0 +1 @@
1
+ import{a as d}from"./chunk-AX5O7BNT.js";import{a as p}from"./chunk-AWXJSK4F.js";import{a as m}from"./chunk-AFO7BV2X.js";import"./chunk-ENYMRDJU.js";import"./chunk-K2EX7PYH.js";function i(e,a,n=0){let l=p(s=>{e(s.map(({params:t})=>t)).then(t=>{for(let[o,{params:r,promiseCallbacks:[c]}]of s.entries()){let y=a(t,o,...r);c(y)}}).catch(t=>{for(let{promiseCallbacks:[,o]}of s)o(t)})},{reducer:(s,t)=>[...s??[],t],maxBurstDurationMs:n,triggerAt:"end"});return{...l,call:async(...s)=>new Promise((...t)=>{l.call({promiseCallbacks:t,params:s})})}}describe("showcase",()=>{it("results as object",async()=>{let e=vi.fn(async o=>d(o,r=>r.length)),a=i(async o=>await e(o.flat()),(o,r,c)=>o[c]),n=[a.call("short"),a.call("medium"),a.call("loooooooooooooong")];expect(e).toHaveBeenCalledTimes(0);let[l,s,t]=await Promise.all(n);expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["short","medium","loooooooooooooong"]),expect(e).toHaveLastResolvedWith({short:5,medium:6,loooooooooooooong:17}),expect(l).toBe(5),expect(s).toBe(6),expect(t).toBe(17)}),it("results as array",async()=>{let e=vi.fn(async o=>o.map(r=>r.length)),a=i(async o=>await e(o.flat()),(o,r)=>o[r]),n=[a.call("short"),a.call("medium"),a.call("loooooooooooooong")];expect(e).toHaveBeenCalledTimes(0);let[l,s,t]=await Promise.all(n);expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["short","medium","loooooooooooooong"]),expect(e).toHaveLastResolvedWith([5,6,17]),expect(l).toBe(5),expect(s).toBe(6),expect(t).toBe(17)}),it("error handling",async()=>{let e=i(async a=>{if(a.length>1)throw new Error(`Batch too big! ${JSON.stringify(a)}`)},m());await expect(e.call("a")).resolves.toBeUndefined(),await expect(Promise.all([e.call("hello"),e.call("world")])).rejects.toThrow('Batch too big! [["hello"],["world"]]')})});
@@ -0,0 +1 @@
1
+ "use strict"; function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }var _chunkAQRYBCA3cjs = require('./chunk-AQRYBCA3.cjs');var _chunkHC3HZK4Qcjs = require('./chunk-HC3HZK4Q.cjs');var _chunkGOUUMCT7cjs = require('./chunk-GOUUMCT7.cjs');function n(e,{timing:t,waitMs:l,maxWaitMs:i}){if(i!==void 0&&l!==void 0&&i<l)throw new Error(`debounce: maxWaitMs (${i.toString()}) cannot be less than waitMs (${l.toString()})`);let o,s=_chunkGOUUMCT7cjs.a.call(void 0, d=>{o=e(...d)},{reducer:(d,...u)=>u,minQuietPeriodMs:_nullishCoalesce(_nullishCoalesce(l, () => (i)), () => (0)),...i!==void 0&&{maxBurstDurationMs:i},...t==="leading"?{triggerAt:"start"}:t==="both"?{triggerAt:"both"}:{triggerAt:"end"}});return{call:(...d)=>(s.call(...d),o),flush:()=>(s.flush(),o),cancel:()=>{s.cancel()},get isPending(){return!s.isIdle},get cachedValue(){return o}}}describe("main functionality",()=>{it("should debounce a function",async()=>{let e=vi.fn(_chunkAQRYBCA3cjs.a.call(void 0, )),t=n(e,{waitMs:32});expect([t.call("a"),t.call("b"),t.call("c")]).toStrictEqual([void 0,void 0,void 0]),expect(e).toHaveBeenCalledTimes(0),await _chunkHC3HZK4Qcjs.a.call(void 0, 128),expect(e).toHaveBeenCalledTimes(1),expect([t.call("d"),t.call("e"),t.call("f")]).toStrictEqual(["c","c","c"]),expect(e).toHaveBeenCalledTimes(1),await _chunkHC3HZK4Qcjs.a.call(void 0, 256),expect(e).toHaveBeenCalledTimes(2)}),it("subsequent debounced calls return the last `func` result",async()=>{let e=n(_chunkAQRYBCA3cjs.a.call(void 0, ),{waitMs:32});e.call("a"),await _chunkHC3HZK4Qcjs.a.call(void 0, 64),expect(e.call("b")).toBe("a"),await _chunkHC3HZK4Qcjs.a.call(void 0, 128),expect(e.call("c")).toBe("b")}),it("should not immediately call `func` when `wait` is `0`",async()=>{let e=vi.fn(),t=n(e,{});t.call(),t.call(),expect(e).toHaveBeenCalledTimes(0),await _chunkHC3HZK4Qcjs.a.call(void 0, 5),expect(e).toHaveBeenCalledTimes(1)}),it("should apply default options",async()=>{let e=vi.fn();n(e,{waitMs:32}).call(),expect(e).toHaveBeenCalledTimes(0),await _chunkHC3HZK4Qcjs.a.call(void 0, 64),expect(e).toHaveBeenCalledTimes(1)}),it("should support a `leading` option",async()=>{let e=vi.fn(),t=vi.fn(),l=n(e,{waitMs:32,timing:"leading"});l.call(),expect(e).toHaveBeenCalledTimes(1);let i=n(t,{waitMs:32,timing:"both"});i.call(),i.call(),expect(t).toHaveBeenCalledTimes(1),await _chunkHC3HZK4Qcjs.a.call(void 0, 64),expect(t).toHaveBeenCalledTimes(2),l.call(),expect(e).toHaveBeenCalledTimes(2)}),it("subsequent leading debounced calls return the last `func` result",async()=>{let e=n(_chunkAQRYBCA3cjs.a.call(void 0, ),{waitMs:32,timing:"leading"});expect([e.call("a"),e.call("b")]).toStrictEqual(["a","a"]),await _chunkHC3HZK4Qcjs.a.call(void 0, 64),expect([e.call("c"),e.call("d")]).toStrictEqual(["c","c"])}),it("should support a `trailing` option",async()=>{let e=vi.fn();n(e,{waitMs:32,timing:"trailing"}).call(),expect(e).toHaveBeenCalledTimes(0),await _chunkHC3HZK4Qcjs.a.call(void 0, 64),expect(e).toHaveBeenCalledTimes(1)})});describe("optional param maxWaitMs",()=>{it("should support a `maxWait` option",async()=>{let e=vi.fn(_chunkAQRYBCA3cjs.a.call(void 0, )),t=n(e,{waitMs:32,maxWaitMs:64});t.call("a"),t.call("b"),expect(e).toHaveBeenCalledTimes(0),await _chunkHC3HZK4Qcjs.a.call(void 0, 128),expect(e).toHaveBeenCalledTimes(1),t.call("c"),t.call("d"),expect(e).toHaveBeenCalledTimes(1),await _chunkHC3HZK4Qcjs.a.call(void 0, 256),expect(e).toHaveBeenCalledTimes(2)}),it("should support `maxWait` in a tight loop",async()=>{let e=vi.fn(),t=vi.fn(),l=n(e,{waitMs:32,maxWaitMs:128}),i=n(t,{waitMs:96}),o=Date.now();for(;Date.now()-o<320;)l.call(),i.call();await _chunkHC3HZK4Qcjs.a.call(void 0, 1),expect(t).toHaveBeenCalledTimes(0),expect(e).not.toHaveBeenCalledTimes(0)}),it("should queue a trailing call for subsequent debounced calls after `maxWait`",async()=>{let e=vi.fn(),t=n(e,{waitMs:200,maxWaitMs:200});t.call(),setTimeout(()=>{t.call()},190),setTimeout(()=>{t.call()},200),setTimeout(()=>{t.call()},210),await _chunkHC3HZK4Qcjs.a.call(void 0, 500),expect(e).toHaveBeenCalledTimes(2)}),it("should cancel `maxDelayed` when `delayed` is invoked",async()=>{let e=vi.fn(),t=n(e,{waitMs:32,maxWaitMs:64});t.call(),await _chunkHC3HZK4Qcjs.a.call(void 0, 128),t.call(),expect(e).toHaveBeenCalledTimes(1),await _chunkHC3HZK4Qcjs.a.call(void 0, 192),expect(e).toHaveBeenCalledTimes(2)}),it("works like a leaky bucket when only maxWaitMs is set",async()=>{let e=vi.fn(),t=n(e,{maxWaitMs:32});t.call(),expect(e).toHaveBeenCalledTimes(0),await _chunkHC3HZK4Qcjs.a.call(void 0, 16),t.call(),expect(e).toHaveBeenCalledTimes(0),await _chunkHC3HZK4Qcjs.a.call(void 0, 17),expect(e).toHaveBeenCalledTimes(1)})});describe("additional functionality",()=>{it("can cancel before the timer starts",async()=>{let e=n(_chunkAQRYBCA3cjs.a.call(void 0, ),{waitMs:32});expect(()=>{e.cancel()}).not.toThrow(),expect(e.call("hello")).toBeUndefined(),await _chunkHC3HZK4Qcjs.a.call(void 0, 32),expect(e.call("world")).toBe("hello")}),it("can cancel the timer",async()=>{let e="Hello, World!",t=vi.fn(()=>e),l=n(t,{waitMs:32});expect(l.call()).toBeUndefined(),expect(t).toHaveBeenCalledTimes(0),await _chunkHC3HZK4Qcjs.a.call(void 0, 1),expect(l.call()).toBeUndefined(),expect(t).toHaveBeenCalledTimes(0),l.cancel(),await _chunkHC3HZK4Qcjs.a.call(void 0, 32),expect(l.call()).toBeUndefined(),expect(t).toHaveBeenCalledTimes(0),await _chunkHC3HZK4Qcjs.a.call(void 0, 32),expect(l.call()).toStrictEqual(e),expect(t).toHaveBeenCalledTimes(1)}),it("can cancel after the timer ends",async()=>{let e=n(_chunkAQRYBCA3cjs.a.call(void 0, ),{waitMs:32});expect(e.call("hello")).toBeUndefined(),await _chunkHC3HZK4Qcjs.a.call(void 0, 32),expect(e.call("world")).toBe("hello"),expect(()=>{e.cancel()}).not.toThrow()}),it("can cancel maxWait timer",async()=>{let e=n(_chunkAQRYBCA3cjs.a.call(void 0, ),{waitMs:16,maxWaitMs:32});expect(e.call("hello")).toBeUndefined(),await _chunkHC3HZK4Qcjs.a.call(void 0, 1),e.cancel(),await _chunkHC3HZK4Qcjs.a.call(void 0, 32),expect(e.call("world")).toBeUndefined()}),it("can return a cached value",()=>{let e=n(_chunkAQRYBCA3cjs.a.call(void 0, ),{timing:"leading",waitMs:32});expect(e.cachedValue).toBeUndefined(),expect(e.call("hello")).toBe("hello"),expect(e.cachedValue).toBe("hello")}),it("can check for inflight timers (trailing)",async()=>{let e=n(_chunkAQRYBCA3cjs.a.call(void 0, ),{waitMs:32});expect(e.isPending).toBe(!1),expect(e.call("hello")).toBeUndefined(),expect(e.isPending).toBe(!0),await _chunkHC3HZK4Qcjs.a.call(void 0, 1),expect(e.isPending).toBe(!0),await _chunkHC3HZK4Qcjs.a.call(void 0, 32),expect(e.isPending).toBe(!1)}),it("can check for inflight timers (leading)",async()=>{let e=n(_chunkAQRYBCA3cjs.a.call(void 0, ),{timing:"leading",waitMs:32});expect(e.isPending).toBe(!1),expect(e.call("hello")).toBe("hello"),expect(e.isPending).toBe(!0),await _chunkHC3HZK4Qcjs.a.call(void 0, 1),expect(e.isPending).toBe(!0),await _chunkHC3HZK4Qcjs.a.call(void 0, 32),expect(e.isPending).toBe(!1)}),it("can flush before a cool-down",async()=>{let e=n(_chunkAQRYBCA3cjs.a.call(void 0, ),{waitMs:32});expect(e.flush()).toBeUndefined(),expect(e.call("hello")).toBeUndefined(),await _chunkHC3HZK4Qcjs.a.call(void 0, 32),expect(e.call("world")).toBe("hello")}),it("can flush during a cool-down",async()=>{let e=n(_chunkAQRYBCA3cjs.a.call(void 0, ),{waitMs:32});expect(e.call("hello")).toBeUndefined(),await _chunkHC3HZK4Qcjs.a.call(void 0, 1),expect(e.call("world")).toBeUndefined(),await _chunkHC3HZK4Qcjs.a.call(void 0, 1),expect(e.flush()).toBe("world")}),it("can flush after a cool-down",async()=>{let e=n(_chunkAQRYBCA3cjs.a.call(void 0, ),{waitMs:32});expect(e.call("hello")).toBeUndefined(),await _chunkHC3HZK4Qcjs.a.call(void 0, 32),expect(e.flush()).toBe("hello")})});describe("errors",()=>{it("prevents maxWaitMs to be less then waitMs",()=>{expect(()=>n(_chunkAQRYBCA3cjs.a.call(void 0, ),{waitMs:32,maxWaitMs:16})).toThrow("debounce: maxWaitMs (16) cannot be less than waitMs (32)")})});
@@ -0,0 +1,2 @@
1
+
2
+ export { }
@@ -0,0 +1,2 @@
1
+
2
+ export { }
@@ -0,0 +1 @@
1
+ import{a as c}from"./chunk-46GBCFAG.js";import{a}from"./chunk-6SYP2DRD.js";import{a as r}from"./chunk-AWXJSK4F.js";function n(e,{timing:t,waitMs:l,maxWaitMs:i}){if(i!==void 0&&l!==void 0&&i<l)throw new Error(`debounce: maxWaitMs (${i.toString()}) cannot be less than waitMs (${l.toString()})`);let o,s=r(d=>{o=e(...d)},{reducer:(d,...u)=>u,minQuietPeriodMs:l??i??0,...i!==void 0&&{maxBurstDurationMs:i},...t==="leading"?{triggerAt:"start"}:t==="both"?{triggerAt:"both"}:{triggerAt:"end"}});return{call:(...d)=>(s.call(...d),o),flush:()=>(s.flush(),o),cancel:()=>{s.cancel()},get isPending(){return!s.isIdle},get cachedValue(){return o}}}describe("main functionality",()=>{it("should debounce a function",async()=>{let e=vi.fn(c()),t=n(e,{waitMs:32});expect([t.call("a"),t.call("b"),t.call("c")]).toStrictEqual([void 0,void 0,void 0]),expect(e).toHaveBeenCalledTimes(0),await a(128),expect(e).toHaveBeenCalledTimes(1),expect([t.call("d"),t.call("e"),t.call("f")]).toStrictEqual(["c","c","c"]),expect(e).toHaveBeenCalledTimes(1),await a(256),expect(e).toHaveBeenCalledTimes(2)}),it("subsequent debounced calls return the last `func` result",async()=>{let e=n(c(),{waitMs:32});e.call("a"),await a(64),expect(e.call("b")).toBe("a"),await a(128),expect(e.call("c")).toBe("b")}),it("should not immediately call `func` when `wait` is `0`",async()=>{let e=vi.fn(),t=n(e,{});t.call(),t.call(),expect(e).toHaveBeenCalledTimes(0),await a(5),expect(e).toHaveBeenCalledTimes(1)}),it("should apply default options",async()=>{let e=vi.fn();n(e,{waitMs:32}).call(),expect(e).toHaveBeenCalledTimes(0),await a(64),expect(e).toHaveBeenCalledTimes(1)}),it("should support a `leading` option",async()=>{let e=vi.fn(),t=vi.fn(),l=n(e,{waitMs:32,timing:"leading"});l.call(),expect(e).toHaveBeenCalledTimes(1);let i=n(t,{waitMs:32,timing:"both"});i.call(),i.call(),expect(t).toHaveBeenCalledTimes(1),await a(64),expect(t).toHaveBeenCalledTimes(2),l.call(),expect(e).toHaveBeenCalledTimes(2)}),it("subsequent leading debounced calls return the last `func` result",async()=>{let e=n(c(),{waitMs:32,timing:"leading"});expect([e.call("a"),e.call("b")]).toStrictEqual(["a","a"]),await a(64),expect([e.call("c"),e.call("d")]).toStrictEqual(["c","c"])}),it("should support a `trailing` option",async()=>{let e=vi.fn();n(e,{waitMs:32,timing:"trailing"}).call(),expect(e).toHaveBeenCalledTimes(0),await a(64),expect(e).toHaveBeenCalledTimes(1)})});describe("optional param maxWaitMs",()=>{it("should support a `maxWait` option",async()=>{let e=vi.fn(c()),t=n(e,{waitMs:32,maxWaitMs:64});t.call("a"),t.call("b"),expect(e).toHaveBeenCalledTimes(0),await a(128),expect(e).toHaveBeenCalledTimes(1),t.call("c"),t.call("d"),expect(e).toHaveBeenCalledTimes(1),await a(256),expect(e).toHaveBeenCalledTimes(2)}),it("should support `maxWait` in a tight loop",async()=>{let e=vi.fn(),t=vi.fn(),l=n(e,{waitMs:32,maxWaitMs:128}),i=n(t,{waitMs:96}),o=Date.now();for(;Date.now()-o<320;)l.call(),i.call();await a(1),expect(t).toHaveBeenCalledTimes(0),expect(e).not.toHaveBeenCalledTimes(0)}),it("should queue a trailing call for subsequent debounced calls after `maxWait`",async()=>{let e=vi.fn(),t=n(e,{waitMs:200,maxWaitMs:200});t.call(),setTimeout(()=>{t.call()},190),setTimeout(()=>{t.call()},200),setTimeout(()=>{t.call()},210),await a(500),expect(e).toHaveBeenCalledTimes(2)}),it("should cancel `maxDelayed` when `delayed` is invoked",async()=>{let e=vi.fn(),t=n(e,{waitMs:32,maxWaitMs:64});t.call(),await a(128),t.call(),expect(e).toHaveBeenCalledTimes(1),await a(192),expect(e).toHaveBeenCalledTimes(2)}),it("works like a leaky bucket when only maxWaitMs is set",async()=>{let e=vi.fn(),t=n(e,{maxWaitMs:32});t.call(),expect(e).toHaveBeenCalledTimes(0),await a(16),t.call(),expect(e).toHaveBeenCalledTimes(0),await a(17),expect(e).toHaveBeenCalledTimes(1)})});describe("additional functionality",()=>{it("can cancel before the timer starts",async()=>{let e=n(c(),{waitMs:32});expect(()=>{e.cancel()}).not.toThrow(),expect(e.call("hello")).toBeUndefined(),await a(32),expect(e.call("world")).toBe("hello")}),it("can cancel the timer",async()=>{let e="Hello, World!",t=vi.fn(()=>e),l=n(t,{waitMs:32});expect(l.call()).toBeUndefined(),expect(t).toHaveBeenCalledTimes(0),await a(1),expect(l.call()).toBeUndefined(),expect(t).toHaveBeenCalledTimes(0),l.cancel(),await a(32),expect(l.call()).toBeUndefined(),expect(t).toHaveBeenCalledTimes(0),await a(32),expect(l.call()).toStrictEqual(e),expect(t).toHaveBeenCalledTimes(1)}),it("can cancel after the timer ends",async()=>{let e=n(c(),{waitMs:32});expect(e.call("hello")).toBeUndefined(),await a(32),expect(e.call("world")).toBe("hello"),expect(()=>{e.cancel()}).not.toThrow()}),it("can cancel maxWait timer",async()=>{let e=n(c(),{waitMs:16,maxWaitMs:32});expect(e.call("hello")).toBeUndefined(),await a(1),e.cancel(),await a(32),expect(e.call("world")).toBeUndefined()}),it("can return a cached value",()=>{let e=n(c(),{timing:"leading",waitMs:32});expect(e.cachedValue).toBeUndefined(),expect(e.call("hello")).toBe("hello"),expect(e.cachedValue).toBe("hello")}),it("can check for inflight timers (trailing)",async()=>{let e=n(c(),{waitMs:32});expect(e.isPending).toBe(!1),expect(e.call("hello")).toBeUndefined(),expect(e.isPending).toBe(!0),await a(1),expect(e.isPending).toBe(!0),await a(32),expect(e.isPending).toBe(!1)}),it("can check for inflight timers (leading)",async()=>{let e=n(c(),{timing:"leading",waitMs:32});expect(e.isPending).toBe(!1),expect(e.call("hello")).toBe("hello"),expect(e.isPending).toBe(!0),await a(1),expect(e.isPending).toBe(!0),await a(32),expect(e.isPending).toBe(!1)}),it("can flush before a cool-down",async()=>{let e=n(c(),{waitMs:32});expect(e.flush()).toBeUndefined(),expect(e.call("hello")).toBeUndefined(),await a(32),expect(e.call("world")).toBe("hello")}),it("can flush during a cool-down",async()=>{let e=n(c(),{waitMs:32});expect(e.call("hello")).toBeUndefined(),await a(1),expect(e.call("world")).toBeUndefined(),await a(1),expect(e.flush()).toBe("world")}),it("can flush after a cool-down",async()=>{let e=n(c(),{waitMs:32});expect(e.call("hello")).toBeUndefined(),await a(32),expect(e.flush()).toBe("hello")})});describe("errors",()=>{it("prevents maxWaitMs to be less then waitMs",()=>{expect(()=>n(c(),{waitMs:32,maxWaitMs:16})).toThrow("debounce: maxWaitMs (16) cannot be less than waitMs (32)")})});
@@ -0,0 +1 @@
1
+ "use strict";var _chunkGOUUMCT7cjs = require('./chunk-GOUUMCT7.cjs');var _chunkWYRK6YJUcjs = require('./chunk-WYRK6YJU.cjs');describe("'call' method args",()=>{test("no args",()=>{let e=_chunkGOUUMCT7cjs.a.call(void 0, _chunkWYRK6YJUcjs.a.call(void 0, ),{reducer:a=>"test",triggerAt:"start"});expectTypeOf(e.call).parameters.toEqualTypeOf()}),test("non-optional args",()=>{let e=_chunkGOUUMCT7cjs.a.call(void 0, _chunkWYRK6YJUcjs.a.call(void 0, ),{reducer:(a,n,s,o)=>"test",triggerAt:"start"});expectTypeOf(e.call).parameters.toEqualTypeOf()}),test("optional args",()=>{let e=_chunkGOUUMCT7cjs.a.call(void 0, _chunkWYRK6YJUcjs.a.call(void 0, ),{reducer:(a,n)=>"test",triggerAt:"start"});expectTypeOf(e.call).parameters.toEqualTypeOf()}),test("rest args",()=>{let e=_chunkGOUUMCT7cjs.a.call(void 0, _chunkWYRK6YJUcjs.a.call(void 0, ),{reducer:(a,...n)=>"test",triggerAt:"start"});expectTypeOf(e.call).parameters.toEqualTypeOf()})});describe("derive the reducer accumulator type from the executor param",()=>{test("simple types",()=>{_chunkGOUUMCT7cjs.a.call(void 0, e=>{},{reducer:e=>(expectTypeOf(e).toEqualTypeOf(),e),triggerAt:"start"})}),test("arrays",()=>{_chunkGOUUMCT7cjs.a.call(void 0, e=>{},{reducer:e=>(expectTypeOf(e).toEqualTypeOf(),e),triggerAt:"start"})}),test("objects",()=>{_chunkGOUUMCT7cjs.a.call(void 0, e=>{},{reducer:e=>(expectTypeOf(e).toEqualTypeOf(),e),triggerAt:"start"})})});describe("prevent bad options",()=>{test("minGapMs cannot be the only option with timing: end",()=>{_chunkGOUUMCT7cjs.a.call(void 0, _chunkWYRK6YJUcjs.a.call(void 0, ),{minGapMs:100}),_chunkGOUUMCT7cjs.a.call(void 0, _chunkWYRK6YJUcjs.a.call(void 0, ),{triggerAt:"end",minGapMs:100}),_chunkGOUUMCT7cjs.a.call(void 0, _chunkWYRK6YJUcjs.a.call(void 0, ),{triggerAt:"start",minGapMs:100}),_chunkGOUUMCT7cjs.a.call(void 0, _chunkWYRK6YJUcjs.a.call(void 0, ),{triggerAt:"both",minGapMs:100})})});
@@ -0,0 +1,2 @@
1
+
2
+ export { }
@@ -0,0 +1,2 @@
1
+
2
+ export { }
@@ -0,0 +1 @@
1
+ import{a as t}from"./chunk-AWXJSK4F.js";import{a as r}from"./chunk-AFO7BV2X.js";describe("'call' method args",()=>{test("no args",()=>{let e=t(r(),{reducer:a=>"test",triggerAt:"start"});expectTypeOf(e.call).parameters.toEqualTypeOf()}),test("non-optional args",()=>{let e=t(r(),{reducer:(a,n,s,o)=>"test",triggerAt:"start"});expectTypeOf(e.call).parameters.toEqualTypeOf()}),test("optional args",()=>{let e=t(r(),{reducer:(a,n)=>"test",triggerAt:"start"});expectTypeOf(e.call).parameters.toEqualTypeOf()}),test("rest args",()=>{let e=t(r(),{reducer:(a,...n)=>"test",triggerAt:"start"});expectTypeOf(e.call).parameters.toEqualTypeOf()})});describe("derive the reducer accumulator type from the executor param",()=>{test("simple types",()=>{t(e=>{},{reducer:e=>(expectTypeOf(e).toEqualTypeOf(),e),triggerAt:"start"})}),test("arrays",()=>{t(e=>{},{reducer:e=>(expectTypeOf(e).toEqualTypeOf(),e),triggerAt:"start"})}),test("objects",()=>{t(e=>{},{reducer:e=>(expectTypeOf(e).toEqualTypeOf(),e),triggerAt:"start"})})});describe("prevent bad options",()=>{test("minGapMs cannot be the only option with timing: end",()=>{t(r(),{minGapMs:100}),t(r(),{triggerAt:"end",minGapMs:100}),t(r(),{triggerAt:"start",minGapMs:100}),t(r(),{triggerAt:"both",minGapMs:100})})});
@@ -0,0 +1 @@
1
+ "use strict"; function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }var _chunkHC3HZK4Qcjs = require('./chunk-HC3HZK4Q.cjs');var _chunkGOUUMCT7cjs = require('./chunk-GOUUMCT7.cjs');var _chunkWYRK6YJUcjs = require('./chunk-WYRK6YJU.cjs');var _chunkWLNQOMKLcjs = require('./chunk-WLNQOMKL.cjs');var a=16;function i(e,t){return e===void 0?[t]:[...e,t]}describe("reducer behavior",()=>{it("passes the reduced arg to the executor",()=>{let e=vi.fn();_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:_chunkWLNQOMKLcjs.a.call(void 0, "hello world"),triggerAt:"start",minQuietPeriodMs:a}).call(),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith("hello world")}),it("reduces call args",async()=>{let e=vi.fn(n=>{}),t=_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:(n,o)=>(_nullishCoalesce(n, () => (0)))+o,minQuietPeriodMs:2*a,triggerAt:"end"});t.call(1),t.call(2),t.call(3),await _chunkHC3HZK4Qcjs.a.call(void 0, a),t.call(4),t.call(5),t.call(6),await _chunkHC3HZK4Qcjs.a.call(void 0, 2*a),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(21)}),it("does not invoke if reduceArgs returns undefined",async()=>{let e=vi.fn();_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:_chunkWLNQOMKLcjs.a.call(void 0, void 0),triggerAt:"end",minQuietPeriodMs:a}).call(),await _chunkHC3HZK4Qcjs.a.call(void 0, 2*a),expect(e).toHaveBeenCalledTimes(0)}),it("supports multiple arguments",()=>{let e=vi.fn();_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:(n,o,r,m)=>[n,o,r,m],triggerAt:"start",minQuietPeriodMs:a}).call(1,"a",!0),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith([void 0,1,"a",!0])}),it("reducer isn't called again when 'invokedAt: start'",async()=>{let e=vi.fn(i),t=_chunkGOUUMCT7cjs.a.call(void 0, _chunkWYRK6YJUcjs.a.call(void 0, ),{reducer:e,triggerAt:"start",minQuietPeriodMs:a});t.call("a"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(void 0,"a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(1),await _chunkHC3HZK4Qcjs.a.call(void 0, 2*a),expect(e).toHaveBeenCalledTimes(1)})});describe("non-trivial (>0ms) timer duration",()=>{describe("delay timer",()=>{it("invokedAt: start",async()=>{let e=vi.fn(),t=_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:i,triggerAt:"start",minGapMs:a});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await _chunkHC3HZK4Qcjs.a.call(void 0, a),expect(e).toHaveBeenCalledTimes(1),t.call("d"),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["d"])}),it("invokedAt: both",async()=>{let e=vi.fn(),t=_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:i,triggerAt:"both",minGapMs:a});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await _chunkHC3HZK4Qcjs.a.call(void 0, a),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["b","c"]),t.call("d"),t.call("e"),t.call("f"),expect(e).toHaveBeenCalledTimes(2),await _chunkHC3HZK4Qcjs.a.call(void 0, a),expect(e).toHaveBeenCalledTimes(3),expect(e).toHaveBeenLastCalledWith(["d","e","f"])}),it("invocations in the middle of a window",async()=>{let e=vi.fn(),t=_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:i,triggerAt:"both",minGapMs:a});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await _chunkHC3HZK4Qcjs.a.call(void 0, .75*a),t.call("d"),t.call("e"),t.call("f"),expect(e).toHaveBeenCalledTimes(1),await _chunkHC3HZK4Qcjs.a.call(void 0, .75*a),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["b","c","d","e","f"])})}),describe("burst timer",()=>{it("invokedAt: start",async()=>{let e=vi.fn(),t=_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:i,triggerAt:"start",minQuietPeriodMs:a});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await _chunkHC3HZK4Qcjs.a.call(void 0, a),expect(e).toHaveBeenCalledTimes(1),t.call("d"),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["d"])}),it("invokedAt: both",async()=>{let e=vi.fn(),t=_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:i,triggerAt:"both",minQuietPeriodMs:a});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await _chunkHC3HZK4Qcjs.a.call(void 0, a),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["b","c"]),t.call("d"),t.call("e"),t.call("f"),expect(e).toHaveBeenCalledTimes(3),expect(e).toHaveBeenLastCalledWith(["d"]),await _chunkHC3HZK4Qcjs.a.call(void 0, a),expect(e).toHaveBeenCalledTimes(4),expect(e).toHaveBeenLastCalledWith(["e","f"])}),it("invokedAt: end",async()=>{let e=vi.fn(),t=_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:i,triggerAt:"end",minQuietPeriodMs:a});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(0),await _chunkHC3HZK4Qcjs.a.call(void 0, a),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a","b","c"]),t.call("e"),t.call("f"),t.call("g"),expect(e).toHaveBeenCalledTimes(1),await _chunkHC3HZK4Qcjs.a.call(void 0, a),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["e","f","g"])}),it("invocations in the middle of a window",async()=>{let e=vi.fn(),t=_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:i,triggerAt:"end",minQuietPeriodMs:a});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(0),await _chunkHC3HZK4Qcjs.a.call(void 0, .9*a),t.call("d"),t.call("e"),t.call("f"),expect(e).toHaveBeenCalledTimes(0),await _chunkHC3HZK4Qcjs.a.call(void 0, .1*a),expect(e).toHaveBeenCalledTimes(0),await _chunkHC3HZK4Qcjs.a.call(void 0, a),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a","b","c","d","e","f"])}),it("maxBurstDurationMs limits the burst duration",async()=>{let e=vi.fn(),t=_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:i,minQuietPeriodMs:a,maxBurstDurationMs:2*a,triggerAt:"end"});t.call("a"),await _chunkHC3HZK4Qcjs.a.call(void 0, .75*a),t.call("b"),await _chunkHC3HZK4Qcjs.a.call(void 0, .75*a),t.call("c"),expect(e).toHaveBeenCalledTimes(0),await _chunkHC3HZK4Qcjs.a.call(void 0, .75*a),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a","b","c"])})}),describe("both timers",()=>{it("delay is longer than burst",async()=>{let e=vi.fn(),t=_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:i,minGapMs:2*a,minQuietPeriodMs:a,triggerAt:"both"});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await _chunkHC3HZK4Qcjs.a.call(void 0, a),t.call("d"),t.call("e"),t.call("f"),expect(e).toHaveBeenCalledTimes(1),await _chunkHC3HZK4Qcjs.a.call(void 0, a),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["b","c","d","e","f"])}),it("burst is longer than delay",async()=>{let e=vi.fn(),t=_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:i,minGapMs:a,minQuietPeriodMs:2*a,triggerAt:"both"});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await _chunkHC3HZK4Qcjs.a.call(void 0, a),t.call("d"),t.call("e"),t.call("f"),expect(e).toHaveBeenCalledTimes(1),await _chunkHC3HZK4Qcjs.a.call(void 0, a),expect(e).toHaveBeenCalledTimes(1),await _chunkHC3HZK4Qcjs.a.call(void 0, a),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["b","c","d","e","f"])}),it("burst and delay are equal",async()=>{let e=vi.fn(),t=_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:i,minGapMs:a,minQuietPeriodMs:a,triggerAt:"both"});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await _chunkHC3HZK4Qcjs.a.call(void 0, a),t.call("d"),t.call("e"),t.call("f"),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["b","c"]),await _chunkHC3HZK4Qcjs.a.call(void 0, a),expect(e).toHaveBeenCalledTimes(3),expect(e).toHaveBeenLastCalledWith(["d","e","f"])}),it("delay and maxBurstDurationMs are equal",async()=>{let e=vi.fn(),t=_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:i,minGapMs:a,minQuietPeriodMs:2*a,maxBurstDurationMs:a,triggerAt:"both"});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await _chunkHC3HZK4Qcjs.a.call(void 0, a),t.call("d"),t.call("e"),t.call("f"),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["b","c"]),await _chunkHC3HZK4Qcjs.a.call(void 0, a),expect(e).toHaveBeenCalledTimes(3),expect(e).toHaveBeenLastCalledWith(["d","e","f"])})})});describe("immediate (===0) timer durations",()=>{describe("delay timer",()=>{it("invokedAt: start",async()=>{let e=vi.fn(),t=_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:i,triggerAt:"start",minGapMs:0});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await _chunkHC3HZK4Qcjs.a.call(void 0, 0),t.call("d"),t.call("e"),t.call("f"),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["d"]),await _chunkHC3HZK4Qcjs.a.call(void 0, 0),expect(e).toHaveBeenCalledTimes(2)}),it("invokedAt: both",async()=>{let e=vi.fn(),t=_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:i,triggerAt:"both",minGapMs:0});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await _chunkHC3HZK4Qcjs.a.call(void 0, 0),t.call("d"),t.call("e"),t.call("f"),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["b","c"]),await _chunkHC3HZK4Qcjs.a.call(void 0, 0),expect(e).toHaveBeenCalledTimes(3),expect(e).toHaveBeenLastCalledWith(["d","e","f"])}),it("with a non-trivial burst timer",async()=>{let e=vi.fn(),t=_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:i,triggerAt:"both",minGapMs:0,minQuietPeriodMs:a});t.call("a"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),t.call("b"),expect(e).toHaveBeenCalledTimes(1),await _chunkHC3HZK4Qcjs.a.call(void 0, a),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["b"])})}),describe("burst timer",()=>{it("invokedAt: start",async()=>{let e=vi.fn(),t=_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:i,triggerAt:"start",minQuietPeriodMs:0});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await _chunkHC3HZK4Qcjs.a.call(void 0, 0),t.call("d"),t.call("e"),t.call("f"),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["d"]),await _chunkHC3HZK4Qcjs.a.call(void 0, 0),expect(e).toHaveBeenCalledTimes(2)}),it("invokedAt: both",async()=>{let e=vi.fn(),t=_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:i,triggerAt:"both",minQuietPeriodMs:0});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await _chunkHC3HZK4Qcjs.a.call(void 0, 0),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["b","c"]),t.call("d"),t.call("e"),t.call("f"),expect(e).toHaveBeenCalledTimes(3),expect(e).toHaveBeenLastCalledWith(["d"]),await _chunkHC3HZK4Qcjs.a.call(void 0, 0),expect(e).toHaveBeenCalledTimes(4),expect(e).toHaveBeenLastCalledWith(["e","f"])}),it("invokedAt: end",async()=>{let e=vi.fn(),t=_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:i,triggerAt:"end",minQuietPeriodMs:0});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(0),await _chunkHC3HZK4Qcjs.a.call(void 0, 0),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a","b","c"]),t.call("d"),t.call("e"),t.call("f"),expect(e).toHaveBeenCalledTimes(1),await _chunkHC3HZK4Qcjs.a.call(void 0, 0),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["d","e","f"])}),it("with a non-trivial delay timer",async()=>{let e=vi.fn(),t=_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:i,triggerAt:"both",minGapMs:a,minQuietPeriodMs:0});t.call("a"),t.call("b"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await _chunkHC3HZK4Qcjs.a.call(void 0, 0),expect(e).toHaveBeenCalledTimes(1),await _chunkHC3HZK4Qcjs.a.call(void 0, a),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["b"])}),it("burst timer with non-trivial maxBurstDuration",async()=>{let e=vi.fn(),t=_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:i,minQuietPeriodMs:0,maxBurstDurationMs:a,triggerAt:"end"});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(0),await _chunkHC3HZK4Qcjs.a.call(void 0, 0),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a","b","c"])})}),it("both timers",async()=>{let e=vi.fn();_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:i,triggerAt:"both",minGapMs:0,minQuietPeriodMs:0}).call("a"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await _chunkHC3HZK4Qcjs.a.call(void 0, 0),expect(e).toHaveBeenCalledTimes(1)}),it("maxBurstDurationMs = 0 limits the burst immediately",async()=>{let e=vi.fn();_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:i,triggerAt:"end",minQuietPeriodMs:a,maxBurstDurationMs:0}).call("a"),await _chunkHC3HZK4Qcjs.a.call(void 0, 0),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"])}),it("all timeouts zero",async()=>{let e=vi.fn(),t=_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:i,triggerAt:"both",minGapMs:0,minQuietPeriodMs:0,maxBurstDurationMs:0});t.call("a"),t.call("b"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await _chunkHC3HZK4Qcjs.a.call(void 0, 0),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["b"])})});describe("default minQuietPeriodMs === 0 when minGapMs is not defined",()=>{it("invokedAt: start",async()=>{let e=vi.fn(),t=_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:i,triggerAt:"start"});t.call("a"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),t.call("b"),expect(e).toHaveBeenCalledTimes(1),await _chunkHC3HZK4Qcjs.a.call(void 0, 0),expect(e).toHaveBeenCalledTimes(1),t.call("c"),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["c"])}),it("invokedAt: both",async()=>{let e=vi.fn(),t=_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:i,triggerAt:"both"});t.call("a"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),t.call("b"),expect(e).toHaveBeenCalledTimes(1),await _chunkHC3HZK4Qcjs.a.call(void 0, 0),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["b"]),t.call("c"),expect(e).toHaveBeenCalledTimes(3),expect(e).toHaveBeenLastCalledWith(["c"])})});describe("utility functions",()=>{describe("flush",()=>{it("flush triggers an immediate invocation",async()=>{let e=vi.fn(),t=_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:i,triggerAt:"end",minQuietPeriodMs:a});t.call("a"),t.call("b"),t.call("c"),t.flush(),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a","b","c"]),await _chunkHC3HZK4Qcjs.a.call(void 0, a),expect(e).toHaveBeenCalledTimes(1)}),it("flush during active burst",async()=>{let e=vi.fn(),t=_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:i,triggerAt:"end",minQuietPeriodMs:2*a});t.call("a"),t.call("b"),t.call("c"),await _chunkHC3HZK4Qcjs.a.call(void 0, a),t.flush(),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a","b","c"]),await _chunkHC3HZK4Qcjs.a.call(void 0, 2*a),expect(e).toHaveBeenCalledTimes(1)})}),describe("cancel",()=>{it("cancel prevents invocation",async()=>{let e=vi.fn(),t=_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:i,triggerAt:"end",minQuietPeriodMs:a});t.call("a"),t.call("b"),t.call("c"),t.cancel(),await _chunkHC3HZK4Qcjs.a.call(void 0, a),expect(e).toHaveBeenCalledTimes(0)}),it("cancel during delay period",async()=>{let e=vi.fn(),t=_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:i,triggerAt:"start",minGapMs:2*a});t.call("a"),t.call("b"),await _chunkHC3HZK4Qcjs.a.call(void 0, a),t.cancel(),await _chunkHC3HZK4Qcjs.a.call(void 0, a),expect(e).toHaveBeenCalledTimes(1)})}),describe("isIdle",()=>{it("isIdle reflects the funnel's state",()=>{let e=vi.fn(),t=_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:i,triggerAt:"end",minQuietPeriodMs:a});expect(t.isIdle).toBe(!0),t.call("a"),expect(t.isIdle).toBe(!1),t.cancel(),expect(t.isIdle).toBe(!0)}),it("isIdle works when burst duration is 0",async()=>{let e=vi.fn(),t=_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:i,triggerAt:"end",minQuietPeriodMs:0});expect(t.isIdle).toBe(!0),t.call("a"),t.call("b"),t.call("c"),expect(t.isIdle).toBe(!1),await _chunkHC3HZK4Qcjs.a.call(void 0, 0),expect(t.isIdle).toBe(!0)})})});describe("edge-cases",()=>{it("bursts that start late don't prevent delayed invocations",async()=>{let e=vi.fn(),t=_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:i,triggerAt:"both",minQuietPeriodMs:a,minGapMs:2*a});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await _chunkHC3HZK4Qcjs.a.call(void 0, 1.5*a),expect(e).toHaveBeenCalledTimes(1),t.call("d"),t.call("e"),t.call("f"),expect(e).toHaveBeenCalledTimes(1),await _chunkHC3HZK4Qcjs.a.call(void 0, .5*a),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["b","c","d","e","f"])}),it("delay timeouts don't cause an invocation in the middle of bursts",async()=>{let e=vi.fn(),t=_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:i,triggerAt:"both",minQuietPeriodMs:2*a,minGapMs:a});t.call("a"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await _chunkHC3HZK4Qcjs.a.call(void 0, a),t.call("b"),expect(e).toHaveBeenCalledTimes(1),await _chunkHC3HZK4Qcjs.a.call(void 0, a),t.call("c"),expect(e).toHaveBeenCalledTimes(1),await _chunkHC3HZK4Qcjs.a.call(void 0, a),t.call("d"),expect(e).toHaveBeenCalledTimes(1),await _chunkHC3HZK4Qcjs.a.call(void 0, a),expect(e).toHaveBeenCalledTimes(1),await _chunkHC3HZK4Qcjs.a.call(void 0, a),expect(e).toHaveBeenCalledTimes(2)})});
@@ -0,0 +1,2 @@
1
+
2
+ export { }
@@ -0,0 +1,2 @@
1
+
2
+ export { }
@@ -0,0 +1 @@
1
+ import{a as l}from"./chunk-6SYP2DRD.js";import{a as c}from"./chunk-AWXJSK4F.js";import{a as d}from"./chunk-AFO7BV2X.js";import{a as s}from"./chunk-T5XG33UI.js";var a=16;function i(e,t){return e===void 0?[t]:[...e,t]}describe("reducer behavior",()=>{it("passes the reduced arg to the executor",()=>{let e=vi.fn();c(e,{reducer:s("hello world"),triggerAt:"start",minQuietPeriodMs:a}).call(),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith("hello world")}),it("reduces call args",async()=>{let e=vi.fn(n=>{}),t=c(e,{reducer:(n,o)=>(n??0)+o,minQuietPeriodMs:2*a,triggerAt:"end"});t.call(1),t.call(2),t.call(3),await l(a),t.call(4),t.call(5),t.call(6),await l(2*a),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(21)}),it("does not invoke if reduceArgs returns undefined",async()=>{let e=vi.fn();c(e,{reducer:s(void 0),triggerAt:"end",minQuietPeriodMs:a}).call(),await l(2*a),expect(e).toHaveBeenCalledTimes(0)}),it("supports multiple arguments",()=>{let e=vi.fn();c(e,{reducer:(n,o,r,m)=>[n,o,r,m],triggerAt:"start",minQuietPeriodMs:a}).call(1,"a",!0),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith([void 0,1,"a",!0])}),it("reducer isn't called again when 'invokedAt: start'",async()=>{let e=vi.fn(i),t=c(d(),{reducer:e,triggerAt:"start",minQuietPeriodMs:a});t.call("a"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(void 0,"a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(1),await l(2*a),expect(e).toHaveBeenCalledTimes(1)})});describe("non-trivial (>0ms) timer duration",()=>{describe("delay timer",()=>{it("invokedAt: start",async()=>{let e=vi.fn(),t=c(e,{reducer:i,triggerAt:"start",minGapMs:a});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await l(a),expect(e).toHaveBeenCalledTimes(1),t.call("d"),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["d"])}),it("invokedAt: both",async()=>{let e=vi.fn(),t=c(e,{reducer:i,triggerAt:"both",minGapMs:a});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await l(a),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["b","c"]),t.call("d"),t.call("e"),t.call("f"),expect(e).toHaveBeenCalledTimes(2),await l(a),expect(e).toHaveBeenCalledTimes(3),expect(e).toHaveBeenLastCalledWith(["d","e","f"])}),it("invocations in the middle of a window",async()=>{let e=vi.fn(),t=c(e,{reducer:i,triggerAt:"both",minGapMs:a});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await l(.75*a),t.call("d"),t.call("e"),t.call("f"),expect(e).toHaveBeenCalledTimes(1),await l(.75*a),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["b","c","d","e","f"])})}),describe("burst timer",()=>{it("invokedAt: start",async()=>{let e=vi.fn(),t=c(e,{reducer:i,triggerAt:"start",minQuietPeriodMs:a});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await l(a),expect(e).toHaveBeenCalledTimes(1),t.call("d"),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["d"])}),it("invokedAt: both",async()=>{let e=vi.fn(),t=c(e,{reducer:i,triggerAt:"both",minQuietPeriodMs:a});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await l(a),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["b","c"]),t.call("d"),t.call("e"),t.call("f"),expect(e).toHaveBeenCalledTimes(3),expect(e).toHaveBeenLastCalledWith(["d"]),await l(a),expect(e).toHaveBeenCalledTimes(4),expect(e).toHaveBeenLastCalledWith(["e","f"])}),it("invokedAt: end",async()=>{let e=vi.fn(),t=c(e,{reducer:i,triggerAt:"end",minQuietPeriodMs:a});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(0),await l(a),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a","b","c"]),t.call("e"),t.call("f"),t.call("g"),expect(e).toHaveBeenCalledTimes(1),await l(a),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["e","f","g"])}),it("invocations in the middle of a window",async()=>{let e=vi.fn(),t=c(e,{reducer:i,triggerAt:"end",minQuietPeriodMs:a});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(0),await l(.9*a),t.call("d"),t.call("e"),t.call("f"),expect(e).toHaveBeenCalledTimes(0),await l(.1*a),expect(e).toHaveBeenCalledTimes(0),await l(a),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a","b","c","d","e","f"])}),it("maxBurstDurationMs limits the burst duration",async()=>{let e=vi.fn(),t=c(e,{reducer:i,minQuietPeriodMs:a,maxBurstDurationMs:2*a,triggerAt:"end"});t.call("a"),await l(.75*a),t.call("b"),await l(.75*a),t.call("c"),expect(e).toHaveBeenCalledTimes(0),await l(.75*a),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a","b","c"])})}),describe("both timers",()=>{it("delay is longer than burst",async()=>{let e=vi.fn(),t=c(e,{reducer:i,minGapMs:2*a,minQuietPeriodMs:a,triggerAt:"both"});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await l(a),t.call("d"),t.call("e"),t.call("f"),expect(e).toHaveBeenCalledTimes(1),await l(a),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["b","c","d","e","f"])}),it("burst is longer than delay",async()=>{let e=vi.fn(),t=c(e,{reducer:i,minGapMs:a,minQuietPeriodMs:2*a,triggerAt:"both"});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await l(a),t.call("d"),t.call("e"),t.call("f"),expect(e).toHaveBeenCalledTimes(1),await l(a),expect(e).toHaveBeenCalledTimes(1),await l(a),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["b","c","d","e","f"])}),it("burst and delay are equal",async()=>{let e=vi.fn(),t=c(e,{reducer:i,minGapMs:a,minQuietPeriodMs:a,triggerAt:"both"});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await l(a),t.call("d"),t.call("e"),t.call("f"),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["b","c"]),await l(a),expect(e).toHaveBeenCalledTimes(3),expect(e).toHaveBeenLastCalledWith(["d","e","f"])}),it("delay and maxBurstDurationMs are equal",async()=>{let e=vi.fn(),t=c(e,{reducer:i,minGapMs:a,minQuietPeriodMs:2*a,maxBurstDurationMs:a,triggerAt:"both"});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await l(a),t.call("d"),t.call("e"),t.call("f"),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["b","c"]),await l(a),expect(e).toHaveBeenCalledTimes(3),expect(e).toHaveBeenLastCalledWith(["d","e","f"])})})});describe("immediate (===0) timer durations",()=>{describe("delay timer",()=>{it("invokedAt: start",async()=>{let e=vi.fn(),t=c(e,{reducer:i,triggerAt:"start",minGapMs:0});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await l(0),t.call("d"),t.call("e"),t.call("f"),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["d"]),await l(0),expect(e).toHaveBeenCalledTimes(2)}),it("invokedAt: both",async()=>{let e=vi.fn(),t=c(e,{reducer:i,triggerAt:"both",minGapMs:0});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await l(0),t.call("d"),t.call("e"),t.call("f"),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["b","c"]),await l(0),expect(e).toHaveBeenCalledTimes(3),expect(e).toHaveBeenLastCalledWith(["d","e","f"])}),it("with a non-trivial burst timer",async()=>{let e=vi.fn(),t=c(e,{reducer:i,triggerAt:"both",minGapMs:0,minQuietPeriodMs:a});t.call("a"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),t.call("b"),expect(e).toHaveBeenCalledTimes(1),await l(a),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["b"])})}),describe("burst timer",()=>{it("invokedAt: start",async()=>{let e=vi.fn(),t=c(e,{reducer:i,triggerAt:"start",minQuietPeriodMs:0});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await l(0),t.call("d"),t.call("e"),t.call("f"),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["d"]),await l(0),expect(e).toHaveBeenCalledTimes(2)}),it("invokedAt: both",async()=>{let e=vi.fn(),t=c(e,{reducer:i,triggerAt:"both",minQuietPeriodMs:0});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await l(0),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["b","c"]),t.call("d"),t.call("e"),t.call("f"),expect(e).toHaveBeenCalledTimes(3),expect(e).toHaveBeenLastCalledWith(["d"]),await l(0),expect(e).toHaveBeenCalledTimes(4),expect(e).toHaveBeenLastCalledWith(["e","f"])}),it("invokedAt: end",async()=>{let e=vi.fn(),t=c(e,{reducer:i,triggerAt:"end",minQuietPeriodMs:0});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(0),await l(0),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a","b","c"]),t.call("d"),t.call("e"),t.call("f"),expect(e).toHaveBeenCalledTimes(1),await l(0),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["d","e","f"])}),it("with a non-trivial delay timer",async()=>{let e=vi.fn(),t=c(e,{reducer:i,triggerAt:"both",minGapMs:a,minQuietPeriodMs:0});t.call("a"),t.call("b"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await l(0),expect(e).toHaveBeenCalledTimes(1),await l(a),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["b"])}),it("burst timer with non-trivial maxBurstDuration",async()=>{let e=vi.fn(),t=c(e,{reducer:i,minQuietPeriodMs:0,maxBurstDurationMs:a,triggerAt:"end"});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(0),await l(0),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a","b","c"])})}),it("both timers",async()=>{let e=vi.fn();c(e,{reducer:i,triggerAt:"both",minGapMs:0,minQuietPeriodMs:0}).call("a"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await l(0),expect(e).toHaveBeenCalledTimes(1)}),it("maxBurstDurationMs = 0 limits the burst immediately",async()=>{let e=vi.fn();c(e,{reducer:i,triggerAt:"end",minQuietPeriodMs:a,maxBurstDurationMs:0}).call("a"),await l(0),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"])}),it("all timeouts zero",async()=>{let e=vi.fn(),t=c(e,{reducer:i,triggerAt:"both",minGapMs:0,minQuietPeriodMs:0,maxBurstDurationMs:0});t.call("a"),t.call("b"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await l(0),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["b"])})});describe("default minQuietPeriodMs === 0 when minGapMs is not defined",()=>{it("invokedAt: start",async()=>{let e=vi.fn(),t=c(e,{reducer:i,triggerAt:"start"});t.call("a"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),t.call("b"),expect(e).toHaveBeenCalledTimes(1),await l(0),expect(e).toHaveBeenCalledTimes(1),t.call("c"),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["c"])}),it("invokedAt: both",async()=>{let e=vi.fn(),t=c(e,{reducer:i,triggerAt:"both"});t.call("a"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),t.call("b"),expect(e).toHaveBeenCalledTimes(1),await l(0),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["b"]),t.call("c"),expect(e).toHaveBeenCalledTimes(3),expect(e).toHaveBeenLastCalledWith(["c"])})});describe("utility functions",()=>{describe("flush",()=>{it("flush triggers an immediate invocation",async()=>{let e=vi.fn(),t=c(e,{reducer:i,triggerAt:"end",minQuietPeriodMs:a});t.call("a"),t.call("b"),t.call("c"),t.flush(),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a","b","c"]),await l(a),expect(e).toHaveBeenCalledTimes(1)}),it("flush during active burst",async()=>{let e=vi.fn(),t=c(e,{reducer:i,triggerAt:"end",minQuietPeriodMs:2*a});t.call("a"),t.call("b"),t.call("c"),await l(a),t.flush(),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a","b","c"]),await l(2*a),expect(e).toHaveBeenCalledTimes(1)})}),describe("cancel",()=>{it("cancel prevents invocation",async()=>{let e=vi.fn(),t=c(e,{reducer:i,triggerAt:"end",minQuietPeriodMs:a});t.call("a"),t.call("b"),t.call("c"),t.cancel(),await l(a),expect(e).toHaveBeenCalledTimes(0)}),it("cancel during delay period",async()=>{let e=vi.fn(),t=c(e,{reducer:i,triggerAt:"start",minGapMs:2*a});t.call("a"),t.call("b"),await l(a),t.cancel(),await l(a),expect(e).toHaveBeenCalledTimes(1)})}),describe("isIdle",()=>{it("isIdle reflects the funnel's state",()=>{let e=vi.fn(),t=c(e,{reducer:i,triggerAt:"end",minQuietPeriodMs:a});expect(t.isIdle).toBe(!0),t.call("a"),expect(t.isIdle).toBe(!1),t.cancel(),expect(t.isIdle).toBe(!0)}),it("isIdle works when burst duration is 0",async()=>{let e=vi.fn(),t=c(e,{reducer:i,triggerAt:"end",minQuietPeriodMs:0});expect(t.isIdle).toBe(!0),t.call("a"),t.call("b"),t.call("c"),expect(t.isIdle).toBe(!1),await l(0),expect(t.isIdle).toBe(!0)})})});describe("edge-cases",()=>{it("bursts that start late don't prevent delayed invocations",async()=>{let e=vi.fn(),t=c(e,{reducer:i,triggerAt:"both",minQuietPeriodMs:a,minGapMs:2*a});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await l(1.5*a),expect(e).toHaveBeenCalledTimes(1),t.call("d"),t.call("e"),t.call("f"),expect(e).toHaveBeenCalledTimes(1),await l(.5*a),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["b","c","d","e","f"])}),it("delay timeouts don't cause an invocation in the middle of bursts",async()=>{let e=vi.fn(),t=c(e,{reducer:i,triggerAt:"both",minQuietPeriodMs:2*a,minGapMs:a});t.call("a"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await l(a),t.call("b"),expect(e).toHaveBeenCalledTimes(1),await l(a),t.call("c"),expect(e).toHaveBeenCalledTimes(1),await l(a),t.call("d"),expect(e).toHaveBeenCalledTimes(1),await l(a),expect(e).toHaveBeenCalledTimes(1),await l(a),expect(e).toHaveBeenCalledTimes(2)})});
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkBBYC5W6Ecjs = require('./chunk-BBYC5W6E.cjs');var _chunkMYUMWF5Acjs = require('./chunk-MYUMWF5A.cjs');var _chunkM5Z4GCV3cjs = require('./chunk-M5Z4GCV3.cjs');var _chunkEFURGOGBcjs = require('./chunk-EFURGOGB.cjs');var _chunkG74G5PZTcjs = require('./chunk-G74G5PZT.cjs');var _chunkWVTQN2AIcjs = require('./chunk-WVTQN2AI.cjs');var _chunkN7AESA4Wcjs = require('./chunk-N7AESA4W.cjs');var _chunkLPNHLDEAcjs = require('./chunk-LPNHLDEA.cjs');var _chunkX7EK7EDZcjs = require('./chunk-X7EK7EDZ.cjs');var _chunkESGYUUU2cjs = require('./chunk-ESGYUUU2.cjs');var _chunkRGUX2LCHcjs = require('./chunk-RGUX2LCH.cjs');var _chunkP4KRPPMAcjs = require('./chunk-P4KRPPMA.cjs');var _chunkCZI4WD5Qcjs = require('./chunk-CZI4WD5Q.cjs');var _chunkVH3XIFK7cjs = require('./chunk-VH3XIFK7.cjs');var _chunk6DDL3ZF6cjs = require('./chunk-6DDL3ZF6.cjs');var _chunkVNI4VRFMcjs = require('./chunk-VNI4VRFM.cjs');var _chunk7GAGU65Ucjs = require('./chunk-7GAGU65U.cjs');var _chunk5GI4OEUMcjs = require('./chunk-5GI4OEUM.cjs');var _chunkRAHS5RJScjs = require('./chunk-RAHS5RJS.cjs');var _chunkI27XCDDIcjs = require('./chunk-I27XCDDI.cjs');require('./chunk-OPJJI442.cjs');var _chunkI4WQXZJHcjs = require('./chunk-I4WQXZJH.cjs');var _chunkTRUODFSQcjs = require('./chunk-TRUODFSQ.cjs');var _chunkQNFRANE2cjs = require('./chunk-QNFRANE2.cjs');var _chunkFRWE2CFIcjs = require('./chunk-FRWE2CFI.cjs');var _chunkU4HKRBD3cjs = require('./chunk-U4HKRBD3.cjs');var _chunk43XCMZYTcjs = require('./chunk-43XCMZYT.cjs');var _chunkLLHOSKEGcjs = require('./chunk-LLHOSKEG.cjs');var _chunkJ7LDTU7Wcjs = require('./chunk-J7LDTU7W.cjs');var _chunkNWEOHZQHcjs = require('./chunk-NWEOHZQH.cjs');var _chunkTNBCVNKHcjs = require('./chunk-TNBCVNKH.cjs');var _chunkJFHH5VKUcjs = require('./chunk-JFHH5VKU.cjs');var _chunkIP2ZEYIUcjs = require('./chunk-IP2ZEYIU.cjs');var _chunkTFN3JWPScjs = require('./chunk-TFN3JWPS.cjs');var _chunkVRZNQSZNcjs = require('./chunk-VRZNQSZN.cjs');var _chunkRMLQX4GAcjs = require('./chunk-RMLQX4GA.cjs');var _chunkHC3HZK4Qcjs = require('./chunk-HC3HZK4Q.cjs');var _chunk3WCOFJCScjs = require('./chunk-3WCOFJCS.cjs');var _chunkEP626HCIcjs = require('./chunk-EP626HCI.cjs');var _chunkKM5XOWVGcjs = require('./chunk-KM5XOWVG.cjs');var _chunkDGLS43L4cjs = require('./chunk-DGLS43L4.cjs');var _chunkUIXBYMGBcjs = require('./chunk-UIXBYMGB.cjs');var _chunkNOZQSRNNcjs = require('./chunk-NOZQSRNN.cjs');var _chunkUEL4TCYDcjs = require('./chunk-UEL4TCYD.cjs');require('./chunk-7TDMV2GO.cjs');var _chunkZLNSRDW7cjs = require('./chunk-ZLNSRDW7.cjs');var _chunkWQHSSKSDcjs = require('./chunk-WQHSSKSD.cjs');var _chunkCIWFQSJQcjs = require('./chunk-CIWFQSJQ.cjs');var _chunkGG67ZAXXcjs = require('./chunk-GG67ZAXX.cjs');var _chunkIPW4LWUMcjs = require('./chunk-IPW4LWUM.cjs');var _chunkSHU7K6YPcjs = require('./chunk-SHU7K6YP.cjs');var _chunkQSYAGOIBcjs = require('./chunk-QSYAGOIB.cjs');var _chunkXGT73UQWcjs = require('./chunk-XGT73UQW.cjs');var _chunkXTLGRWI2cjs = require('./chunk-XTLGRWI2.cjs');var _chunkFSTZSNDBcjs = require('./chunk-FSTZSNDB.cjs');var _chunkWP5D3YAQcjs = require('./chunk-WP5D3YAQ.cjs');var _chunkI33LBSLYcjs = require('./chunk-I33LBSLY.cjs');var _chunkIOSBDH5Jcjs = require('./chunk-IOSBDH5J.cjs');var _chunkNC5GO4RUcjs = require('./chunk-NC5GO4RU.cjs');var _chunkRXSPNNEWcjs = require('./chunk-RXSPNNEW.cjs');var _chunkNAYMME55cjs = require('./chunk-NAYMME55.cjs');var _chunkAHHZAXLVcjs = require('./chunk-AHHZAXLV.cjs');var _chunkJRDQRETRcjs = require('./chunk-JRDQRETR.cjs');var _chunkOWGBKUJ2cjs = require('./chunk-OWGBKUJ2.cjs');var _chunkQXQ5BE4Ccjs = require('./chunk-QXQ5BE4C.cjs');var _chunkMGCDUMSJcjs = require('./chunk-MGCDUMSJ.cjs');var _chunkHNEXKGNRcjs = require('./chunk-HNEXKGNR.cjs');var _chunkRQHL6EVIcjs = require('./chunk-RQHL6EVI.cjs');var _chunkR55FGFKUcjs = require('./chunk-R55FGFKU.cjs');var _chunkGRFK4SBRcjs = require('./chunk-GRFK4SBR.cjs');var _chunk7RS2XXUGcjs = require('./chunk-7RS2XXUG.cjs');var _chunkZ4ZUDQ7Ecjs = require('./chunk-Z4ZUDQ7E.cjs');var _chunkDBRT37L4cjs = require('./chunk-DBRT37L4.cjs');var _chunkIMRTC6QScjs = require('./chunk-IMRTC6QS.cjs');var _chunkF3JXHUP4cjs = require('./chunk-F3JXHUP4.cjs');var _chunkPEJHW4CAcjs = require('./chunk-PEJHW4CA.cjs');var _chunkUTMQRL7Ncjs = require('./chunk-UTMQRL7N.cjs');var _chunkIADIYOLEcjs = require('./chunk-IADIYOLE.cjs');var _chunkIBMY5FOXcjs = require('./chunk-IBMY5FOX.cjs');var _chunkJJLTXK5Jcjs = require('./chunk-JJLTXK5J.cjs');var _chunkWNIVBVW7cjs = require('./chunk-WNIVBVW7.cjs');var _chunkNGLE2TBGcjs = require('./chunk-NGLE2TBG.cjs');var _chunk3YMN635Acjs = require('./chunk-3YMN635A.cjs');var _chunk3KWI3VEHcjs = require('./chunk-3KWI3VEH.cjs');var _chunk7HFKYJCKcjs = require('./chunk-7HFKYJCK.cjs');var _chunkWM4KSO6Ccjs = require('./chunk-WM4KSO6C.cjs');var _chunkLAHSLTRJcjs = require('./chunk-LAHSLTRJ.cjs');var _chunkBEVPU2EQcjs = require('./chunk-BEVPU2EQ.cjs');var _chunkEHJK4JRFcjs = require('./chunk-EHJK4JRF.cjs');var _chunkSW62SX4Ycjs = require('./chunk-SW62SX4Y.cjs');var _chunkOFLOVIU2cjs = require('./chunk-OFLOVIU2.cjs');var _chunkAWGKYXZCcjs = require('./chunk-AWGKYXZC.cjs');var _chunkZCCHYKDGcjs = require('./chunk-ZCCHYKDG.cjs');var _chunkWFR3HBYRcjs = require('./chunk-WFR3HBYR.cjs');var _chunk7XMQFPW7cjs = require('./chunk-7XMQFPW7.cjs');var _chunkDAFN5EJRcjs = require('./chunk-DAFN5EJR.cjs');var _chunkU3OEHN5Pcjs = require('./chunk-U3OEHN5P.cjs');var _chunkNBUEBREGcjs = require('./chunk-NBUEBREG.cjs');var _chunkYWTY4X2Rcjs = require('./chunk-YWTY4X2R.cjs');var _chunkR3TYGYBQcjs = require('./chunk-R3TYGYBQ.cjs');var _chunkYXKPCISKcjs = require('./chunk-YXKPCISK.cjs');var _chunkTUZHNOSGcjs = require('./chunk-TUZHNOSG.cjs');var _chunk442DWBIMcjs = require('./chunk-442DWBIM.cjs');var _chunkPNTFWNQBcjs = require('./chunk-PNTFWNQB.cjs');var _chunkYSTUBBOJcjs = require('./chunk-YSTUBBOJ.cjs');var _chunkTRIZIXDAcjs = require('./chunk-TRIZIXDA.cjs');var _chunkHL3QPU5Jcjs = require('./chunk-HL3QPU5J.cjs');var _chunkR6GHLSJBcjs = require('./chunk-R6GHLSJB.cjs');var _chunkBL5SQB5Scjs = require('./chunk-BL5SQB5S.cjs');var _chunkY7RFTHSRcjs = require('./chunk-Y7RFTHSR.cjs');var _chunkAQRYBCA3cjs = require('./chunk-AQRYBCA3.cjs');var _chunkBZMSXMATcjs = require('./chunk-BZMSXMAT.cjs');var _chunkBDJWSWG6cjs = require('./chunk-BDJWSWG6.cjs');var _chunkZHNB3KNNcjs = require('./chunk-ZHNB3KNN.cjs');var _chunk4KUPCNXNcjs = require('./chunk-4KUPCNXN.cjs');var _chunk6G7TWED4cjs = require('./chunk-6G7TWED4.cjs');var _chunkCJ3FPRHUcjs = require('./chunk-CJ3FPRHU.cjs');var _chunk53BDOG3Ycjs = require('./chunk-53BDOG3Y.cjs');var _chunkQJUPJFCQcjs = require('./chunk-QJUPJFCQ.cjs');var _chunk66577RZGcjs = require('./chunk-66577RZG.cjs');var _chunkDOH2U2KJcjs = require('./chunk-DOH2U2KJ.cjs');var _chunkXPF42SEFcjs = require('./chunk-XPF42SEF.cjs');var _chunkKRY2OVNWcjs = require('./chunk-KRY2OVNW.cjs');var _chunkLEH3IYNPcjs = require('./chunk-LEH3IYNP.cjs');var _chunkEYWIFSMNcjs = require('./chunk-EYWIFSMN.cjs');var _chunkE3XEHRICcjs = require('./chunk-E3XEHRIC.cjs');var _chunkH47HWN3Wcjs = require('./chunk-H47HWN3W.cjs');var _chunkP2IDCWXLcjs = require('./chunk-P2IDCWXL.cjs');var _chunkLOEKNPBGcjs = require('./chunk-LOEKNPBG.cjs');require('./chunk-OBWPUDD3.cjs');var _chunkAAOM3KE2cjs = require('./chunk-AAOM3KE2.cjs');var _chunkWYRK6YJUcjs = require('./chunk-WYRK6YJU.cjs');var _chunkE374WHO7cjs = require('./chunk-E374WHO7.cjs');require('./chunk-PEYRR7GN.cjs');require('./chunk-Z6OOXW67.cjs');require('./chunk-EROXO3T4.cjs');var _chunk6DKD76DKcjs = require('./chunk-6DKD76DK.cjs');var _chunkMIQQGQM6cjs = require('./chunk-MIQQGQM6.cjs');var _chunkBBVARAQQcjs = require('./chunk-BBVARAQQ.cjs');var _chunkD6F22MNScjs = require('./chunk-D6F22MNS.cjs');var _chunkHR3IUTNWcjs = require('./chunk-HR3IUTNW.cjs');var _chunkQLDNLCI3cjs = require('./chunk-QLDNLCI3.cjs');var _chunk4FCH7KNTcjs = require('./chunk-4FCH7KNT.cjs');var _chunkA2HUSITFcjs = require('./chunk-A2HUSITF.cjs');var _chunkWYM2JV5Tcjs = require('./chunk-WYM2JV5T.cjs');var _chunkWLNQOMKLcjs = require('./chunk-WLNQOMKL.cjs');var _chunkOLZEQGPJcjs = require('./chunk-OLZEQGPJ.cjs');var _chunkJ3DPGMAEcjs = require('./chunk-J3DPGMAE.cjs');var _chunkFJX3YNGWcjs = require('./chunk-FJX3YNGW.cjs');require('./chunk-I6KKO3TI.cjs');var _chunkDGMGGT4Acjs = require('./chunk-DGMGGT4A.cjs');require('./chunk-BGYDTTCY.cjs');var _chunk2JSUJZJRcjs = require('./chunk-2JSUJZJR.cjs');var _chunkG33UBR6Fcjs = require('./chunk-G33UBR6F.cjs');var _chunk5N3BA46Dcjs = require('./chunk-5N3BA46D.cjs');var _chunkWB2TJU2Jcjs = require('./chunk-WB2TJU2J.cjs');var _chunkJ2YCCSJVcjs = require('./chunk-J2YCCSJV.cjs');var _chunk5JPRNKKUcjs = require('./chunk-5JPRNKKU.cjs');require('./chunk-QFLTOQ2J.cjs');var _chunk3TLR3L2Wcjs = require('./chunk-3TLR3L2W.cjs');var _chunkTTO5FQC7cjs = require('./chunk-TTO5FQC7.cjs');var _chunkY52SHFCPcjs = require('./chunk-Y52SHFCP.cjs');var _chunk4MAOF3ZPcjs = require('./chunk-4MAOF3ZP.cjs');require('./chunk-4YUDBZFA.cjs');var Xr=typeof window<"u";exports.KEY_CODES = _chunkUTMQRL7Ncjs.a; exports.add = _chunk5N3BA46Dcjs.a; exports.addProp = _chunkG33UBR6Fcjs.a; exports.allPass = _chunkWB2TJU2Jcjs.a; exports.anyPass = _chunkJ2YCCSJVcjs.a; exports.ceil = _chunk5JPRNKKUcjs.a; exports.chunk = _chunk3TLR3L2Wcjs.a; exports.clamp = _chunkTTO5FQC7cjs.a; exports.clone = _chunkY52SHFCPcjs.a; exports.concat = _chunkA2HUSITFcjs.a; exports.conditional = _chunkWYM2JV5Tcjs.a; exports.constant = _chunkWLNQOMKLcjs.a; exports.curry = _chunk4MAOF3ZPcjs.a; exports.debounce = _chunkOLZEQGPJcjs.a; exports.difference = _chunkFJX3YNGWcjs.a; exports.differenceWith = _chunkJ3DPGMAEcjs.a; exports.divide = _chunk2JSUJZJRcjs.a; exports.doNothing = _chunkWYRK6YJUcjs.a; exports.drop = _chunkHR3IUTNWcjs.a; exports.dropFirstBy = _chunkE374WHO7cjs.a; exports.dropLast = _chunkBBVARAQQcjs.a; exports.dropLastWhile = _chunkMIQQGQM6cjs.a; exports.dropWhile = _chunkD6F22MNScjs.a; exports.entries = _chunkQLDNLCI3cjs.a; exports.evolve = _chunk4FCH7KNTcjs.a; exports.filter = _chunkKRY2OVNWcjs.a; exports.find = _chunkH47HWN3Wcjs.a; exports.findIndex = _chunkLEH3IYNPcjs.a; exports.findLast = _chunkE3XEHRICcjs.a; exports.findLastIndex = _chunkEYWIFSMNcjs.a; exports.first = _chunkLOEKNPBGcjs.a; exports.firstBy = _chunkP2IDCWXLcjs.a; exports.flat = _chunk6G7TWED4cjs.a; exports.flatMap = _chunkAAOM3KE2cjs.a; exports.floor = _chunkCJ3FPRHUcjs.a; exports.forEach = _chunkQJUPJFCQcjs.a; exports.forEachObj = _chunk53BDOG3Ycjs.a; exports.fromEntries = _chunk66577RZGcjs.a; exports.fromKeys = _chunkDOH2U2KJcjs.a; exports.groupBy = _chunkXPF42SEFcjs.a; exports.hasAtLeast = _chunk6DKD76DKcjs.a; exports.hasSubObject = _chunkR6GHLSJBcjs.a; exports.humanReadableFileSize = _chunkY7RFTHSRcjs.a; exports.identity = _chunkAQRYBCA3cjs.a; exports.indexBy = _chunkBZMSXMATcjs.a; exports.intersection = _chunkZHNB3KNNcjs.a; exports.intersectionWith = _chunkBDJWSWG6cjs.a; exports.invert = _chunk4KUPCNXNcjs.a; exports.isArray = _chunkYXKPCISKcjs.a; exports.isBigInt = _chunkTUZHNOSGcjs.a; exports.isBoolean = _chunk442DWBIMcjs.a; exports.isBrowser = Xr; exports.isDate = _chunkPNTFWNQBcjs.a; exports.isDeepEqual = _chunkBL5SQB5Scjs.a; exports.isDefined = _chunkYSTUBBOJcjs.a; exports.isEmpty = _chunkTRIZIXDAcjs.a; exports.isError = _chunkHL3QPU5Jcjs.a; exports.isFunction = _chunkZCCHYKDGcjs.a; exports.isIncludedIn = _chunkWFR3HBYRcjs.a; exports.isNonNull = _chunk7XMQFPW7cjs.a; exports.isNonNullish = _chunkDAFN5EJRcjs.a; exports.isNot = _chunkU3OEHN5Pcjs.a; exports.isNullish = _chunkNBUEBREGcjs.a; exports.isNumber = _chunkYWTY4X2Rcjs.a; exports.isObjectType = _chunkR3TYGYBQcjs.a; exports.isPlainObject = _chunk7HFKYJCKcjs.a; exports.isPromise = _chunkWM4KSO6Ccjs.a; exports.isShallowEqual = _chunkLAHSLTRJcjs.a; exports.isStrictEqual = _chunkBEVPU2EQcjs.a; exports.isString = _chunkEHJK4JRFcjs.a; exports.isSymbol = _chunkSW62SX4Ycjs.a; exports.isTruthy = _chunkOFLOVIU2cjs.a; exports.join = _chunkAWGKYXZCcjs.a; exports.keys = _chunkIADIYOLEcjs.a; exports.last = _chunkIBMY5FOXcjs.a; exports.length = _chunkJJLTXK5Jcjs.a; exports.map = _chunkR55FGFKUcjs.a; exports.mapKeys = _chunkWNIVBVW7cjs.a; exports.mapToObj = _chunkNGLE2TBGcjs.a; exports.mapValues = _chunk3YMN635Acjs.a; exports.mapWithFeedback = _chunk3KWI3VEHcjs.a; exports.meanBy = _chunkGRFK4SBRcjs.a; exports.merge = _chunkDBRT37L4cjs.a; exports.mergeAll = _chunk7RS2XXUGcjs.a; exports.mergeDeep = _chunkZ4ZUDQ7Ecjs.a; exports.multiply = _chunkIMRTC6QScjs.a; exports.nthBy = _chunkF3JXHUP4cjs.a; exports.objOf = _chunkPEJHW4CAcjs.a; exports.omit = _chunkAHHZAXLVcjs.a; exports.omitBy = _chunkNAYMME55cjs.a; exports.once = _chunkJRDQRETRcjs.a; exports.only = _chunkOWGBKUJ2cjs.a; exports.partition = _chunkQXQ5BE4Ccjs.a; exports.pathOr = _chunkMGCDUMSJcjs.a; exports.pick = _chunkRQHL6EVIcjs.a; exports.pickBy = _chunkHNEXKGNRcjs.a; exports.pipe = _chunkDGMGGT4Acjs.a; exports.piped = _chunkXTLGRWI2cjs.a; exports.product = _chunkFSTZSNDBcjs.a; exports.prop = _chunkWP5D3YAQcjs.a; exports.propImplementation = _chunkWP5D3YAQcjs.b; exports.pullObject = _chunkI33LBSLYcjs.a; exports.randomInteger = _chunkIOSBDH5Jcjs.a; exports.randomString = _chunkNC5GO4RUcjs.a; exports.range = _chunkRXSPNNEWcjs.a; exports.rankBy = _chunkZLNSRDW7cjs.a; exports.reduce = _chunkWQHSSKSDcjs.a; exports.reverse = _chunkCIWFQSJQcjs.a; exports.round = _chunkGG67ZAXXcjs.a; exports.sample = _chunkIPW4LWUMcjs.a; exports.set = _chunkQSYAGOIBcjs.a; exports.setPath = _chunkSHU7K6YPcjs.a; exports.setPathImplementation = _chunkSHU7K6YPcjs.b; exports.shuffle = _chunkXGT73UQWcjs.a; exports.sleep = _chunkHC3HZK4Qcjs.a; exports.sliceString = _chunk3WCOFJCScjs.a; exports.slugify = _chunkEP626HCIcjs.a; exports.sort = _chunkDGLS43L4cjs.a; exports.sortBy = _chunkKM5XOWVGcjs.a; exports.sortedIndex = _chunkUEL4TCYDcjs.a; exports.sortedIndexBy = _chunkUIXBYMGBcjs.a; exports.sortedIndexWith = _chunkNOZQSRNNcjs.a; exports.sortedLastIndex = _chunkNWEOHZQHcjs.a; exports.sortedLastIndexBy = _chunkJ7LDTU7Wcjs.a; exports.splice = _chunkTNBCVNKHcjs.a; exports.split = _chunkTFN3JWPScjs.a; exports.splitAt = _chunkJFHH5VKUcjs.a; exports.splitWhen = _chunkIP2ZEYIUcjs.a; exports.stringToPath = _chunkVRZNQSZNcjs.a; exports.subtract = _chunkRMLQX4GAcjs.a; exports.sum = _chunkTRUODFSQcjs.a; exports.sumBy = _chunkI4WQXZJHcjs.a; exports.swapIndices = _chunkQNFRANE2cjs.a; exports.swapProps = _chunkFRWE2CFIcjs.a; exports.take = _chunkCZI4WD5Qcjs.a; exports.takeFirstBy = _chunkU4HKRBD3cjs.a; exports.takeLast = _chunkLLHOSKEGcjs.a; exports.takeLastWhile = _chunk43XCMZYTcjs.a; exports.takeWhile = _chunkP4KRPPMAcjs.a; exports.tap = _chunkVH3XIFK7cjs.a; exports.times = _chunk6DDL3ZF6cjs.a; exports.toCamelCase = _chunkVNI4VRFMcjs.a; exports.toCapitalCase = _chunk7GAGU65Ucjs.a; exports.toConstantCase = _chunk5GI4OEUMcjs.a; exports.toKebabCase = _chunkRAHS5RJScjs.a; exports.toNoCase = _chunkI27XCDDIcjs.a; exports.toPascalCase = _chunkG74G5PZTcjs.a; exports.toPascalSnakeCase = _chunkWVTQN2AIcjs.a; exports.toSentenceCase = _chunkN7AESA4Wcjs.a; exports.toSnakeCase = _chunkLPNHLDEAcjs.a; exports.toTrainCase = _chunkX7EK7EDZcjs.a; exports.unique = _chunkBBYC5W6Ecjs.a; exports.uniqueBy = _chunkESGYUUU2cjs.a; exports.uniqueWith = _chunkRGUX2LCHcjs.a; exports.values = _chunkMYUMWF5Acjs.a; exports.zip = _chunkEFURGOGBcjs.a; exports.zipWith = _chunkM5Z4GCV3cjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkESGYUUU2cjs = require('./chunk-ESGYUUU2.cjs');var _chunkRGUX2LCHcjs = require('./chunk-RGUX2LCH.cjs');var _chunkBBYC5W6Ecjs = require('./chunk-BBYC5W6E.cjs');var _chunkMYUMWF5Acjs = require('./chunk-MYUMWF5A.cjs');var _chunkM5Z4GCV3cjs = require('./chunk-M5Z4GCV3.cjs');var _chunkEFURGOGBcjs = require('./chunk-EFURGOGB.cjs');var _chunk5GI4OEUMcjs = require('./chunk-5GI4OEUM.cjs');var _chunkRAHS5RJScjs = require('./chunk-RAHS5RJS.cjs');var _chunkG74G5PZTcjs = require('./chunk-G74G5PZT.cjs');var _chunkWVTQN2AIcjs = require('./chunk-WVTQN2AI.cjs');var _chunkN7AESA4Wcjs = require('./chunk-N7AESA4W.cjs');var _chunkLPNHLDEAcjs = require('./chunk-LPNHLDEA.cjs');var _chunkI27XCDDIcjs = require('./chunk-I27XCDDI.cjs');var _chunkX7EK7EDZcjs = require('./chunk-X7EK7EDZ.cjs');var _chunkLLHOSKEGcjs = require('./chunk-LLHOSKEG.cjs');var _chunkP4KRPPMAcjs = require('./chunk-P4KRPPMA.cjs');var _chunkCZI4WD5Qcjs = require('./chunk-CZI4WD5Q.cjs');var _chunkVH3XIFK7cjs = require('./chunk-VH3XIFK7.cjs');var _chunk6DDL3ZF6cjs = require('./chunk-6DDL3ZF6.cjs');var _chunkVNI4VRFMcjs = require('./chunk-VNI4VRFM.cjs');var _chunk7GAGU65Ucjs = require('./chunk-7GAGU65U.cjs');require('./chunk-OPJJI442.cjs');var _chunkVRZNQSZNcjs = require('./chunk-VRZNQSZN.cjs');var _chunkRMLQX4GAcjs = require('./chunk-RMLQX4GA.cjs');var _chunkI4WQXZJHcjs = require('./chunk-I4WQXZJH.cjs');var _chunkTRUODFSQcjs = require('./chunk-TRUODFSQ.cjs');var _chunkQNFRANE2cjs = require('./chunk-QNFRANE2.cjs');var _chunkFRWE2CFIcjs = require('./chunk-FRWE2CFI.cjs');var _chunkU4HKRBD3cjs = require('./chunk-U4HKRBD3.cjs');var _chunk43XCMZYTcjs = require('./chunk-43XCMZYT.cjs');var _chunkNOZQSRNNcjs = require('./chunk-NOZQSRNN.cjs');var _chunkUEL4TCYDcjs = require('./chunk-UEL4TCYD.cjs');var _chunkJ7LDTU7Wcjs = require('./chunk-J7LDTU7W.cjs');var _chunkNWEOHZQHcjs = require('./chunk-NWEOHZQH.cjs');var _chunkTNBCVNKHcjs = require('./chunk-TNBCVNKH.cjs');var _chunkJFHH5VKUcjs = require('./chunk-JFHH5VKU.cjs');var _chunkIP2ZEYIUcjs = require('./chunk-IP2ZEYIU.cjs');var _chunkTFN3JWPScjs = require('./chunk-TFN3JWPS.cjs');var _chunkQSYAGOIBcjs = require('./chunk-QSYAGOIB.cjs');var _chunkXGT73UQWcjs = require('./chunk-XGT73UQW.cjs');var _chunk3WCOFJCScjs = require('./chunk-3WCOFJCS.cjs');var _chunkEP626HCIcjs = require('./chunk-EP626HCI.cjs');var _chunkKM5XOWVGcjs = require('./chunk-KM5XOWVG.cjs');var _chunkDGLS43L4cjs = require('./chunk-DGLS43L4.cjs');var _chunkUIXBYMGBcjs = require('./chunk-UIXBYMGB.cjs');require('./chunk-7TDMV2GO.cjs');var _chunkNC5GO4RUcjs = require('./chunk-NC5GO4RU.cjs');var _chunkRXSPNNEWcjs = require('./chunk-RXSPNNEW.cjs');var _chunkZLNSRDW7cjs = require('./chunk-ZLNSRDW7.cjs');var _chunkWQHSSKSDcjs = require('./chunk-WQHSSKSD.cjs');var _chunkCIWFQSJQcjs = require('./chunk-CIWFQSJQ.cjs');var _chunkGG67ZAXXcjs = require('./chunk-GG67ZAXX.cjs');var _chunkIPW4LWUMcjs = require('./chunk-IPW4LWUM.cjs');var _chunkSHU7K6YPcjs = require('./chunk-SHU7K6YP.cjs');var _chunkHNEXKGNRcjs = require('./chunk-HNEXKGNR.cjs');var _chunkRQHL6EVIcjs = require('./chunk-RQHL6EVI.cjs');var _chunkXTLGRWI2cjs = require('./chunk-XTLGRWI2.cjs');var _chunkFSTZSNDBcjs = require('./chunk-FSTZSNDB.cjs');var _chunkYNCQNUT4cjs = require('./chunk-YNCQNUT4.cjs');var _chunkI33LBSLYcjs = require('./chunk-I33LBSLY.cjs');var _chunkSJMGQLYScjs = require('./chunk-SJMGQLYS.cjs');var _chunkF3JXHUP4cjs = require('./chunk-F3JXHUP4.cjs');var _chunkPEJHW4CAcjs = require('./chunk-PEJHW4CA.cjs');var _chunkNAYMME55cjs = require('./chunk-NAYMME55.cjs');var _chunkAHHZAXLVcjs = require('./chunk-AHHZAXLV.cjs');var _chunkJRDQRETRcjs = require('./chunk-JRDQRETR.cjs');var _chunkOWGBKUJ2cjs = require('./chunk-OWGBKUJ2.cjs');var _chunkQXQ5BE4Ccjs = require('./chunk-QXQ5BE4C.cjs');var _chunkMGCDUMSJcjs = require('./chunk-MGCDUMSJ.cjs');var _chunk3YMN635Acjs = require('./chunk-3YMN635A.cjs');var _chunk3KWI3VEHcjs = require('./chunk-3KWI3VEH.cjs');var _chunkR55FGFKUcjs = require('./chunk-R55FGFKU.cjs');var _chunkGRFK4SBRcjs = require('./chunk-GRFK4SBR.cjs');var _chunk7RS2XXUGcjs = require('./chunk-7RS2XXUG.cjs');var _chunkZ4ZUDQ7Ecjs = require('./chunk-Z4ZUDQ7E.cjs');var _chunkDBRT37L4cjs = require('./chunk-DBRT37L4.cjs');var _chunkIMRTC6QScjs = require('./chunk-IMRTC6QS.cjs');var _chunkOFLOVIU2cjs = require('./chunk-OFLOVIU2.cjs');var _chunkAWGKYXZCcjs = require('./chunk-AWGKYXZC.cjs');var _chunkUTMQRL7Ncjs = require('./chunk-UTMQRL7N.cjs');var _chunkIADIYOLEcjs = require('./chunk-IADIYOLE.cjs');var _chunkIBMY5FOXcjs = require('./chunk-IBMY5FOX.cjs');var _chunkJJLTXK5Jcjs = require('./chunk-JJLTXK5J.cjs');var _chunkWNIVBVW7cjs = require('./chunk-WNIVBVW7.cjs');var _chunkNGLE2TBGcjs = require('./chunk-NGLE2TBG.cjs');var _chunkYWTY4X2Rcjs = require('./chunk-YWTY4X2R.cjs');var _chunkR3TYGYBQcjs = require('./chunk-R3TYGYBQ.cjs');var _chunk7HFKYJCKcjs = require('./chunk-7HFKYJCK.cjs');var _chunkWM4KSO6Ccjs = require('./chunk-WM4KSO6C.cjs');var _chunkLAHSLTRJcjs = require('./chunk-LAHSLTRJ.cjs');var _chunkBEVPU2EQcjs = require('./chunk-BEVPU2EQ.cjs');var _chunkEHJK4JRFcjs = require('./chunk-EHJK4JRF.cjs');var _chunkSW62SX4Ycjs = require('./chunk-SW62SX4Y.cjs');var _chunkTRIZIXDAcjs = require('./chunk-TRIZIXDA.cjs');var _chunkHL3QPU5Jcjs = require('./chunk-HL3QPU5J.cjs');var _chunkZCCHYKDGcjs = require('./chunk-ZCCHYKDG.cjs');var _chunkWFR3HBYRcjs = require('./chunk-WFR3HBYR.cjs');var _chunk7XMQFPW7cjs = require('./chunk-7XMQFPW7.cjs');var _chunkDAFN5EJRcjs = require('./chunk-DAFN5EJR.cjs');var _chunkU3OEHN5Pcjs = require('./chunk-U3OEHN5P.cjs');var _chunkNBUEBREGcjs = require('./chunk-NBUEBREG.cjs');var _chunkZHNB3KNNcjs = require('./chunk-ZHNB3KNN.cjs');var _chunk4KUPCNXNcjs = require('./chunk-4KUPCNXN.cjs');var _chunkYXKPCISKcjs = require('./chunk-YXKPCISK.cjs');var _chunkTUZHNOSGcjs = require('./chunk-TUZHNOSG.cjs');var _chunk442DWBIMcjs = require('./chunk-442DWBIM.cjs');var _chunkPNTFWNQBcjs = require('./chunk-PNTFWNQB.cjs');var _chunkYSTUBBOJcjs = require('./chunk-YSTUBBOJ.cjs');var _chunkXPF42SEFcjs = require('./chunk-XPF42SEF.cjs');var _chunkR6GHLSJBcjs = require('./chunk-R6GHLSJB.cjs');var _chunkBL5SQB5Scjs = require('./chunk-BL5SQB5S.cjs');var _chunkY7RFTHSRcjs = require('./chunk-Y7RFTHSR.cjs');var _chunkBZMSXMATcjs = require('./chunk-BZMSXMAT.cjs');var _chunkBDJWSWG6cjs = require('./chunk-BDJWSWG6.cjs');var _chunkAAOM3KE2cjs = require('./chunk-AAOM3KE2.cjs');var _chunk6G7TWED4cjs = require('./chunk-6G7TWED4.cjs');var _chunkCJ3FPRHUcjs = require('./chunk-CJ3FPRHU.cjs');var _chunk53BDOG3Ycjs = require('./chunk-53BDOG3Y.cjs');var _chunkQJUPJFCQcjs = require('./chunk-QJUPJFCQ.cjs');var _chunk66577RZGcjs = require('./chunk-66577RZG.cjs');var _chunkDOH2U2KJcjs = require('./chunk-DOH2U2KJ.cjs');var _chunkAQRYBCA3cjs = require('./chunk-AQRYBCA3.cjs');var _chunkHC3HZK4Qcjs = require('./chunk-HC3HZK4Q.cjs');var _chunkGOUUMCT7cjs = require('./chunk-GOUUMCT7.cjs');var _chunk4FCH7KNTcjs = require('./chunk-4FCH7KNT.cjs');var _chunkKRY2OVNWcjs = require('./chunk-KRY2OVNW.cjs');var _chunkLEH3IYNPcjs = require('./chunk-LEH3IYNP.cjs');var _chunkEYWIFSMNcjs = require('./chunk-EYWIFSMN.cjs');var _chunkE3XEHRICcjs = require('./chunk-E3XEHRIC.cjs');var _chunkH47HWN3Wcjs = require('./chunk-H47HWN3W.cjs');var _chunkP2IDCWXLcjs = require('./chunk-P2IDCWXL.cjs');var _chunkLOEKNPBGcjs = require('./chunk-LOEKNPBG.cjs');require('./chunk-OBWPUDD3.cjs');var _chunk2JSUJZJRcjs = require('./chunk-2JSUJZJR.cjs');var _chunkWYRK6YJUcjs = require('./chunk-WYRK6YJU.cjs');var _chunkE374WHO7cjs = require('./chunk-E374WHO7.cjs');require('./chunk-PEYRR7GN.cjs');require('./chunk-Z6OOXW67.cjs');require('./chunk-EROXO3T4.cjs');var _chunk6DKD76DKcjs = require('./chunk-6DKD76DK.cjs');var _chunkMIQQGQM6cjs = require('./chunk-MIQQGQM6.cjs');var _chunkBBVARAQQcjs = require('./chunk-BBVARAQQ.cjs');var _chunkD6F22MNScjs = require('./chunk-D6F22MNS.cjs');var _chunkHR3IUTNWcjs = require('./chunk-HR3IUTNW.cjs');var _chunkQLDNLCI3cjs = require('./chunk-QLDNLCI3.cjs');var _chunkA2HUSITFcjs = require('./chunk-A2HUSITF.cjs');var _chunkWYM2JV5Tcjs = require('./chunk-WYM2JV5T.cjs');var _chunkWLNQOMKLcjs = require('./chunk-WLNQOMKL.cjs');var _chunk6YAVWI3Xcjs = require('./chunk-6YAVWI3X.cjs');var _chunkOLZEQGPJcjs = require('./chunk-OLZEQGPJ.cjs');var _chunkJ3DPGMAEcjs = require('./chunk-J3DPGMAE.cjs');var _chunkFJX3YNGWcjs = require('./chunk-FJX3YNGW.cjs');require('./chunk-I6KKO3TI.cjs');var _chunkDGMGGT4Acjs = require('./chunk-DGMGGT4A.cjs');require('./chunk-BGYDTTCY.cjs');var _chunkG33UBR6Fcjs = require('./chunk-G33UBR6F.cjs');var _chunk5N3BA46Dcjs = require('./chunk-5N3BA46D.cjs');var _chunkWB2TJU2Jcjs = require('./chunk-WB2TJU2J.cjs');var _chunkJ2YCCSJVcjs = require('./chunk-J2YCCSJV.cjs');var _chunk5JPRNKKUcjs = require('./chunk-5JPRNKKU.cjs');require('./chunk-QFLTOQ2J.cjs');var _chunkEGUKWDAKcjs = require('./chunk-EGUKWDAK.cjs');var _chunkTTO5FQC7cjs = require('./chunk-TTO5FQC7.cjs');var _chunkY52SHFCPcjs = require('./chunk-Y52SHFCP.cjs');var _chunk4MAOF3ZPcjs = require('./chunk-4MAOF3ZP.cjs');require('./chunk-4YUDBZFA.cjs');var Zr=typeof window<"u";exports.KEY_CODES = _chunkUTMQRL7Ncjs.a; exports.add = _chunk5N3BA46Dcjs.a; exports.addProp = _chunkG33UBR6Fcjs.a; exports.allPass = _chunkWB2TJU2Jcjs.a; exports.anyPass = _chunkJ2YCCSJVcjs.a; exports.ceil = _chunk5JPRNKKUcjs.a; exports.chunk = _chunkEGUKWDAKcjs.a; exports.clamp = _chunkTTO5FQC7cjs.a; exports.clone = _chunkY52SHFCPcjs.a; exports.concat = _chunkA2HUSITFcjs.a; exports.conditional = _chunkWYM2JV5Tcjs.a; exports.constant = _chunkWLNQOMKLcjs.a; exports.countBy = _chunk6YAVWI3Xcjs.a; exports.curry = _chunk4MAOF3ZPcjs.a; exports.debounce = _chunkOLZEQGPJcjs.a; exports.difference = _chunkFJX3YNGWcjs.a; exports.differenceWith = _chunkJ3DPGMAEcjs.a; exports.divide = _chunk2JSUJZJRcjs.a; exports.doNothing = _chunkWYRK6YJUcjs.a; exports.drop = _chunkHR3IUTNWcjs.a; exports.dropFirstBy = _chunkE374WHO7cjs.a; exports.dropLast = _chunkBBVARAQQcjs.a; exports.dropLastWhile = _chunkMIQQGQM6cjs.a; exports.dropWhile = _chunkD6F22MNScjs.a; exports.entries = _chunkQLDNLCI3cjs.a; exports.evolve = _chunk4FCH7KNTcjs.a; exports.filter = _chunkKRY2OVNWcjs.a; exports.find = _chunkH47HWN3Wcjs.a; exports.findIndex = _chunkLEH3IYNPcjs.a; exports.findLast = _chunkE3XEHRICcjs.a; exports.findLastIndex = _chunkEYWIFSMNcjs.a; exports.first = _chunkLOEKNPBGcjs.a; exports.firstBy = _chunkP2IDCWXLcjs.a; exports.flat = _chunk6G7TWED4cjs.a; exports.flatMap = _chunkAAOM3KE2cjs.a; exports.floor = _chunkCJ3FPRHUcjs.a; exports.forEach = _chunkQJUPJFCQcjs.a; exports.forEachObj = _chunk53BDOG3Ycjs.a; exports.fromEntries = _chunk66577RZGcjs.a; exports.fromKeys = _chunkDOH2U2KJcjs.a; exports.funnel = _chunkGOUUMCT7cjs.a; exports.groupBy = _chunkXPF42SEFcjs.a; exports.hasAtLeast = _chunk6DKD76DKcjs.a; exports.hasSubObject = _chunkR6GHLSJBcjs.a; exports.humanReadableFileSize = _chunkY7RFTHSRcjs.a; exports.identity = _chunkAQRYBCA3cjs.a; exports.indexBy = _chunkBZMSXMATcjs.a; exports.intersection = _chunkZHNB3KNNcjs.a; exports.intersectionWith = _chunkBDJWSWG6cjs.a; exports.invert = _chunk4KUPCNXNcjs.a; exports.isArray = _chunkYXKPCISKcjs.a; exports.isBigInt = _chunkTUZHNOSGcjs.a; exports.isBoolean = _chunk442DWBIMcjs.a; exports.isBrowser = Zr; exports.isDate = _chunkPNTFWNQBcjs.a; exports.isDeepEqual = _chunkBL5SQB5Scjs.a; exports.isDefined = _chunkYSTUBBOJcjs.a; exports.isEmpty = _chunkTRIZIXDAcjs.a; exports.isError = _chunkHL3QPU5Jcjs.a; exports.isFunction = _chunkZCCHYKDGcjs.a; exports.isIncludedIn = _chunkWFR3HBYRcjs.a; exports.isNonNull = _chunk7XMQFPW7cjs.a; exports.isNonNullish = _chunkDAFN5EJRcjs.a; exports.isNot = _chunkU3OEHN5Pcjs.a; exports.isNullish = _chunkNBUEBREGcjs.a; exports.isNumber = _chunkYWTY4X2Rcjs.a; exports.isObjectType = _chunkR3TYGYBQcjs.a; exports.isPlainObject = _chunk7HFKYJCKcjs.a; exports.isPromise = _chunkWM4KSO6Ccjs.a; exports.isShallowEqual = _chunkLAHSLTRJcjs.a; exports.isStrictEqual = _chunkBEVPU2EQcjs.a; exports.isString = _chunkEHJK4JRFcjs.a; exports.isSymbol = _chunkSW62SX4Ycjs.a; exports.isTruthy = _chunkOFLOVIU2cjs.a; exports.join = _chunkAWGKYXZCcjs.a; exports.keys = _chunkIADIYOLEcjs.a; exports.last = _chunkIBMY5FOXcjs.a; exports.length = _chunkJJLTXK5Jcjs.a; exports.map = _chunkR55FGFKUcjs.a; exports.mapKeys = _chunkWNIVBVW7cjs.a; exports.mapToObj = _chunkNGLE2TBGcjs.a; exports.mapValues = _chunk3YMN635Acjs.a; exports.mapWithFeedback = _chunk3KWI3VEHcjs.a; exports.meanBy = _chunkGRFK4SBRcjs.a; exports.merge = _chunkDBRT37L4cjs.a; exports.mergeAll = _chunk7RS2XXUGcjs.a; exports.mergeDeep = _chunkZ4ZUDQ7Ecjs.a; exports.multiply = _chunkIMRTC6QScjs.a; exports.nthBy = _chunkF3JXHUP4cjs.a; exports.objOf = _chunkPEJHW4CAcjs.a; exports.omit = _chunkAHHZAXLVcjs.a; exports.omitBy = _chunkNAYMME55cjs.a; exports.once = _chunkJRDQRETRcjs.a; exports.only = _chunkOWGBKUJ2cjs.a; exports.partition = _chunkQXQ5BE4Ccjs.a; exports.pathOr = _chunkMGCDUMSJcjs.a; exports.pick = _chunkRQHL6EVIcjs.a; exports.pickBy = _chunkHNEXKGNRcjs.a; exports.pipe = _chunkDGMGGT4Acjs.a; exports.piped = _chunkXTLGRWI2cjs.a; exports.product = _chunkFSTZSNDBcjs.a; exports.prop = _chunkYNCQNUT4cjs.a; exports.propImplementation = _chunkYNCQNUT4cjs.b; exports.pullObject = _chunkI33LBSLYcjs.a; exports.randomInteger = _chunkSJMGQLYScjs.a; exports.randomString = _chunkNC5GO4RUcjs.a; exports.range = _chunkRXSPNNEWcjs.a; exports.rankBy = _chunkZLNSRDW7cjs.a; exports.reduce = _chunkWQHSSKSDcjs.a; exports.reverse = _chunkCIWFQSJQcjs.a; exports.round = _chunkGG67ZAXXcjs.a; exports.sample = _chunkIPW4LWUMcjs.a; exports.set = _chunkQSYAGOIBcjs.a; exports.setPath = _chunkSHU7K6YPcjs.a; exports.setPathImplementation = _chunkSHU7K6YPcjs.b; exports.shuffle = _chunkXGT73UQWcjs.a; exports.sleep = _chunkHC3HZK4Qcjs.a; exports.sliceString = _chunk3WCOFJCScjs.a; exports.slugify = _chunkEP626HCIcjs.a; exports.sort = _chunkDGLS43L4cjs.a; exports.sortBy = _chunkKM5XOWVGcjs.a; exports.sortedIndex = _chunkUEL4TCYDcjs.a; exports.sortedIndexBy = _chunkUIXBYMGBcjs.a; exports.sortedIndexWith = _chunkNOZQSRNNcjs.a; exports.sortedLastIndex = _chunkNWEOHZQHcjs.a; exports.sortedLastIndexBy = _chunkJ7LDTU7Wcjs.a; exports.splice = _chunkTNBCVNKHcjs.a; exports.split = _chunkTFN3JWPScjs.a; exports.splitAt = _chunkJFHH5VKUcjs.a; exports.splitWhen = _chunkIP2ZEYIUcjs.a; exports.stringToPath = _chunkVRZNQSZNcjs.a; exports.subtract = _chunkRMLQX4GAcjs.a; exports.sum = _chunkTRUODFSQcjs.a; exports.sumBy = _chunkI4WQXZJHcjs.a; exports.swapIndices = _chunkQNFRANE2cjs.a; exports.swapProps = _chunkFRWE2CFIcjs.a; exports.take = _chunkCZI4WD5Qcjs.a; exports.takeFirstBy = _chunkU4HKRBD3cjs.a; exports.takeLast = _chunkLLHOSKEGcjs.a; exports.takeLastWhile = _chunk43XCMZYTcjs.a; exports.takeWhile = _chunkP4KRPPMAcjs.a; exports.tap = _chunkVH3XIFK7cjs.a; exports.times = _chunk6DDL3ZF6cjs.a; exports.toCamelCase = _chunkVNI4VRFMcjs.a; exports.toCapitalCase = _chunk7GAGU65Ucjs.a; exports.toConstantCase = _chunk5GI4OEUMcjs.a; exports.toKebabCase = _chunkRAHS5RJScjs.a; exports.toNoCase = _chunkI27XCDDIcjs.a; exports.toPascalCase = _chunkG74G5PZTcjs.a; exports.toPascalSnakeCase = _chunkWVTQN2AIcjs.a; exports.toSentenceCase = _chunkN7AESA4Wcjs.a; exports.toSnakeCase = _chunkLPNHLDEAcjs.a; exports.toTrainCase = _chunkX7EK7EDZcjs.a; exports.unique = _chunkBBYC5W6Ecjs.a; exports.uniqueBy = _chunkESGYUUU2cjs.a; exports.uniqueWith = _chunkRGUX2LCHcjs.a; exports.values = _chunkMYUMWF5Acjs.a; exports.zip = _chunkEFURGOGBcjs.a; exports.zipWith = _chunkM5Z4GCV3cjs.a;
package/dist/index.d.cts CHANGED
@@ -9,6 +9,7 @@ export { clone } from './clone.cjs';
9
9
  export { concat } from './concat.cjs';
10
10
  export { conditional } from './conditional.cjs';
11
11
  export { constant } from './constant.cjs';
12
+ export { countBy } from './count-by.cjs';
12
13
  export { curry } from './curry.cjs';
13
14
  export { debounce } from './debounce.cjs';
14
15
  export { difference } from './difference.cjs';
@@ -36,6 +37,7 @@ export { forEach } from './for-each.cjs';
36
37
  export { forEachObj } from './for-each-obj.cjs';
37
38
  export { fromEntries } from './from-entries.cjs';
38
39
  export { fromKeys } from './from-keys.cjs';
40
+ export { funnel } from './funnel.cjs';
39
41
  export { groupBy } from './group-by.cjs';
40
42
  export { hasAtLeast } from './has-at-least.cjs';
41
43
  export { hasSubObject } from './has-sub-object.cjs';
@@ -155,14 +157,15 @@ export { zipWith } from './zip-with.cjs';
155
157
  import './upsert-prop-CGK0wJEu.cjs';
156
158
  import 'type-fest';
157
159
  import './is-union-Bx34mF34.cjs';
160
+ import './int-range-inclusive-Cn-qsrAN.cjs';
158
161
  import './iterable-container-BTpDVdNc.cjs';
159
162
  import './tuple-parts-DcH94smG.cjs';
160
163
  import './non-empty-array-C9Od1wmF.cjs';
164
+ import './exact-record-h-jwajoM.cjs';
165
+ import './if-bounded-record-DVYSMNKL.cjs';
161
166
  import './curry-order-rules-BKXCPBNx.cjs';
162
167
  import './enumerable-string-key-of-BQ4aR5ep.cjs';
163
168
  import './enumerable-string-keyed-value-of-CLzltniW.cjs';
164
- import './exact-record-h-jwajoM.cjs';
165
- import './if-bounded-record-DVYSMNKL.cjs';
166
169
  import './narrowed-to-CDIykNaN.cjs';
167
170
  import './mapped-D9hCE2LX.cjs';
168
171
  import './reconstructed-record-DchLaSO8.cjs';
package/dist/index.d.ts CHANGED
@@ -9,6 +9,7 @@ export { clone } from './clone.js';
9
9
  export { concat } from './concat.js';
10
10
  export { conditional } from './conditional.js';
11
11
  export { constant } from './constant.js';
12
+ export { countBy } from './count-by.js';
12
13
  export { curry } from './curry.js';
13
14
  export { debounce } from './debounce.js';
14
15
  export { difference } from './difference.js';
@@ -36,6 +37,7 @@ export { forEach } from './for-each.js';
36
37
  export { forEachObj } from './for-each-obj.js';
37
38
  export { fromEntries } from './from-entries.js';
38
39
  export { fromKeys } from './from-keys.js';
40
+ export { funnel } from './funnel.js';
39
41
  export { groupBy } from './group-by.js';
40
42
  export { hasAtLeast } from './has-at-least.js';
41
43
  export { hasSubObject } from './has-sub-object.js';
@@ -155,14 +157,15 @@ export { zipWith } from './zip-with.js';
155
157
  import './upsert-prop-Ddv30E0o.js';
156
158
  import 'type-fest';
157
159
  import './is-union-Bx34mF34.js';
160
+ import './int-range-inclusive-Cn-qsrAN.js';
158
161
  import './iterable-container-BTpDVdNc.js';
159
162
  import './tuple-parts-DcH94smG.js';
160
163
  import './non-empty-array-C9Od1wmF.js';
164
+ import './exact-record-Bf4LoPyZ.js';
165
+ import './if-bounded-record-DVYSMNKL.js';
161
166
  import './curry-order-rules-BKXCPBNx.js';
162
167
  import './enumerable-string-key-of-BQ4aR5ep.js';
163
168
  import './enumerable-string-keyed-value-of-CLzltniW.js';
164
- import './exact-record-Bf4LoPyZ.js';
165
- import './if-bounded-record-DVYSMNKL.js';
166
169
  import './narrowed-to-CDIykNaN.js';
167
170
  import './mapped-C0LN24rT.js';
168
171
  import './reconstructed-record-DuxOLlMs.js';
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{a as Rr}from"./chunk-EF5X6QTJ.js";import{a as Ur}from"./chunk-LG6MCIRY.js";import{a as Wr}from"./chunk-NUWRLWTO.js";import{a as Vr}from"./chunk-QF7NW7HB.js";import{a as Mr}from"./chunk-ZIGQWNCG.js";import{a as Nr}from"./chunk-OT55MXTZ.js";import{a as Or}from"./chunk-L4S5OAPG.js";import{a as Pr}from"./chunk-5OPUQ5T6.js";import{a as Qr}from"./chunk-RW5FFMRB.js";import{a as Sr}from"./chunk-NLFMCMRF.js";import{a as Tr}from"./chunk-ONHSFOMY.js";import{a as Er}from"./chunk-DYTMLSGO.js";import{a as zr}from"./chunk-KN4W6OD3.js";import{a as Fr}from"./chunk-HI5HNTZE.js";import{a as Gr}from"./chunk-5BVIP7QQ.js";import{a as Hr}from"./chunk-ZAZDS3SB.js";import{a as Ir}from"./chunk-CQ7LGCRX.js";import{a as Jr}from"./chunk-EYPNBGK5.js";import{a as Lr}from"./chunk-L4ZCRIBG.js";import{a as Kr}from"./chunk-MFSRIHWE.js";import"./chunk-MZEHWQF3.js";import{a as lr}from"./chunk-2ZDGLSFC.js";import{a as kr}from"./chunk-V2A3F3I4.js";import{a as qr}from"./chunk-CII3USNE.js";import{a as vr}from"./chunk-QI5SZK45.js";import{a as Ar}from"./chunk-SB72SOA2.js";import{a as Dr}from"./chunk-RYG2DHC3.js";import{a as Cr}from"./chunk-X5D4U2SM.js";import{a as yr}from"./chunk-4WJ75PJB.js";import{a as ur}from"./chunk-37JFJJRL.js";import{a as Br}from"./chunk-I2WOF7PP.js";import{a as br}from"./chunk-2Y6BV2AH.js";import{a as gr}from"./chunk-NWX42UEX.js";import{a as ar}from"./chunk-RBODUO3Q.js";import{a as hr}from"./chunk-CZLV6ZLZ.js";import{a as jr}from"./chunk-QDVSGYJD.js";import{a as xr}from"./chunk-6SYP2DRD.js";import{a as mr}from"./chunk-FGVDZJ7U.js";import{a as nr}from"./chunk-XSSRBOMF.js";import{a as ir}from"./chunk-2GPOH4MN.js";import{a as dr}from"./chunk-3UB2RIEU.js";import{a as wr}from"./chunk-ATE3F5N2.js";import{a as cr}from"./chunk-TWWU2V2W.js";import{a as sr}from"./chunk-24TP4E2P.js";import"./chunk-JZ463SIK.js";import{a as Zo}from"./chunk-G57ZPKMR.js";import{a as _o}from"./chunk-2IZU6WD5.js";import{a as $o}from"./chunk-V6HQDVID.js";import{a as or}from"./chunk-XCB6Q73P.js";import{a as rr}from"./chunk-5JB2UNJV.js";import{a as tr,b as fr}from"./chunk-6UDUSN46.js";import{a as er}from"./chunk-OOJU5HRX.js";import{a as pr}from"./chunk-JYFYY7NT.js";import{a as Ro}from"./chunk-RLO65MYN.js";import{a as So}from"./chunk-7UGK4BYN.js";import{a as To,b as Uo}from"./chunk-HE3Z4UIX.js";import{a as Vo}from"./chunk-XIC3HU42.js";import{a as Wo}from"./chunk-QT66COHU.js";import{a as Xo}from"./chunk-JOTWEYDR.js";import{a as Yo}from"./chunk-OW5U2BI2.js";import{a as Ko}from"./chunk-AE3CGQUB.js";import{a as Jo}from"./chunk-UKXOFPA6.js";import{a as Lo}from"./chunk-C6IMN7SF.js";import{a as Mo}from"./chunk-TJCE2J3B.js";import{a as No}from"./chunk-HZNODTV6.js";import{a as Oo}from"./chunk-HF5OFI3W.js";import{a as Qo}from"./chunk-JTEBK6CE.js";import{a as Po}from"./chunk-32CXKACC.js";import{a as lo}from"./chunk-5RDW3Z6T.js";import{a as Co}from"./chunk-72XBT2YD.js";import{a as Eo}from"./chunk-7P7RJIIO.js";import{a as Fo}from"./chunk-PQTXQYXP.js";import{a as Do}from"./chunk-T4EXOJCT.js";import{a as Go}from"./chunk-JJ5JH3YT.js";import{a as Ho}from"./chunk-UDSRBKNR.js";import{a as Io}from"./chunk-FQQ7JL2Z.js";import{a as go}from"./chunk-BQA4B5JX.js";import{a as ho}from"./chunk-7TAKH2LO.js";import{a as jo}from"./chunk-N2IZRL36.js";import{a as ko}from"./chunk-7DBLJJ5X.js";import{a as qo}from"./chunk-QSH3UEIB.js";import{a as vo}from"./chunk-Y5CMISVL.js";import{a as zo}from"./chunk-FBGRS3MN.js";import{a as Ao}from"./chunk-XL4J54XF.js";import{a as so}from"./chunk-6AFNPQW2.js";import{a as wo}from"./chunk-HFNVS6OX.js";import{a as co}from"./chunk-OAHCRUJ7.js";import{a as uo}from"./chunk-5ZDIGGAT.js";import{a as yo}from"./chunk-UYLVIAK4.js";import{a as Bo}from"./chunk-YBJMFRB6.js";import{a as ao}from"./chunk-RFHE6DOJ.js";import{a as bo}from"./chunk-RFNOAVDK.js";import{a as eo}from"./chunk-VPHS3T3W.js";import{a as to}from"./chunk-75K2QEB3.js";import{a as fo}from"./chunk-6BKLAQWR.js";import{a as po}from"./chunk-QPP664N4.js";import{a as xo}from"./chunk-G73S4IVJ.js";import{a as mo}from"./chunk-3I7FLADN.js";import{a as no}from"./chunk-Q2HW4RVT.js";import{a as io}from"./chunk-EBS4GCKX.js";import{a as X}from"./chunk-PHYBTFYH.js";import{a as Y}from"./chunk-QID4F4QT.js";import{a as Z}from"./chunk-AZUJCNUP.js";import{a as _}from"./chunk-F3EZ6NQM.js";import{a as $}from"./chunk-DNSXSQCO.js";import{a as oo}from"./chunk-UVAWCZB6.js";import{a as ro}from"./chunk-7EMQYM4A.js";import{a as Q}from"./chunk-A3CPN3V3.js";import{a as P}from"./chunk-EPZOLJ72.js";import{a as R}from"./chunk-4YJCXB4Y.js";import{a as S}from"./chunk-46GBCFAG.js";import{a as T}from"./chunk-NDZHL7TS.js";import{a as V}from"./chunk-R5ZG4R5L.js";import{a as U}from"./chunk-BY7H5COY.js";import{a as W}from"./chunk-VGOZYUH3.js";import{a as I}from"./chunk-6HDZ5MBT.js";import{a as J}from"./chunk-P5SZ4PXO.js";import{a as K}from"./chunk-65GY7S4U.js";import{a as L}from"./chunk-QEPOLOSH.js";import{a as M}from"./chunk-EMC6CON4.js";import{a as N}from"./chunk-AX5O7BNT.js";import{a as O}from"./chunk-7ERLIBAL.js";import{a as z}from"./chunk-SHEET7PF.js";import{a as A}from"./chunk-LNBMZUOM.js";import{a as C}from"./chunk-YNWN6VKC.js";import{a as D}from"./chunk-GHJ6ICLU.js";import{a as E}from"./chunk-3A5UOUAH.js";import{a as F}from"./chunk-RBENSFJD.js";import{a as G}from"./chunk-NZMN2PA5.js";import"./chunk-5SAUYUEK.js";import{a as H}from"./chunk-CMLEUN6Z.js";import{a}from"./chunk-AFO7BV2X.js";import{a as g}from"./chunk-HTYL3XQS.js";import"./chunk-QNK2WMNL.js";import"./chunk-YYEJOSR3.js";import"./chunk-7KBK2RWQ.js";import{a as b}from"./chunk-AFLCNPZB.js";import{a as h}from"./chunk-HW7P5ZFZ.js";import{a as j}from"./chunk-BUJTXQXW.js";import{a as k}from"./chunk-2VBBLHTV.js";import{a as l}from"./chunk-MPQ2QXOP.js";import{a as q}from"./chunk-BQT4FWHH.js";import{a as v}from"./chunk-2RIB46MQ.js";import{a as d}from"./chunk-7FMUBMHT.js";import{a as i}from"./chunk-A2PAJNYA.js";import{a as s}from"./chunk-T5XG33UI.js";import{a as w}from"./chunk-ENPSKQUH.js";import{a as u}from"./chunk-PRI7GNFW.js";import{a as y}from"./chunk-6VSPLMEZ.js";import"./chunk-VEZP7VBA.js";import{a as c}from"./chunk-LSSVVDEJ.js";import"./chunk-YK4IY5DJ.js";import{a as B}from"./chunk-XXNSQDJF.js";import{a as r}from"./chunk-3ZQNA333.js";import{a as e}from"./chunk-AOSBQ3GE.js";import{a as t}from"./chunk-KVO54AJZ.js";import{a as f}from"./chunk-2Y7RBPNW.js";import{a as p}from"./chunk-7DI34UJJ.js";import"./chunk-MBNDHLAB.js";import{a as x}from"./chunk-TW3AOKT4.js";import{a as m}from"./chunk-LDSQEYGI.js";import{a as n}from"./chunk-DDJKFY7F.js";import{a as o}from"./chunk-ENYMRDJU.js";import"./chunk-K2EX7PYH.js";var Xr=typeof window<"u";export{go as KEY_CODES,e as add,r as addProp,t as allPass,f as anyPass,p as ceil,x as chunk,m as clamp,n as clone,d as concat,i as conditional,s as constant,o as curry,w as debounce,y as difference,u as differenceWith,B as divide,a as doNothing,l as drop,g as dropFirstBy,j as dropLast,h as dropLastWhile,k as dropWhile,q as entries,v as evolve,z as filter,E as find,A as findIndex,D as findLast,C as findLastIndex,G as first,F as firstBy,I as flat,H as flatMap,J as floor,L as forEach,K as forEachObj,M as fromEntries,N as fromKeys,O as groupBy,b as hasAtLeast,Q as hasSubObject,R as humanReadableFileSize,S as identity,T as indexBy,U as intersection,V as intersectionWith,W as invert,X as isArray,Y as isBigInt,Z as isBoolean,Xr as isBrowser,_ as isDate,P as isDeepEqual,$ as isDefined,oo as isEmpty,ro as isError,eo as isFunction,to as isIncludedIn,fo as isNonNull,po as isNonNullish,xo as isNot,mo as isNullish,no as isNumber,io as isObjectType,so as isPlainObject,wo as isPromise,co as isShallowEqual,uo as isStrictEqual,yo as isString,Bo as isSymbol,ao as isTruthy,bo as join,ho as keys,jo as last,ko as length,lo as map,qo as mapKeys,vo as mapToObj,zo as mapValues,Ao as mapWithFeedback,Co as meanBy,Do as merge,Eo as mergeAll,Fo as mergeDeep,Go as multiply,Ho as nthBy,Io as objOf,Jo as omit,Ko as omitBy,Lo as once,Mo as only,No as partition,Oo as pathOr,Po as pick,Qo as pickBy,c as pipe,Ro as piped,So as product,To as prop,Uo as propImplementation,Vo as pullObject,Wo as randomInteger,Xo as randomString,Yo as range,Zo as rankBy,_o as reduce,$o as reverse,or as round,rr as sample,er as set,tr as setPath,fr as setPathImplementation,pr as shuffle,xr as sleep,mr as sliceString,nr as slugify,dr as sort,ir as sortBy,sr as sortedIndex,wr as sortedIndexBy,cr as sortedIndexWith,ur as sortedLastIndex,yr as sortedLastIndexBy,Br as splice,ar as split,br as splitAt,gr as splitWhen,hr as stringToPath,jr as subtract,kr as sum,lr as sumBy,qr as swapIndices,vr as swapProps,zr as take,Ar as takeFirstBy,Cr as takeLast,Dr as takeLastWhile,Er as takeWhile,Fr as tap,Gr as times,Hr as toCamelCase,Ir as toCapitalCase,Jr as toConstantCase,Lr as toKebabCase,Kr as toNoCase,Mr as toPascalCase,Nr as toPascalSnakeCase,Or as toSentenceCase,Pr as toSnakeCase,Qr as toTrainCase,Rr as unique,Sr as uniqueBy,Tr as uniqueWith,Ur as values,Vr as zip,Wr as zipWith};
1
+ import{a as Ur}from"./chunk-NLFMCMRF.js";import{a as Vr}from"./chunk-ONHSFOMY.js";import{a as Tr}from"./chunk-EF5X6QTJ.js";import{a as Wr}from"./chunk-LG6MCIRY.js";import{a as Yr}from"./chunk-NUWRLWTO.js";import{a as Xr}from"./chunk-QF7NW7HB.js";import{a as Lr}from"./chunk-EYPNBGK5.js";import{a as Nr}from"./chunk-L4ZCRIBG.js";import{a as Or}from"./chunk-ZIGQWNCG.js";import{a as Pr}from"./chunk-OT55MXTZ.js";import{a as Qr}from"./chunk-L4S5OAPG.js";import{a as Rr}from"./chunk-5OPUQ5T6.js";import{a as Mr}from"./chunk-MFSRIHWE.js";import{a as Sr}from"./chunk-RW5FFMRB.js";import{a as Er}from"./chunk-X5D4U2SM.js";import{a as Gr}from"./chunk-DYTMLSGO.js";import{a as Cr}from"./chunk-KN4W6OD3.js";import{a as Hr}from"./chunk-HI5HNTZE.js";import{a as Ir}from"./chunk-5BVIP7QQ.js";import{a as Jr}from"./chunk-ZAZDS3SB.js";import{a as Kr}from"./chunk-CQ7LGCRX.js";import"./chunk-MZEHWQF3.js";import{a as kr}from"./chunk-CZLV6ZLZ.js";import{a as lr}from"./chunk-QDVSGYJD.js";import{a as vr}from"./chunk-2ZDGLSFC.js";import{a as qr}from"./chunk-V2A3F3I4.js";import{a as zr}from"./chunk-CII3USNE.js";import{a as Ar}from"./chunk-QI5SZK45.js";import{a as Dr}from"./chunk-SB72SOA2.js";import{a as Fr}from"./chunk-RYG2DHC3.js";import{a as yr}from"./chunk-TWWU2V2W.js";import{a as cr}from"./chunk-24TP4E2P.js";import{a as ar}from"./chunk-4WJ75PJB.js";import{a as Br}from"./chunk-37JFJJRL.js";import{a as br}from"./chunk-I2WOF7PP.js";import{a as hr}from"./chunk-2Y6BV2AH.js";import{a as jr}from"./chunk-NWX42UEX.js";import{a as gr}from"./chunk-RBODUO3Q.js";import{a as pr}from"./chunk-OOJU5HRX.js";import{a as nr}from"./chunk-JYFYY7NT.js";import{a as dr}from"./chunk-FGVDZJ7U.js";import{a as ir}from"./chunk-XSSRBOMF.js";import{a as wr}from"./chunk-2GPOH4MN.js";import{a as sr}from"./chunk-3UB2RIEU.js";import{a as ur}from"./chunk-ATE3F5N2.js";import"./chunk-JZ463SIK.js";import{a as _o}from"./chunk-JOTWEYDR.js";import{a as $o}from"./chunk-OW5U2BI2.js";import{a as or}from"./chunk-G57ZPKMR.js";import{a as rr}from"./chunk-2IZU6WD5.js";import{a as er}from"./chunk-V6HQDVID.js";import{a as tr}from"./chunk-XCB6Q73P.js";import{a as fr}from"./chunk-5JB2UNJV.js";import{a as xr,b as mr}from"./chunk-6UDUSN46.js";import{a as To}from"./chunk-JTEBK6CE.js";import{a as So}from"./chunk-32CXKACC.js";import{a as Uo}from"./chunk-RLO65MYN.js";import{a as Vo}from"./chunk-7UGK4BYN.js";import{a as Wo,b as Xo}from"./chunk-ETVIOWIV.js";import{a as Yo}from"./chunk-XIC3HU42.js";import{a as Zo}from"./chunk-I2Z6A55T.js";import{a as Ko}from"./chunk-UDSRBKNR.js";import{a as Lo}from"./chunk-FQQ7JL2Z.js";import{a as No}from"./chunk-AE3CGQUB.js";import{a as Mo}from"./chunk-UKXOFPA6.js";import{a as Oo}from"./chunk-C6IMN7SF.js";import{a as Po}from"./chunk-TJCE2J3B.js";import{a as Qo}from"./chunk-HZNODTV6.js";import{a as Ro}from"./chunk-HF5OFI3W.js";import{a as Do}from"./chunk-FBGRS3MN.js";import{a as Eo}from"./chunk-XL4J54XF.js";import{a as zo}from"./chunk-5RDW3Z6T.js";import{a as Fo}from"./chunk-72XBT2YD.js";import{a as Ho}from"./chunk-7P7RJIIO.js";import{a as Io}from"./chunk-PQTXQYXP.js";import{a as Go}from"./chunk-T4EXOJCT.js";import{a as Jo}from"./chunk-JJ5JH3YT.js";import{a as ho}from"./chunk-RFHE6DOJ.js";import{a as jo}from"./chunk-RFNOAVDK.js";import{a as ko}from"./chunk-BQA4B5JX.js";import{a as lo}from"./chunk-7TAKH2LO.js";import{a as qo}from"./chunk-N2IZRL36.js";import{a as vo}from"./chunk-7DBLJJ5X.js";import{a as Ao}from"./chunk-QSH3UEIB.js";import{a as Co}from"./chunk-Y5CMISVL.js";import{a as wo}from"./chunk-Q2HW4RVT.js";import{a as co}from"./chunk-EBS4GCKX.js";import{a as uo}from"./chunk-6AFNPQW2.js";import{a as yo}from"./chunk-HFNVS6OX.js";import{a as Bo}from"./chunk-OAHCRUJ7.js";import{a as ao}from"./chunk-5ZDIGGAT.js";import{a as bo}from"./chunk-UYLVIAK4.js";import{a as go}from"./chunk-YBJMFRB6.js";import{a as to}from"./chunk-UVAWCZB6.js";import{a as fo}from"./chunk-7EMQYM4A.js";import{a as po}from"./chunk-VPHS3T3W.js";import{a as xo}from"./chunk-75K2QEB3.js";import{a as mo}from"./chunk-6BKLAQWR.js";import{a as no}from"./chunk-QPP664N4.js";import{a as io}from"./chunk-G73S4IVJ.js";import{a as so}from"./chunk-3I7FLADN.js";import{a as X}from"./chunk-BY7H5COY.js";import{a as Z}from"./chunk-VGOZYUH3.js";import{a as _}from"./chunk-PHYBTFYH.js";import{a as $}from"./chunk-QID4F4QT.js";import{a as oo}from"./chunk-AZUJCNUP.js";import{a as ro}from"./chunk-F3EZ6NQM.js";import{a as eo}from"./chunk-DNSXSQCO.js";import{a as S}from"./chunk-7ERLIBAL.js";import{a as U}from"./chunk-A3CPN3V3.js";import{a as T}from"./chunk-EPZOLJ72.js";import{a as V}from"./chunk-4YJCXB4Y.js";import{a as W}from"./chunk-NDZHL7TS.js";import{a as Y}from"./chunk-R5ZG4R5L.js";import{a as I}from"./chunk-CMLEUN6Z.js";import{a as J}from"./chunk-6HDZ5MBT.js";import{a as K}from"./chunk-P5SZ4PXO.js";import{a as L}from"./chunk-65GY7S4U.js";import{a as M}from"./chunk-QEPOLOSH.js";import{a as N}from"./chunk-EMC6CON4.js";import{a as O}from"./chunk-AX5O7BNT.js";import{a as Q}from"./chunk-46GBCFAG.js";import{a as R}from"./chunk-6SYP2DRD.js";import{a as P}from"./chunk-AWXJSK4F.js";import{a as z}from"./chunk-2RIB46MQ.js";import{a as A}from"./chunk-SHEET7PF.js";import{a as C}from"./chunk-LNBMZUOM.js";import{a as D}from"./chunk-YNWN6VKC.js";import{a as E}from"./chunk-GHJ6ICLU.js";import{a as F}from"./chunk-3A5UOUAH.js";import{a as G}from"./chunk-RBENSFJD.js";import{a as H}from"./chunk-NZMN2PA5.js";import"./chunk-5SAUYUEK.js";import{a}from"./chunk-XXNSQDJF.js";import{a as b}from"./chunk-AFO7BV2X.js";import{a as h}from"./chunk-HTYL3XQS.js";import"./chunk-QNK2WMNL.js";import"./chunk-YYEJOSR3.js";import"./chunk-7KBK2RWQ.js";import{a as g}from"./chunk-AFLCNPZB.js";import{a as j}from"./chunk-HW7P5ZFZ.js";import{a as k}from"./chunk-BUJTXQXW.js";import{a as l}from"./chunk-2VBBLHTV.js";import{a as q}from"./chunk-MPQ2QXOP.js";import{a as v}from"./chunk-BQT4FWHH.js";import{a as d}from"./chunk-7FMUBMHT.js";import{a as i}from"./chunk-A2PAJNYA.js";import{a as s}from"./chunk-T5XG33UI.js";import{a as w}from"./chunk-C3NLWEGJ.js";import{a as c}from"./chunk-ENPSKQUH.js";import{a as y}from"./chunk-PRI7GNFW.js";import{a as B}from"./chunk-6VSPLMEZ.js";import"./chunk-VEZP7VBA.js";import{a as u}from"./chunk-LSSVVDEJ.js";import"./chunk-YK4IY5DJ.js";import{a as r}from"./chunk-3ZQNA333.js";import{a as e}from"./chunk-AOSBQ3GE.js";import{a as t}from"./chunk-KVO54AJZ.js";import{a as f}from"./chunk-2Y7RBPNW.js";import{a as p}from"./chunk-7DI34UJJ.js";import"./chunk-MBNDHLAB.js";import{a as x}from"./chunk-CUCNZMQN.js";import{a as m}from"./chunk-LDSQEYGI.js";import{a as n}from"./chunk-DDJKFY7F.js";import{a as o}from"./chunk-ENYMRDJU.js";import"./chunk-K2EX7PYH.js";var Zr=typeof window<"u";export{ko as KEY_CODES,e as add,r as addProp,t as allPass,f as anyPass,p as ceil,x as chunk,m as clamp,n as clone,d as concat,i as conditional,s as constant,w as countBy,o as curry,c as debounce,B as difference,y as differenceWith,a as divide,b as doNothing,q as drop,h as dropFirstBy,k as dropLast,j as dropLastWhile,l as dropWhile,v as entries,z as evolve,A as filter,F as find,C as findIndex,E as findLast,D as findLastIndex,H as first,G as firstBy,J as flat,I as flatMap,K as floor,M as forEach,L as forEachObj,N as fromEntries,O as fromKeys,P as funnel,S as groupBy,g as hasAtLeast,U as hasSubObject,V as humanReadableFileSize,Q as identity,W as indexBy,X as intersection,Y as intersectionWith,Z as invert,_ as isArray,$ as isBigInt,oo as isBoolean,Zr as isBrowser,ro as isDate,T as isDeepEqual,eo as isDefined,to as isEmpty,fo as isError,po as isFunction,xo as isIncludedIn,mo as isNonNull,no as isNonNullish,io as isNot,so as isNullish,wo as isNumber,co as isObjectType,uo as isPlainObject,yo as isPromise,Bo as isShallowEqual,ao as isStrictEqual,bo as isString,go as isSymbol,ho as isTruthy,jo as join,lo as keys,qo as last,vo as length,zo as map,Ao as mapKeys,Co as mapToObj,Do as mapValues,Eo as mapWithFeedback,Fo as meanBy,Go as merge,Ho as mergeAll,Io as mergeDeep,Jo as multiply,Ko as nthBy,Lo as objOf,Mo as omit,No as omitBy,Oo as once,Po as only,Qo as partition,Ro as pathOr,So as pick,To as pickBy,u as pipe,Uo as piped,Vo as product,Wo as prop,Xo as propImplementation,Yo as pullObject,Zo as randomInteger,_o as randomString,$o as range,or as rankBy,rr as reduce,er as reverse,tr as round,fr as sample,pr as set,xr as setPath,mr as setPathImplementation,nr as shuffle,R as sleep,dr as sliceString,ir as slugify,sr as sort,wr as sortBy,cr as sortedIndex,ur as sortedIndexBy,yr as sortedIndexWith,Br as sortedLastIndex,ar as sortedLastIndexBy,br as splice,gr as split,hr as splitAt,jr as splitWhen,kr as stringToPath,lr as subtract,qr as sum,vr as sumBy,zr as swapIndices,Ar as swapProps,Cr as take,Dr as takeFirstBy,Er as takeLast,Fr as takeLastWhile,Gr as takeWhile,Hr as tap,Ir as times,Jr as toCamelCase,Kr as toCapitalCase,Lr as toConstantCase,Nr as toKebabCase,Mr as toNoCase,Or as toPascalCase,Pr as toPascalSnakeCase,Qr as toSentenceCase,Rr as toSnakeCase,Sr as toTrainCase,Tr as unique,Ur as uniqueBy,Vr as uniqueWith,Wr as values,Xr as zip,Yr as zipWith};
@@ -0,0 +1,12 @@
1
+ import { IntRange } from 'type-fest';
2
+
3
+ /**
4
+ * Type fest offers IntClosedRange which is a similar offering, but is
5
+ * implemented in a way which makes it inefficient when the Step size is '1'
6
+ * (as in our case). Their implementation can cause ts(2589) errors ('Type
7
+ * instantiation is excessively deep and possibly infinite') errors when the
8
+ * integers are large (even when the range itself is not).
9
+ */
10
+ type IntRangeInclusive<From extends number, To extends number> = IntRange<From, To> | To;
11
+
12
+ export type { IntRangeInclusive as I };
@@ -0,0 +1,12 @@
1
+ import { IntRange } from 'type-fest';
2
+
3
+ /**
4
+ * Type fest offers IntClosedRange which is a similar offering, but is
5
+ * implemented in a way which makes it inefficient when the Step size is '1'
6
+ * (as in our case). Their implementation can cause ts(2589) errors ('Type
7
+ * instantiation is excessively deep and possibly infinite') errors when the
8
+ * integers are large (even when the range itself is not).
9
+ */
10
+ type IntRangeInclusive<From extends number, To extends number> = IntRange<From, To> | To;
11
+
12
+ export type { IntRangeInclusive as I };
package/dist/prop.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkWP5D3YAQcjs = require('./chunk-WP5D3YAQ.cjs');require('./chunk-4MAOF3ZP.cjs');require('./chunk-4YUDBZFA.cjs');exports.prop = _chunkWP5D3YAQcjs.a; exports.propImplementation = _chunkWP5D3YAQcjs.b;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkYNCQNUT4cjs = require('./chunk-YNCQNUT4.cjs');require('./chunk-4MAOF3ZP.cjs');require('./chunk-4YUDBZFA.cjs');exports.prop = _chunkYNCQNUT4cjs.a; exports.propImplementation = _chunkYNCQNUT4cjs.b;
package/dist/prop.d.cts CHANGED
@@ -23,6 +23,7 @@ declare function prop<T, K extends keyof T>(data: T, key: K): T[K];
23
23
  * @category Object
24
24
  */
25
25
  declare function prop<T, K extends keyof T>(key: K): (data: T) => T[K];
26
+ declare function prop<K extends PropertyKey>(key: K): <T extends Partial<Record<K, unknown>>>(data: T) => T[K];
26
27
  declare function propImplementation<T, K extends keyof T>(data: T, key: K): T[K];
27
28
 
28
29
  export { prop, propImplementation };
package/dist/prop.d.ts CHANGED
@@ -23,6 +23,7 @@ declare function prop<T, K extends keyof T>(data: T, key: K): T[K];
23
23
  * @category Object
24
24
  */
25
25
  declare function prop<T, K extends keyof T>(key: K): (data: T) => T[K];
26
+ declare function prop<K extends PropertyKey>(key: K): <T extends Partial<Record<K, unknown>>>(data: T) => T[K];
26
27
  declare function propImplementation<T, K extends keyof T>(data: T, key: K): T[K];
27
28
 
28
29
  export { prop, propImplementation };
package/dist/prop.js CHANGED
@@ -1 +1 @@
1
- import{a,b}from"./chunk-HE3Z4UIX.js";import"./chunk-ENYMRDJU.js";import"./chunk-K2EX7PYH.js";export{a as prop,b as propImplementation};
1
+ import{a,b}from"./chunk-ETVIOWIV.js";import"./chunk-ENYMRDJU.js";import"./chunk-K2EX7PYH.js";export{a as prop,b as propImplementation};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkIOSBDH5Jcjs = require('./chunk-IOSBDH5J.cjs');exports.randomInteger = _chunkIOSBDH5Jcjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkSJMGQLYScjs = require('./chunk-SJMGQLYS.cjs');exports.randomInteger = _chunkSJMGQLYScjs.a;
@@ -1,6 +1,7 @@
1
- import { Or, IsNever, NonNegativeInteger, IsEqual, GreaterThan, GreaterThanOrEqual, IntRange } from 'type-fest';
1
+ import { Or, IsNever, NonNegativeInteger, IsEqual, GreaterThan, GreaterThanOrEqual } from 'type-fest';
2
+ import { I as IntRangeInclusive } from './int-range-inclusive-Cn-qsrAN.cjs';
2
3
 
3
- type RandomInteger<From extends number, To extends number> = Or<IsNever<NonNegativeInteger<From>>, IsNever<NonNegativeInteger<To>>> extends true ? number : IsEqual<From, To> extends true ? From : GreaterThan<From, To> extends true ? never : GreaterThanOrEqual<To, 1000> extends true ? number : IntRange<From, To> | To;
4
+ type RandomInteger<From extends number, To extends number> = Or<IsNever<NonNegativeInteger<From>>, IsNever<NonNegativeInteger<To>>> extends true ? number : IsEqual<From, To> extends true ? From : GreaterThan<From, To> extends true ? never : GreaterThanOrEqual<To, 1000> extends true ? number : IntRangeInclusive<From, To>;
4
5
  /**
5
6
  * Generate a random integer between `from` and `to` (inclusive).
6
7
  *
@@ -1,6 +1,7 @@
1
- import { Or, IsNever, NonNegativeInteger, IsEqual, GreaterThan, GreaterThanOrEqual, IntRange } from 'type-fest';
1
+ import { Or, IsNever, NonNegativeInteger, IsEqual, GreaterThan, GreaterThanOrEqual } from 'type-fest';
2
+ import { I as IntRangeInclusive } from './int-range-inclusive-Cn-qsrAN.js';
2
3
 
3
- type RandomInteger<From extends number, To extends number> = Or<IsNever<NonNegativeInteger<From>>, IsNever<NonNegativeInteger<To>>> extends true ? number : IsEqual<From, To> extends true ? From : GreaterThan<From, To> extends true ? never : GreaterThanOrEqual<To, 1000> extends true ? number : IntRange<From, To> | To;
4
+ type RandomInteger<From extends number, To extends number> = Or<IsNever<NonNegativeInteger<From>>, IsNever<NonNegativeInteger<To>>> extends true ? number : IsEqual<From, To> extends true ? From : GreaterThan<From, To> extends true ? never : GreaterThanOrEqual<To, 1000> extends true ? number : IntRangeInclusive<From, To>;
4
5
  /**
5
6
  * Generate a random integer between `from` and `to` (inclusive).
6
7
  *
@@ -1 +1 @@
1
- import{a}from"./chunk-QT66COHU.js";export{a as randomInteger};
1
+ import{a}from"./chunk-I2Z6A55T.js";export{a as randomInteger};
@@ -35,7 +35,7 @@ type SwappedIndices<T extends IterableContainer | string, K1 extends number, K2
35
35
  * swapIndices(data, index1, index2)
36
36
  * @example
37
37
  * swapIndices(['a', 'b', 'c'], 0, 1) // => ['b', 'a', 'c']
38
- * swapIndices(['a', 'b', 'c'], 1, -1) // => ['c', 'b', 'a']
38
+ * swapIndices(['a', 'b', 'c'], 1, -1) // => ['a', 'c', 'b']
39
39
  * swapIndices('abc', 0, 1) // => 'bac'
40
40
  * @dataFirst
41
41
  * @category Array
@@ -35,7 +35,7 @@ type SwappedIndices<T extends IterableContainer | string, K1 extends number, K2
35
35
  * swapIndices(data, index1, index2)
36
36
  * @example
37
37
  * swapIndices(['a', 'b', 'c'], 0, 1) // => ['b', 'a', 'c']
38
- * swapIndices(['a', 'b', 'c'], 1, -1) // => ['c', 'b', 'a']
38
+ * swapIndices(['a', 'b', 'c'], 1, -1) // => ['a', 'c', 'b']
39
39
  * swapIndices('abc', 0, 1) // => 'bac'
40
40
  * @dataFirst
41
41
  * @category Array
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vinicunca/perkakas",
3
3
  "type": "module",
4
- "version": "1.1.0",
4
+ "version": "1.2.2",
5
5
  "description": "Utility for JavaScript and Typescript.",
6
6
  "author": "praburangki<https://github.com/praburangki>",
7
7
  "license": "MIT",
@@ -37,28 +37,28 @@
37
37
  "node": ">=20.0.0"
38
38
  },
39
39
  "dependencies": {
40
- "type-fest": "^4.30.0"
40
+ "type-fest": "^4.31.0"
41
41
  },
42
42
  "devDependencies": {
43
- "@types/node": "^22.10.1",
44
- "@vinicunca/eslint-config": "2.15.1",
43
+ "@types/node": "^22.10.5",
44
+ "@vinicunca/eslint-config": "^2.15.5",
45
45
  "@vitest/coverage-v8": "^2.1.8",
46
- "bumpp": "^9.8.1",
47
- "eslint": "^9.16.0",
48
- "prettier": "^3.4.1",
46
+ "bumpp": "^9.9.2",
47
+ "eslint": "^9.17.0",
48
+ "prettier": "^3.4.2",
49
+ "taze": "^0.18.0",
49
50
  "tsup": "^8.3.5",
50
- "typedoc": "^0.27.2",
51
51
  "typescript": "^5.7.2",
52
52
  "vitest": "^2.1.8"
53
53
  },
54
54
  "scripts": {
55
55
  "build": "tsup",
56
56
  "prepublish": "pnpm run build",
57
- "typedoc": "typedoc --json docs/.vitepress/data/metadata.json",
58
57
  "dev": "pnpm build --watch",
59
58
  "lint": "eslint . --fix",
60
59
  "publish:ci": "pnpm publish --access public --no-git-checks",
61
60
  "release": "bumpp package.json",
61
+ "taze": "taze major -wIr",
62
62
  "test": "tsc --project tsconfig.tests.json && vitest --typecheck.enabled --typecheck.ignoreSourceErrors",
63
63
  "test:runtime": "tsc --project tsconfig.tests.json && vitest",
64
64
  "test:typing": "vitest --typecheck.only --typecheck.ignoreSourceErrors",
@@ -1 +0,0 @@
1
- import{a as o}from"./chunk-ENYMRDJU.js";function p(...n){return o(r,n)}function r(n,e){return n[e]}export{p as a,r as b};
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});function t(r,n){let e=Math.ceil(r),o=Math.floor(n);if(o<e)throw new RangeError(`randomInt: The range [${r},${n}] contains no integer`);return Math.floor(Math.random()*(o-e+1)+e)}exports.a = t;
@@ -1 +0,0 @@
1
- function t(r,n){let e=Math.ceil(r),o=Math.floor(n);if(o<e)throw new RangeError(`randomInt: The range [${r},${n}] contains no integer`);return Math.floor(Math.random()*(o-e+1)+e)}export{t as a};