@ndriadev/futurable 2.3.5 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +58 -8
- package/README.md +463 -145
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +2915 -143
- package/dist/index.d.mts +2915 -143
- package/dist/index.d.ts +2915 -143
- package/dist/index.mjs +1 -1
- package/package.json +17 -17
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var S=Object.defineProperty,T=(d,t,n)=>t in d?S(d,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):d[t]=n,y=(d,t,n)=>(T(d,typeof t!="symbol"?t+"":t,n),n),u=(d=>(d.PENDING="pending",d.FULFILLED="fulfilled",d.REJECTED="rejected",d))(u||{});class s extends Promise{constructor(t,n){const l=n?null:new AbortController,e=n||l.signal,i=[],c=()=>{for(const a of i)clearTimeout(a)};let o;const h={signal:e,cancel:()=>this.controller?.abort(),onCancel:a=>{o=a},delay:(a,f)=>new s(g=>{i.push(setTimeout(()=>{g(a())},f))},e),sleep:a=>h.delay(()=>{},a),fetch:(a,f)=>new s((g,p)=>{fetch(a,{...f||{},signal:e}).then(w=>g(w)).catch(w=>{w.name!=="AbortError"&&p(w)})},e),futurizable:a=>new s((f,g)=>{a.then(f).catch(g)},e)};let r="pending";const m=new Promise((a,f)=>{if(e.aborted){c();return}else{const g=typeof e.onabort=="function"?e.onabort:()=>{};e.onabort=()=>{g(),c(),r==="pending"&&o&&o()},t(p=>{r="fulfilled",a(p)},p=>{r="rejected",f(p)},h)}});super((a,f)=>{m.then(g=>a(g)).catch(f)}),y(this,"controller"),y(this,"internalSignal"),y(this,"idsTimeout"),this.controller=l,this.internalSignal=e,this.idsTimeout=i}static get[Symbol.species](){return this}get[Symbol.toStringTag](){return"Futurable"}get signal(){return this.internalSignal}clearTimeout(){for(const t of this.idsTimeout)clearTimeout(t)}then(t,n){let l,e;const i=new s((c,o)=>{l=c,e=o},this.internalSignal);return i.controller=this.controller,super.then(c=>{if(this.internalSignal?.aborted){this.clearTimeout();return}try{l(t?t(c):c)}catch(o){e(o)}},c=>{if(this.internalSignal?.aborted){this.clearTimeout();return}try{n?l(n(c)):e(c)}catch(o){e(o)}}),i}catch(t){return this.then(null,t)}finally(t){return this.then(n=>(t(),n),n=>{if(t(),n instanceof Error)throw n;return n})}cancel(){!this.internalSignal?.aborted&&this.controller?.abort()}delay(t,n){let l,e;const i=new s((c,o)=>{l=c,e=o},this.internalSignal);return i.controller=this.controller,this.then(c=>{this.idsTimeout.push(setTimeout(()=>l(t(c)),n))},c=>{e(c)}),i}sleep(t){return this.delay(n=>n,t)}fetch(t,n){let l,e;const i=new s((c,o)=>{l=c,e=o},this.internalSignal);return i.controller=this.controller,this.then(c=>{const o=typeof t=="function"?t(c):t,h={...typeof n=="function"?n(c):n,signal:this.internalSignal};fetch(o,h).then(r=>l(r)).catch(r=>{r.name!=="AbortError"&&e(r)})}),i}onCancel(t){let n,l;const e=new s((i,c,o)=>{o.onCancel(t),n=i,l=c},this.internalSignal);return e.controller=this.controller,this.then(i=>n(i),i=>l(i)),e}futurizable(t){let n,l;const e=new s((i,c)=>{n=i,l=c},this.internalSignal);return e.controller=this.controller,this.then(i=>{(typeof t=="function"?t(i):t).then(n).catch(l)}),e}static resolve(t,n){return t?new s(l=>l(t),n):new s(l=>l(),n)}static reject(t,n){return new s((l,e)=>e(t),n)}static onCancel({cb:t,signal:n}){return new s((l,e,i)=>{i.onCancel(()=>l(t()))},n)}static delay({cb:t,timer:n,signal:l}){return new s((e,i,c)=>{c.delay(t,n).then(e,i)},l)}static sleep({timer:t,signal:n}){return s.delay({cb:()=>{},timer:t,signal:n})}static fetch(t,n){const l=n?.signal||void 0;return n?.signal&&delete n.signal,new s((e,i,c)=>{c.fetch(t,n).then(e).catch(i)},l)}static futurizable({promise:t,signal:n}){return new s((l,e)=>{t.then(l).catch(e)},n)}static handleValues(t,n){const l=[];for(const e in t)t[e]instanceof s?l.push(t[e]):t[e]instanceof Promise?l.push(new s((i,c)=>{t[e].then(o=>i(o)).catch(c)},n)):l.push(new s(i=>i(t[e]),n));return l}static all(t,n){let l,e;const i=new s((o,h,r)=>{l=o,e=h,r.onCancel(()=>{for(const m of c)m.cancel()})},n);n||(n=i.internalSignal);const c=s.handleValues(t,n);return super.all(c).then(o=>l(o)).catch(o=>e(o)),i}static allSettled(t,n){let l;const e=new s((c,o,h)=>{l=c,h.onCancel(()=>{for(const r of i)r.cancel()})},n);n||(n=e.internalSignal);const i=s.handleValues(t,n);return super.allSettled(i).then(c=>l(c)),e}static race(t,n){let l,e;const i=new s((o,h,r)=>{l=o,e=h,r.onCancel(()=>{for(const m of c)m.cancel()})},n);n||(n=i.internalSignal);const c=s.handleValues(t,n);return super.race(c).then(o=>l(o)).catch(o=>e(o)),i}static any(t,n){let l,e;const i=new s((o,h,r)=>{l=o,e=h,r.onCancel(()=>{for(const m of c)m.cancel()})},n);n||(n=i.internalSignal);const c=s.handleValues(t,n);return super.any(c).then(o=>l(o)).catch(o=>e(o)),i}static polling(t,{interval:n,signal:l,immediate:e}){let i,c,o;e&&(i=new s((r,m,a)=>{a.onCancel(()=>{c&&c instanceof s&&c.cancel()});const f=t();(f instanceof s||f instanceof Promise)&&(c=f.then(()=>r()).catch(g=>o&&o(g)))},l));const h=setInterval(()=>{i&&i.cancel(),i=new s((r,m,a)=>{a.onCancel(()=>{c&&c instanceof s&&c.cancel()});const f=t();(f instanceof s||f instanceof Promise)&&(c=f.then(()=>r()).catch(g=>o&&o(g)))},l)},n);return{cancel:()=>{h&&clearInterval(h),i&&i.cancel()},catch:r=>{o=r}}}static withResolvers(t){let n,l,e;const i=new s((o,h,r)=>{n=o,l=h,e=r},t),c=i.cancel;return{resolve:n,reject:l,utils:e,cancel:c,promise:i}}}export{s as Futurable};
|
|
1
|
+
class o extends Promise{controller;internalSignal;idsTimeout;constructor(t,n){const e=new AbortController,i=e.signal,r=[];n&&(n.aborted?e.abort():n.addEventListener("abort",()=>e.abort(),{once:!0}));let s=[];const c=g=>{s.push(g)},a=()=>{for(const g of r)clearTimeout(g);r.length=0},h={signal:i,cancel:()=>e.abort(),onCancel:c,delay:(g,d)=>new o(f=>{r.push(setTimeout(()=>{f(g())},d))},i),sleep:g=>h.delay(()=>{},g),fetch:(g,d)=>new o((f,w)=>{fetch(g,{...d||{},signal:i}).then(u=>f(u)).catch(u=>{u.name!=="AbortError"&&w(u)})},i),futurizable:g=>new o((d,f)=>{g.then(d).catch(f)},i)},m=new Promise((g,d)=>{if(i.aborted){a();return}else{const f=()=>{a(),s.forEach(u=>u()),s=[]},w=()=>{i.removeEventListener("abort",f)};i.addEventListener("abort",f,{once:!0}),t(u=>{w(),g(u)},u=>{w(),d(u)},h)}});super((g,d)=>{m.then(f=>g(f)).catch(d)}),this.controller=e,this.internalSignal=i,this.idsTimeout=r}static get[Symbol.species](){return this}get[Symbol.toStringTag](){return"Futurable"}get signal(){return this.internalSignal}clearTimeout(){for(const t of this.idsTimeout)clearTimeout(t);this.idsTimeout.length=0}then(t,n){let e,i;const r=new o((s,c)=>{e=s,i=c},this.internalSignal);return r.controller=this.controller,super.then(s=>{var c;if((c=this.internalSignal)!=null&&c.aborted){this.clearTimeout();return}try{e(t?t(s):s)}catch(a){i(a)}},s=>{var c;if((c=this.internalSignal)!=null&&c.aborted){this.clearTimeout();return}try{n?e(n(s)):i(s)}catch(a){i(a)}}),r}catch(t){return this.then(null,t)}finally(t){return this.then(n=>(t(),n),n=>{if(t(),n instanceof Error)throw n;return n})}cancel(){var t;!((t=this.internalSignal)!=null&&t.aborted)&&this.controller.abort()}delay(t,n){return this.then(e=>new o(i=>{this.idsTimeout.push(setTimeout(()=>i(t(e)),n))},this.internalSignal))}sleep(t){return this.delay(n=>n,t)}fetch(t,n){return this.then(e=>{const i=typeof t=="function"?t(e):t,r={...typeof n=="function"?n(e):n,signal:this.internalSignal};return new o((s,c)=>{fetch(i,r).then(s).catch(a=>{a.name!=="AbortError"&&c(a)})})})}onCancel(t){const n=new o((e,i,r)=>{r.onCancel(t),this.then(s=>e(s),s=>i(s))},this.internalSignal);return n.controller=this.controller,n}futurizable(t){return this.then(n=>{const e=typeof t=="function"?t(n):t;return new o((i,r)=>{e.then(i).catch(r)},this.internalSignal)})}safe(){return this.then(t=>({success:!0,data:t,error:null}),t=>({success:!1,data:null,error:t}))}static resolve(t,n){return t?new o(e=>e(t),n):new o(e=>e(),n)}static reject(t,n){return new o((e,i)=>i(t),n)}static onCancel({cb:t,signal:n}){return new o((e,i,r)=>{r.onCancel(()=>e(t()))},n)}static delay({cb:t,timer:n,signal:e}){return new o((i,r,s)=>{s.delay(t,n).then(i,r)},e)}static sleep({timer:t,signal:n}){return o.delay({cb:()=>{},timer:t,signal:n})}static fetch(t,n){const e=(n==null?void 0:n.signal)||void 0;return n!=null&&n.signal&&delete n.signal,new o((i,r,s)=>{s.fetch(t,n).then(i).catch(r)},e)}static futurizable({promise:t,signal:n}){return new o((e,i)=>{t.then(e).catch(i)},n)}static handleValues(t,n){const e=[];for(const i of t)i instanceof o?e.push(i):i instanceof Promise?e.push(new o((r,s)=>{i.then(c=>r(c)).catch(s)},n)):e.push(new o(r=>r(i),n));return e}static all(t,n){let e,i;const r=new o((c,a,h)=>{e=c,i=a,h.onCancel(()=>{for(const m of s)m.cancel()})},n);n||=r.internalSignal;const s=o.handleValues(t,n);return super.all(s).then(c=>e(c)).catch(c=>i(c)),r}static allSettled(t,n){let e;const i=new o((s,c,a)=>{e=s,a.onCancel(()=>{for(const h of r)h.cancel()})},n);n||=i.internalSignal;const r=o.handleValues(t,n);return super.allSettled(r).then(s=>e(s)),i}static race(t,n){let e,i;const r=new o((c,a,h)=>{e=c,i=a,h.onCancel(()=>{for(const m of s)m.cancel()})},n);n||=r.internalSignal;const s=o.handleValues(t,n);return super.race(s).then(c=>e(c)).catch(c=>i(c)),r}static any(t,n){let e,i;const r=new o((c,a,h)=>{e=c,i=a,h.onCancel(()=>{for(const m of s)m.cancel()})},n);n||=r.internalSignal;const s=o.handleValues(t,n);return super.any(s).then(c=>e(c)).catch(c=>i(c)),r}static polling(t,{interval:n,signal:e,immediate:i}){let r,s;const c=[];let a=g=>{c.push(g)};const h=()=>{r&&r.cancel(),r=new o((g,d,f)=>{f.onCancel(()=>{s&&s instanceof o&&s.cancel()});try{const w=t();w instanceof o||w instanceof Promise?s=w.then(()=>g()).catch(u=>{a(u)}):g()}catch(w){a(w)}},e)};i&&h();const m=setInterval(h,n);return{cancel:()=>{m&&clearInterval(m),r&&r.cancel(),s&&s instanceof o&&s.cancel()},catch:g=>{a=g,c.length>0&&(c.forEach(d=>g(d)),c.length=0)}}}static withResolvers(t){let n,e,i;const r=new o((c,a,h)=>{n=c,e=a,i=h},t),s=r.cancel.bind(r);return{resolve:n,reject:e,utils:i,cancel:s,promise:r}}static safe(t,n){return new o(t,n).safe()}}class l{constructor(t,n){this.executor=t,this.controller=new AbortController,this.controller.signal.addEventListener("abort",()=>{this.cancelCallbacks.forEach(e=>e())},{once:!0}),n&&(n.aborted?this.controller.abort():n.addEventListener("abort",()=>this.controller.abort(),{once:!0}))}controller;cancelCallbacks=[];memoizeOptions={enabled:!1,catchErrors:!1};sourceTask;get signal(){return this.controller.signal}cancel(){this.controller.signal.aborted||this.controller.abort()}onCancel(t){return this.cancelCallbacks.push(t),this}run(t){if(this.memoizeOptions.enabled&&this.memoizeOptions.instance)if(this.memoizeOptions.instance.signal.aborted)delete this.memoizeOptions.instance;else return this.memoizeOptions.instance;const n=new AbortController;this.signal.aborted?n.abort():this.signal.addEventListener("abort",()=>n.abort(),{once:!0}),t&&(t.aborted?n.abort():t.addEventListener("abort",()=>n.abort(),{once:!0}));const e=new o(this.executor,n.signal);return this.memoizeOptions.enabled&&(this.memoizeOptions.instance=e,this.memoizeOptions.catchErrors||e.catch(()=>{delete this.memoizeOptions.instance})),e}runSafe(t){return this.run(t).safe()}memoize(t){const n=new l(this.executor,this.signal);return n.memoizeOptions.enabled=!0,n.memoizeOptions.catchErrors=t,n}map(t){return new l((n,e,i)=>{this.run(i.signal).then(r=>n(t(r,i.signal))).catch(e)},this.signal)}flatMap(t){return new l((n,e,i)=>{this.run(i.signal).then(r=>{t(r).run(i.signal).then(n).catch(e)}).catch(e)},this.signal)}andThen(t){return this.flatMap(()=>t)}tap(t){return this.map(async n=>(await t(n),n))}tapError(t){return new l((n,e,i)=>{this.run(i.signal).then(n).catch(async r=>{try{await t(r)}catch(s){console.error("tapError callback failed: ",s)}e(r)})},this.signal)}catchError(t){return new l((n,e,i)=>{this.run(i.signal).then(n).catch(r=>{t(r).run(i.signal).then(n).catch(e)})},this.signal)}orElse(t){return new l((n,e,i)=>{this.run(i.signal).then(n).catch(r=>{t(r).run(i.signal).then(n).catch(e)})},this.signal)}fallbackTo(t){return this.orElse(()=>l.resolve(t))}ifElse(t,n,e){return new l((i,r,s)=>{this.run(s.signal).then(async c=>{(await t(c)?n(c):e(c)).run(s.signal).then(i).catch(r)}).catch(r)},this.signal)}fold(t,n){return new l((e,i,r)=>{this.run(r.signal).then(s=>{n(s).run(r.signal).then(e).catch(i)}).catch(s=>{t(s).run(r.signal).then(e).catch(i)})},this.signal)}finally(t){return new l((n,e,i)=>{this.run(i.signal).then(async r=>{await t(),n(r)}).catch(async r=>{await t(),e(r)})},this.signal)}timeout(t,n="TimeoutExceeded"){return new l((e,i,r)=>{const s=setTimeout(()=>{c.cancel(),i(n)},t),c=this.run(r.signal);r.onCancel(()=>{clearTimeout(s)}),c.then(a=>{clearTimeout(s),e(a)}).catch(a=>{clearTimeout(s),i(a)})},this.signal)}delay(t){return new l(async(n,e,i)=>{await i.sleep(t),this.run(i.signal).then(n).catch(e)},this.signal)}retry(t,n=0){return new l(async(e,i,r)=>{let s;for(let c=0;c<=t;c++){if(r.signal.aborted)return;try{return e(await this.run(r.signal))}catch(a){s=a,c<t&&!r.signal.aborted&&n>0&&await r.sleep(n)}}i(s)},this.signal)}debounce(t){const n=this.sourceTask??this;let e=null;const i=new l((r,s,c)=>{c.onCancel(()=>{e&&clearTimeout(e),e=null}),e&&clearTimeout(e),e=setTimeout(()=>{n.run(c.signal).then(r).catch(s).finally(()=>{e=null})},t)},this.signal);return i.sourceTask=n,i}throttle(t){let n=0,e;return new l((i,r,s)=>{const c=Date.now();c-n>=t||!e?(n=c,e=this.run(s.signal),e.then(i).catch(r)):e&&e.then(i).catch(r)},this.signal)}zip(t){return new l((n,e,i)=>{o.all([this.run(i.signal),t.run(i.signal)],i.signal).then(([r,s])=>n([r,s])).catch(e)},this.signal)}zipWith(t,n){return this.zip(t).map(([e,i])=>n(e,i))}bimap(t,n){return new l((e,i,r)=>{this.run(r.signal).then(s=>e(t(s))).catch(s=>i(n(s)))},this.signal)}repeat(t){return l.times(t,()=>this)}pipe(...t){return t.reduce((n,e)=>e(n),this)}fetch(t,n){return new l((e,i,r)=>{this.run(r.signal).then(s=>{const c=typeof t=="function"?t(s):t,a={...typeof n=="function"?n(s):n,signal:r.signal};r.fetch(c,a).then(e).catch(i)}).catch(i)},this.signal)}static of(t,n){return typeof t=="function"?new l(async(e,i,r)=>{try{e(await t(r))}catch(s){i(s)}},n):new l(e=>e(t),n)}static resolve(t,n){return l.of(t,n)}static reject(t,n){return new l((e,i)=>i(t),n)}static all(t,n){return new l((e,i,r)=>{o.all(t.map(s=>s.run(r.signal)),r.signal).then(e).catch(i)},n)}static allSettled(t,n){return new l((e,i,r)=>{o.allSettled(t.map(s=>s.run(r.signal)),r.signal).then(e).catch(i)},n)}static race(t,n){return new l((e,i,r)=>{o.race(t.map(s=>s.run(r.signal)),r.signal).then(e).catch(i)},n)}static any(t,n){return new l((e,i,r)=>{o.any(t.map(s=>s.run(r.signal)),r.signal).then(e).catch(i)},n)}static delay(t,n){return new l((e,i,r)=>{r.sleep(t).then(e).catch(i)},n)}static fromEvent(t,n,e,i){return new l((r,s,c)=>{c.onCancel(()=>t.removeEventListener(n,a));const a=h=>{!(e!=null&&e.once)&&t.removeEventListener(n,a),r(h)};t.addEventListener(n,a,e)},i)}static sequence(t,n){return new l(async(e,i,r)=>{const s=[];try{for(const c of t){if(r.signal.aborted)return;s.push(await c.run(r.signal))}e(s)}catch(c){i(c)}},n)}static parallel(t,n=5,e){return new l(async(i,r,s)=>{const c=new Array(t.length),a=[];let h=0,m=0,g=0;s.onCancel(()=>{a.forEach(f=>f.cancel())});const d=(f,w)=>{if(m===t.length)return f(c);for(;h<n&&g<t.length;){const u=g++;h++;const p=t[u].run(s.signal);a.push(p),p.then(v=>{c[u]=v,h--,m++;const y=a.indexOf(p);y!==-1&&a.splice(y,1),d(f,w)}).catch(v=>{a.forEach(y=>y.cancel()),w(v)})}};d(i,r)},e)}static createLimiter(t,n={},e){let i=0;const r=[],s=()=>{for(var a;i<t&&r.length>0;){const h=r.shift();h&&h()}i===0&&r.length===0&&((a=n.onIdle)==null||a.call(n))},c=a=>new l((h,m,g)=>{let d=!1;const f=()=>{var w;d=!1,i++,(w=n.onActive)==null||w.call(n,a),a.run(g.signal).then(u=>{var p;(p=n.onCompleted)==null||p.call(n,u),h(u)}).catch(u=>{var p;(p=n.onError)==null||p.call(n,u),m(u)}).finally(()=>{i--,s()})};g.onCancel(()=>{if(d){const w=r.indexOf(f);w!==-1&&r.splice(w,1),s()}}),i<t?f():(d=!0,r.push(f))},e);return Object.defineProperties(c,{activeCount:{get:()=>i},pendingCount:{get:()=>r.length},concurrency:{get:()=>t}}),c}static compose(t,...n){return n.reduce((e,i)=>i(e),t)}static filter(t,n,e){return new l(async(i,r,s)=>{const c=[];try{for(const a of t){if(s.signal.aborted)return;const h=await a.run(s.signal);await n(h)&&c.push(h)}i(c)}catch(a){r(a)}},e)}static reduce(t,n,e,i){return new l(async(r,s,c)=>{let a=e;try{for(let h=0;h<t.length;h++){if(c.signal.aborted)return;const m=await t[h].run(c.signal);a=await n(a,m,h)}r(a)}catch(h){s(h)}},i)}static whilst(t,n,e){return new l(async(i,r,s)=>{const c=[];try{for(;await t();){if(s.signal.aborted)return;c.push(await n.run(s.signal))}i(c)}catch(a){r(a)}},e)}static until(t,n,e){return l.whilst(async()=>!await t(),n,e)}static times(t,n,e){return new l(async(i,r,s)=>{const c=[];try{for(let a=0;a<t;a++){if(s.signal.aborted)return;c.push(await n(a).run(s.signal))}i(c)}catch(a){r(a)}},e)}static traverse(t,n,e){return l.sequence(t.map((i,r)=>n(i,r)),e)}static fetch(t,n,e){return new l((i,r,s)=>{const c={...n,signal:s.signal};s.fetch(t,c).then(i).catch(r)},e)}}export{o as Futurable,l as FuturableTask};
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@ndriadev/futurable",
|
|
3
3
|
"description": "JavaScript's Promise and Fetch APIs with superpowers!",
|
|
4
4
|
"private": false,
|
|
5
|
-
"version": "
|
|
5
|
+
"version": "3.0.1",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist/",
|
|
@@ -21,19 +21,19 @@
|
|
|
21
21
|
"module": "./dist/index.mjs",
|
|
22
22
|
"types": "./dist/index.d.ts",
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@eslint/eslintrc": "^3.3.
|
|
25
|
-
"@eslint/js": "^
|
|
26
|
-
"@
|
|
27
|
-
"@
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"prettier": "^3.
|
|
31
|
-
"rimraf": "^6.1.
|
|
32
|
-
"
|
|
33
|
-
"typescript": "^
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
24
|
+
"@eslint/eslintrc": "^3.3.3",
|
|
25
|
+
"@eslint/js": "^10.0.1",
|
|
26
|
+
"@types/node": "^25.3.0",
|
|
27
|
+
"@vitest/coverage-v8": "^4.0.18",
|
|
28
|
+
"@vitest/ui": "^4.0.18",
|
|
29
|
+
"globals": "^17.3.0",
|
|
30
|
+
"prettier": "^3.8.1",
|
|
31
|
+
"rimraf": "^6.1.3",
|
|
32
|
+
"typescript": "^5.9.3",
|
|
33
|
+
"typescript-eslint": "^8.56.0",
|
|
34
|
+
"unbuild": "^3.6.1",
|
|
35
|
+
"vitepress": "^1.6.4",
|
|
36
|
+
"vitest": "^4.0.18"
|
|
37
37
|
},
|
|
38
38
|
"keywords": [
|
|
39
39
|
"promise",
|
|
@@ -74,9 +74,9 @@
|
|
|
74
74
|
"license": "MIT",
|
|
75
75
|
"scripts": {
|
|
76
76
|
"dev": "unbuild --stub",
|
|
77
|
-
"test": "
|
|
78
|
-
"test:
|
|
79
|
-
"test:
|
|
77
|
+
"test": "vitest",
|
|
78
|
+
"test:run": "vitest run",
|
|
79
|
+
"test:coverage": "vitest --coverage",
|
|
80
80
|
"lint": "eslint .",
|
|
81
81
|
"lint:fix": "eslint . --fix",
|
|
82
82
|
"typecheck": "tsc --noEmit",
|