Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@dxos/async

Package Overview
Dependencies
Maintainers
0
Versions
3003
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dxos/async - npm Package Compare versions

Comparing version 0.6.13-main.ed424a1 to 0.6.13-staging.1e988a3

2

dist/lib/browser/meta.json

@@ -1,1 +0,1 @@

{"inputs":{"packages/common/async/src/callback.ts":{"bytes":1594,"imports":[],"format":"esm"},"packages/common/async/src/chain.ts":{"bytes":1701,"imports":[],"format":"esm"},"packages/common/async/src/debounce.ts":{"bytes":1275,"imports":[],"format":"esm"},"packages/common/async/src/errors.ts":{"bytes":3008,"imports":[],"format":"esm"},"packages/common/async/src/timeout.ts":{"bytes":7907,"imports":[{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"packages/common/async/src/callback.ts","kind":"import-statement","original":"./callback"},{"path":"packages/common/async/src/errors.ts","kind":"import-statement","original":"./errors"}],"format":"esm"},"packages/common/async/src/event-emitter.ts":{"bytes":4236,"imports":[{"path":"packages/common/async/src/timeout.ts","kind":"import-statement","original":"./timeout"}],"format":"esm"},"packages/common/async/src/events.ts":{"bytes":37154,"imports":[{"path":"@dxos/context","kind":"import-statement","external":true}],"format":"esm"},"packages/common/async/src/latch.ts":{"bytes":4484,"imports":[{"path":"@dxos/invariant","kind":"import-statement","external":true}],"format":"esm"},"packages/common/async/src/trigger.ts":{"bytes":9868,"imports":[{"path":"packages/common/async/src/errors.ts","kind":"import-statement","original":"./errors"},{"path":"packages/common/async/src/timeout.ts","kind":"import-statement","original":"./timeout"}],"format":"esm"},"packages/common/async/src/observable.ts":{"bytes":18063,"imports":[{"path":"zen-observable","kind":"import-statement","external":true},{"path":"zen-push","kind":"import-statement","external":true},{"path":"packages/common/async/src/trigger.ts","kind":"import-statement","original":"./trigger"}],"format":"esm"},"packages/common/async/src/observable-value.ts":{"bytes":6622,"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"packages/common/async/src/mutex.ts":{"bytes":12860,"imports":[{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true}],"format":"esm"},"packages/common/async/src/sink.ts":{"bytes":2055,"imports":[{"path":"packages/common/async/src/trigger.ts","kind":"import-statement","original":"./trigger"}],"format":"esm"},"packages/common/async/src/stream-to-array.ts":{"bytes":5040,"imports":[],"format":"esm"},"packages/common/async/src/timer.ts":{"bytes":6062,"imports":[{"path":"packages/common/async/src/events.ts","kind":"import-statement","original":"./events"}],"format":"esm"},"packages/common/async/src/testing.ts":{"bytes":4756,"imports":[{"path":"packages/common/async/src/timeout.ts","kind":"import-statement","original":"./timeout"},{"path":"packages/common/async/src/trigger.ts","kind":"import-statement","original":"./trigger"}],"format":"esm"},"packages/common/async/src/types.ts":{"bytes":517,"imports":[],"format":"esm"},"packages/common/async/src/until.ts":{"bytes":4408,"imports":[],"format":"esm"},"packages/common/async/src/track-leaks.ts":{"bytes":8583,"imports":[{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"packages/common/async/src/task-scheduling.ts":{"bytes":15529,"imports":[{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"packages/common/async/src/track-leaks.ts","kind":"import-statement","original":"./track-leaks"},{"path":"packages/common/async/src/trigger.ts","kind":"import-statement","original":"./trigger"}],"format":"esm"},"packages/common/async/src/test-stream.ts":{"bytes":5087,"imports":[{"path":"@dxos/node-std/stream","kind":"import-statement","external":true},{"path":"packages/common/async/src/events.ts","kind":"import-statement","original":"./events"},{"path":"packages/common/async/src/timeout.ts","kind":"import-statement","original":"./timeout"}],"format":"esm"},"packages/common/async/src/update-scheduler.ts":{"bytes":9920,"imports":[{"path":"packages/common/async/src/task-scheduling.ts","kind":"import-statement","original":"./task-scheduling"}],"format":"esm"},"packages/common/async/src/index.ts":{"bytes":2419,"imports":[{"path":"packages/common/async/src/callback.ts","kind":"import-statement","original":"./callback"},{"path":"packages/common/async/src/chain.ts","kind":"import-statement","original":"./chain"},{"path":"packages/common/async/src/debounce.ts","kind":"import-statement","original":"./debounce"},{"path":"packages/common/async/src/errors.ts","kind":"import-statement","original":"./errors"},{"path":"packages/common/async/src/event-emitter.ts","kind":"import-statement","original":"./event-emitter"},{"path":"packages/common/async/src/events.ts","kind":"import-statement","original":"./events"},{"path":"packages/common/async/src/latch.ts","kind":"import-statement","original":"./latch"},{"path":"packages/common/async/src/observable.ts","kind":"import-statement","original":"./observable"},{"path":"packages/common/async/src/observable-value.ts","kind":"import-statement","original":"./observable-value"},{"path":"packages/common/async/src/mutex.ts","kind":"import-statement","original":"./mutex"},{"path":"packages/common/async/src/sink.ts","kind":"import-statement","original":"./sink"},{"path":"packages/common/async/src/stream-to-array.ts","kind":"import-statement","original":"./stream-to-array"},{"path":"packages/common/async/src/timeout.ts","kind":"import-statement","original":"./timeout"},{"path":"packages/common/async/src/timer.ts","kind":"import-statement","original":"./timer"},{"path":"packages/common/async/src/testing.ts","kind":"import-statement","original":"./testing"},{"path":"packages/common/async/src/trigger.ts","kind":"import-statement","original":"./trigger"},{"path":"packages/common/async/src/types.ts","kind":"import-statement","original":"./types"},{"path":"packages/common/async/src/until.ts","kind":"import-statement","original":"./until"},{"path":"packages/common/async/src/task-scheduling.ts","kind":"import-statement","original":"./task-scheduling"},{"path":"packages/common/async/src/test-stream.ts","kind":"import-statement","original":"./test-stream"},{"path":"packages/common/async/src/track-leaks.ts","kind":"import-statement","original":"./track-leaks"},{"path":"packages/common/async/src/update-scheduler.ts","kind":"import-statement","original":"./update-scheduler"}],"format":"esm"}},"outputs":{"packages/common/async/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":83817},"packages/common/async/dist/lib/browser/index.mjs":{"imports":[{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"zen-observable","kind":"import-statement","external":true},{"path":"zen-push","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/node-std/stream","kind":"import-statement","external":true}],"exports":["CancellableObservableProvider","DeferredTask","Event","EventSubscriptions","MulticastObservable","Mutex","MutexGuard","Observable","ObservableProvider","PushStream","TestStream","TimeoutError","Timer","Trigger","TriggerState","UpdateScheduler","addListener","asyncChain","asyncReturn","asyncTimeout","createPromiseFromCallback","debounce","dumpLeaks","latch","observableError","onEvent","runInContext","runInContextAsync","scheduleExponentialBackoffTaskInterval","scheduleMicroTask","scheduleTask","scheduleTaskInterval","sink","sleep","sleepWithContext","streamToArray","synchronized","toError","trackLeaks","trackResource","trigger","unrefTimeout","until","untilError","untilPromise","waitForCondition","waitForEvent"],"entryPoint":"packages/common/async/src/index.ts","inputs":{"packages/common/async/src/callback.ts":{"bytesInOutput":191},"packages/common/async/src/index.ts":{"bytesInOutput":0},"packages/common/async/src/chain.ts":{"bytesInOutput":219},"packages/common/async/src/debounce.ts":{"bytesInOutput":144},"packages/common/async/src/errors.ts":{"bytesInOutput":473},"packages/common/async/src/timeout.ts":{"bytesInOutput":1487},"packages/common/async/src/event-emitter.ts":{"bytesInOutput":694},"packages/common/async/src/events.ts":{"bytesInOutput":7861},"packages/common/async/src/latch.ts":{"bytesInOutput":987},"packages/common/async/src/observable.ts":{"bytesInOutput":3695},"packages/common/async/src/trigger.ts":{"bytesInOutput":1835},"packages/common/async/src/observable-value.ts":{"bytesInOutput":975},"packages/common/async/src/mutex.ts":{"bytesInOutput":2444},"packages/common/async/src/sink.ts":{"bytesInOutput":285},"packages/common/async/src/stream-to-array.ts":{"bytesInOutput":967},"packages/common/async/src/timer.ts":{"bytesInOutput":1054},"packages/common/async/src/testing.ts":{"bytesInOutput":587},"packages/common/async/src/until.ts":{"bytesInOutput":760},"packages/common/async/src/task-scheduling.ts":{"bytesInOutput":3090},"packages/common/async/src/track-leaks.ts":{"bytesInOutput":2149},"packages/common/async/src/test-stream.ts":{"bytesInOutput":935},"packages/common/async/src/update-scheduler.ts":{"bytesInOutput":1855}},"bytes":34492}}}
{"inputs":{"packages/common/async/src/callback.ts":{"bytes":1594,"imports":[],"format":"esm"},"packages/common/async/src/chain.ts":{"bytes":1701,"imports":[],"format":"esm"},"packages/common/async/src/debounce.ts":{"bytes":1275,"imports":[],"format":"esm"},"packages/common/async/src/errors.ts":{"bytes":3008,"imports":[],"format":"esm"},"packages/common/async/src/timeout.ts":{"bytes":7907,"imports":[{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"packages/common/async/src/callback.ts","kind":"import-statement","original":"./callback"},{"path":"packages/common/async/src/errors.ts","kind":"import-statement","original":"./errors"}],"format":"esm"},"packages/common/async/src/event-emitter.ts":{"bytes":4236,"imports":[{"path":"packages/common/async/src/timeout.ts","kind":"import-statement","original":"./timeout"}],"format":"esm"},"packages/common/async/src/events.ts":{"bytes":36125,"imports":[{"path":"@dxos/context","kind":"import-statement","external":true}],"format":"esm"},"packages/common/async/src/latch.ts":{"bytes":4484,"imports":[{"path":"@dxos/invariant","kind":"import-statement","external":true}],"format":"esm"},"packages/common/async/src/trigger.ts":{"bytes":9868,"imports":[{"path":"packages/common/async/src/errors.ts","kind":"import-statement","original":"./errors"},{"path":"packages/common/async/src/timeout.ts","kind":"import-statement","original":"./timeout"}],"format":"esm"},"packages/common/async/src/observable.ts":{"bytes":18063,"imports":[{"path":"zen-observable","kind":"import-statement","external":true},{"path":"zen-push","kind":"import-statement","external":true},{"path":"packages/common/async/src/trigger.ts","kind":"import-statement","original":"./trigger"}],"format":"esm"},"packages/common/async/src/observable-value.ts":{"bytes":6622,"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"packages/common/async/src/mutex.ts":{"bytes":12860,"imports":[{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true}],"format":"esm"},"packages/common/async/src/sink.ts":{"bytes":2055,"imports":[{"path":"packages/common/async/src/trigger.ts","kind":"import-statement","original":"./trigger"}],"format":"esm"},"packages/common/async/src/stream-to-array.ts":{"bytes":5040,"imports":[],"format":"esm"},"packages/common/async/src/timer.ts":{"bytes":6062,"imports":[{"path":"packages/common/async/src/events.ts","kind":"import-statement","original":"./events"}],"format":"esm"},"packages/common/async/src/testing.ts":{"bytes":4756,"imports":[{"path":"packages/common/async/src/timeout.ts","kind":"import-statement","original":"./timeout"},{"path":"packages/common/async/src/trigger.ts","kind":"import-statement","original":"./trigger"}],"format":"esm"},"packages/common/async/src/types.ts":{"bytes":517,"imports":[],"format":"esm"},"packages/common/async/src/until.ts":{"bytes":4408,"imports":[],"format":"esm"},"packages/common/async/src/track-leaks.ts":{"bytes":8583,"imports":[{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"packages/common/async/src/task-scheduling.ts":{"bytes":15525,"imports":[{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"packages/common/async/src/track-leaks.ts","kind":"import-statement","original":"./track-leaks"},{"path":"packages/common/async/src/trigger.ts","kind":"import-statement","original":"./trigger"}],"format":"esm"},"packages/common/async/src/test-stream.ts":{"bytes":5087,"imports":[{"path":"@dxos/node-std/stream","kind":"import-statement","external":true},{"path":"packages/common/async/src/events.ts","kind":"import-statement","original":"./events"},{"path":"packages/common/async/src/timeout.ts","kind":"import-statement","original":"./timeout"}],"format":"esm"},"packages/common/async/src/update-scheduler.ts":{"bytes":9920,"imports":[{"path":"packages/common/async/src/task-scheduling.ts","kind":"import-statement","original":"./task-scheduling"}],"format":"esm"},"packages/common/async/src/index.ts":{"bytes":2419,"imports":[{"path":"packages/common/async/src/callback.ts","kind":"import-statement","original":"./callback"},{"path":"packages/common/async/src/chain.ts","kind":"import-statement","original":"./chain"},{"path":"packages/common/async/src/debounce.ts","kind":"import-statement","original":"./debounce"},{"path":"packages/common/async/src/errors.ts","kind":"import-statement","original":"./errors"},{"path":"packages/common/async/src/event-emitter.ts","kind":"import-statement","original":"./event-emitter"},{"path":"packages/common/async/src/events.ts","kind":"import-statement","original":"./events"},{"path":"packages/common/async/src/latch.ts","kind":"import-statement","original":"./latch"},{"path":"packages/common/async/src/observable.ts","kind":"import-statement","original":"./observable"},{"path":"packages/common/async/src/observable-value.ts","kind":"import-statement","original":"./observable-value"},{"path":"packages/common/async/src/mutex.ts","kind":"import-statement","original":"./mutex"},{"path":"packages/common/async/src/sink.ts","kind":"import-statement","original":"./sink"},{"path":"packages/common/async/src/stream-to-array.ts","kind":"import-statement","original":"./stream-to-array"},{"path":"packages/common/async/src/timeout.ts","kind":"import-statement","original":"./timeout"},{"path":"packages/common/async/src/timer.ts","kind":"import-statement","original":"./timer"},{"path":"packages/common/async/src/testing.ts","kind":"import-statement","original":"./testing"},{"path":"packages/common/async/src/trigger.ts","kind":"import-statement","original":"./trigger"},{"path":"packages/common/async/src/types.ts","kind":"import-statement","original":"./types"},{"path":"packages/common/async/src/until.ts","kind":"import-statement","original":"./until"},{"path":"packages/common/async/src/task-scheduling.ts","kind":"import-statement","original":"./task-scheduling"},{"path":"packages/common/async/src/test-stream.ts","kind":"import-statement","original":"./test-stream"},{"path":"packages/common/async/src/track-leaks.ts","kind":"import-statement","original":"./track-leaks"},{"path":"packages/common/async/src/update-scheduler.ts","kind":"import-statement","original":"./update-scheduler"}],"format":"esm"}},"outputs":{"packages/common/async/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":83110},"packages/common/async/dist/lib/browser/index.mjs":{"imports":[{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"zen-observable","kind":"import-statement","external":true},{"path":"zen-push","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/node-std/stream","kind":"import-statement","external":true}],"exports":["CancellableObservableProvider","DeferredTask","Event","EventSubscriptions","MulticastObservable","Mutex","MutexGuard","Observable","ObservableProvider","PushStream","TestStream","TimeoutError","Timer","Trigger","TriggerState","UpdateScheduler","addListener","asyncChain","asyncReturn","asyncTimeout","createPromiseFromCallback","debounce","dumpLeaks","latch","observableError","onEvent","runInContext","runInContextAsync","scheduleExponentialBackoffTaskInterval","scheduleMicroTask","scheduleTask","scheduleTaskInterval","sink","sleep","sleepWithContext","streamToArray","synchronized","toError","trackLeaks","trackResource","trigger","unrefTimeout","until","untilError","untilPromise","waitForCondition","waitForEvent"],"entryPoint":"packages/common/async/src/index.ts","inputs":{"packages/common/async/src/callback.ts":{"bytesInOutput":191},"packages/common/async/src/index.ts":{"bytesInOutput":0},"packages/common/async/src/chain.ts":{"bytesInOutput":219},"packages/common/async/src/debounce.ts":{"bytesInOutput":144},"packages/common/async/src/errors.ts":{"bytesInOutput":473},"packages/common/async/src/timeout.ts":{"bytesInOutput":1487},"packages/common/async/src/event-emitter.ts":{"bytesInOutput":694},"packages/common/async/src/events.ts":{"bytesInOutput":7783},"packages/common/async/src/latch.ts":{"bytesInOutput":987},"packages/common/async/src/observable.ts":{"bytesInOutput":3695},"packages/common/async/src/trigger.ts":{"bytesInOutput":1835},"packages/common/async/src/observable-value.ts":{"bytesInOutput":975},"packages/common/async/src/mutex.ts":{"bytesInOutput":2444},"packages/common/async/src/sink.ts":{"bytesInOutput":285},"packages/common/async/src/stream-to-array.ts":{"bytesInOutput":967},"packages/common/async/src/timer.ts":{"bytesInOutput":1054},"packages/common/async/src/testing.ts":{"bytesInOutput":587},"packages/common/async/src/until.ts":{"bytesInOutput":760},"packages/common/async/src/task-scheduling.ts":{"bytesInOutput":3090},"packages/common/async/src/track-leaks.ts":{"bytesInOutput":2149},"packages/common/async/src/test-stream.ts":{"bytesInOutput":935},"packages/common/async/src/update-scheduler.ts":{"bytesInOutput":1855}},"bytes":34414}}}

@@ -1,1 +0,1 @@

{"inputs":{"packages/common/async/src/callback.ts":{"bytes":1594,"imports":[],"format":"esm"},"packages/common/async/src/chain.ts":{"bytes":1701,"imports":[],"format":"esm"},"packages/common/async/src/debounce.ts":{"bytes":1275,"imports":[],"format":"esm"},"packages/common/async/src/errors.ts":{"bytes":3008,"imports":[],"format":"esm"},"packages/common/async/src/timeout.ts":{"bytes":7907,"imports":[{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"packages/common/async/src/callback.ts","kind":"import-statement","original":"./callback"},{"path":"packages/common/async/src/errors.ts","kind":"import-statement","original":"./errors"}],"format":"esm"},"packages/common/async/src/event-emitter.ts":{"bytes":4236,"imports":[{"path":"packages/common/async/src/timeout.ts","kind":"import-statement","original":"./timeout"}],"format":"esm"},"packages/common/async/src/events.ts":{"bytes":37154,"imports":[{"path":"@dxos/context","kind":"import-statement","external":true}],"format":"esm"},"packages/common/async/src/latch.ts":{"bytes":4484,"imports":[{"path":"@dxos/invariant","kind":"import-statement","external":true}],"format":"esm"},"packages/common/async/src/trigger.ts":{"bytes":9868,"imports":[{"path":"packages/common/async/src/errors.ts","kind":"import-statement","original":"./errors"},{"path":"packages/common/async/src/timeout.ts","kind":"import-statement","original":"./timeout"}],"format":"esm"},"packages/common/async/src/observable.ts":{"bytes":18063,"imports":[{"path":"zen-observable","kind":"import-statement","external":true},{"path":"zen-push","kind":"import-statement","external":true},{"path":"packages/common/async/src/trigger.ts","kind":"import-statement","original":"./trigger"}],"format":"esm"},"packages/common/async/src/observable-value.ts":{"bytes":6622,"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"packages/common/async/src/mutex.ts":{"bytes":12860,"imports":[{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true}],"format":"esm"},"packages/common/async/src/sink.ts":{"bytes":2055,"imports":[{"path":"packages/common/async/src/trigger.ts","kind":"import-statement","original":"./trigger"}],"format":"esm"},"packages/common/async/src/stream-to-array.ts":{"bytes":5040,"imports":[],"format":"esm"},"packages/common/async/src/timer.ts":{"bytes":6062,"imports":[{"path":"packages/common/async/src/events.ts","kind":"import-statement","original":"./events"}],"format":"esm"},"packages/common/async/src/testing.ts":{"bytes":4756,"imports":[{"path":"packages/common/async/src/timeout.ts","kind":"import-statement","original":"./timeout"},{"path":"packages/common/async/src/trigger.ts","kind":"import-statement","original":"./trigger"}],"format":"esm"},"packages/common/async/src/types.ts":{"bytes":517,"imports":[],"format":"esm"},"packages/common/async/src/until.ts":{"bytes":4408,"imports":[],"format":"esm"},"packages/common/async/src/track-leaks.ts":{"bytes":8583,"imports":[{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"packages/common/async/src/task-scheduling.ts":{"bytes":15529,"imports":[{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"packages/common/async/src/track-leaks.ts","kind":"import-statement","original":"./track-leaks"},{"path":"packages/common/async/src/trigger.ts","kind":"import-statement","original":"./trigger"}],"format":"esm"},"packages/common/async/src/test-stream.ts":{"bytes":5087,"imports":[{"path":"node:stream","kind":"import-statement","external":true},{"path":"packages/common/async/src/events.ts","kind":"import-statement","original":"./events"},{"path":"packages/common/async/src/timeout.ts","kind":"import-statement","original":"./timeout"}],"format":"esm"},"packages/common/async/src/update-scheduler.ts":{"bytes":9920,"imports":[{"path":"packages/common/async/src/task-scheduling.ts","kind":"import-statement","original":"./task-scheduling"}],"format":"esm"},"packages/common/async/src/index.ts":{"bytes":2419,"imports":[{"path":"packages/common/async/src/callback.ts","kind":"import-statement","original":"./callback"},{"path":"packages/common/async/src/chain.ts","kind":"import-statement","original":"./chain"},{"path":"packages/common/async/src/debounce.ts","kind":"import-statement","original":"./debounce"},{"path":"packages/common/async/src/errors.ts","kind":"import-statement","original":"./errors"},{"path":"packages/common/async/src/event-emitter.ts","kind":"import-statement","original":"./event-emitter"},{"path":"packages/common/async/src/events.ts","kind":"import-statement","original":"./events"},{"path":"packages/common/async/src/latch.ts","kind":"import-statement","original":"./latch"},{"path":"packages/common/async/src/observable.ts","kind":"import-statement","original":"./observable"},{"path":"packages/common/async/src/observable-value.ts","kind":"import-statement","original":"./observable-value"},{"path":"packages/common/async/src/mutex.ts","kind":"import-statement","original":"./mutex"},{"path":"packages/common/async/src/sink.ts","kind":"import-statement","original":"./sink"},{"path":"packages/common/async/src/stream-to-array.ts","kind":"import-statement","original":"./stream-to-array"},{"path":"packages/common/async/src/timeout.ts","kind":"import-statement","original":"./timeout"},{"path":"packages/common/async/src/timer.ts","kind":"import-statement","original":"./timer"},{"path":"packages/common/async/src/testing.ts","kind":"import-statement","original":"./testing"},{"path":"packages/common/async/src/trigger.ts","kind":"import-statement","original":"./trigger"},{"path":"packages/common/async/src/types.ts","kind":"import-statement","original":"./types"},{"path":"packages/common/async/src/until.ts","kind":"import-statement","original":"./until"},{"path":"packages/common/async/src/task-scheduling.ts","kind":"import-statement","original":"./task-scheduling"},{"path":"packages/common/async/src/test-stream.ts","kind":"import-statement","original":"./test-stream"},{"path":"packages/common/async/src/track-leaks.ts","kind":"import-statement","original":"./track-leaks"},{"path":"packages/common/async/src/update-scheduler.ts","kind":"import-statement","original":"./update-scheduler"}],"format":"esm"}},"outputs":{"packages/common/async/dist/lib/node/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":83817},"packages/common/async/dist/lib/node/index.cjs":{"imports":[{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"zen-observable","kind":"import-statement","external":true},{"path":"zen-push","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"node:stream","kind":"import-statement","external":true}],"exports":["CancellableObservableProvider","DeferredTask","Event","EventSubscriptions","MulticastObservable","Mutex","MutexGuard","Observable","ObservableProvider","PushStream","TestStream","TimeoutError","Timer","Trigger","TriggerState","UpdateScheduler","addListener","asyncChain","asyncReturn","asyncTimeout","createPromiseFromCallback","debounce","dumpLeaks","latch","observableError","onEvent","runInContext","runInContextAsync","scheduleExponentialBackoffTaskInterval","scheduleMicroTask","scheduleTask","scheduleTaskInterval","sink","sleep","sleepWithContext","streamToArray","synchronized","toError","trackLeaks","trackResource","trigger","unrefTimeout","until","untilError","untilPromise","waitForCondition","waitForEvent"],"entryPoint":"packages/common/async/src/index.ts","inputs":{"packages/common/async/src/callback.ts":{"bytesInOutput":191},"packages/common/async/src/index.ts":{"bytesInOutput":0},"packages/common/async/src/chain.ts":{"bytesInOutput":219},"packages/common/async/src/debounce.ts":{"bytesInOutput":144},"packages/common/async/src/errors.ts":{"bytesInOutput":473},"packages/common/async/src/timeout.ts":{"bytesInOutput":1487},"packages/common/async/src/event-emitter.ts":{"bytesInOutput":694},"packages/common/async/src/events.ts":{"bytesInOutput":7861},"packages/common/async/src/latch.ts":{"bytesInOutput":987},"packages/common/async/src/observable.ts":{"bytesInOutput":3695},"packages/common/async/src/trigger.ts":{"bytesInOutput":1835},"packages/common/async/src/observable-value.ts":{"bytesInOutput":975},"packages/common/async/src/mutex.ts":{"bytesInOutput":2444},"packages/common/async/src/sink.ts":{"bytesInOutput":285},"packages/common/async/src/stream-to-array.ts":{"bytesInOutput":967},"packages/common/async/src/timer.ts":{"bytesInOutput":1054},"packages/common/async/src/testing.ts":{"bytesInOutput":587},"packages/common/async/src/until.ts":{"bytesInOutput":760},"packages/common/async/src/task-scheduling.ts":{"bytesInOutput":3090},"packages/common/async/src/track-leaks.ts":{"bytesInOutput":2149},"packages/common/async/src/test-stream.ts":{"bytesInOutput":925},"packages/common/async/src/update-scheduler.ts":{"bytesInOutput":1855}},"bytes":34482}}}
{"inputs":{"packages/common/async/src/callback.ts":{"bytes":1594,"imports":[],"format":"esm"},"packages/common/async/src/chain.ts":{"bytes":1701,"imports":[],"format":"esm"},"packages/common/async/src/debounce.ts":{"bytes":1275,"imports":[],"format":"esm"},"packages/common/async/src/errors.ts":{"bytes":3008,"imports":[],"format":"esm"},"packages/common/async/src/timeout.ts":{"bytes":7907,"imports":[{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"packages/common/async/src/callback.ts","kind":"import-statement","original":"./callback"},{"path":"packages/common/async/src/errors.ts","kind":"import-statement","original":"./errors"}],"format":"esm"},"packages/common/async/src/event-emitter.ts":{"bytes":4236,"imports":[{"path":"packages/common/async/src/timeout.ts","kind":"import-statement","original":"./timeout"}],"format":"esm"},"packages/common/async/src/events.ts":{"bytes":36125,"imports":[{"path":"@dxos/context","kind":"import-statement","external":true}],"format":"esm"},"packages/common/async/src/latch.ts":{"bytes":4484,"imports":[{"path":"@dxos/invariant","kind":"import-statement","external":true}],"format":"esm"},"packages/common/async/src/trigger.ts":{"bytes":9868,"imports":[{"path":"packages/common/async/src/errors.ts","kind":"import-statement","original":"./errors"},{"path":"packages/common/async/src/timeout.ts","kind":"import-statement","original":"./timeout"}],"format":"esm"},"packages/common/async/src/observable.ts":{"bytes":18063,"imports":[{"path":"zen-observable","kind":"import-statement","external":true},{"path":"zen-push","kind":"import-statement","external":true},{"path":"packages/common/async/src/trigger.ts","kind":"import-statement","original":"./trigger"}],"format":"esm"},"packages/common/async/src/observable-value.ts":{"bytes":6622,"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"packages/common/async/src/mutex.ts":{"bytes":12860,"imports":[{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true}],"format":"esm"},"packages/common/async/src/sink.ts":{"bytes":2055,"imports":[{"path":"packages/common/async/src/trigger.ts","kind":"import-statement","original":"./trigger"}],"format":"esm"},"packages/common/async/src/stream-to-array.ts":{"bytes":5040,"imports":[],"format":"esm"},"packages/common/async/src/timer.ts":{"bytes":6062,"imports":[{"path":"packages/common/async/src/events.ts","kind":"import-statement","original":"./events"}],"format":"esm"},"packages/common/async/src/testing.ts":{"bytes":4756,"imports":[{"path":"packages/common/async/src/timeout.ts","kind":"import-statement","original":"./timeout"},{"path":"packages/common/async/src/trigger.ts","kind":"import-statement","original":"./trigger"}],"format":"esm"},"packages/common/async/src/types.ts":{"bytes":517,"imports":[],"format":"esm"},"packages/common/async/src/until.ts":{"bytes":4408,"imports":[],"format":"esm"},"packages/common/async/src/track-leaks.ts":{"bytes":8583,"imports":[{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"packages/common/async/src/task-scheduling.ts":{"bytes":15525,"imports":[{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"packages/common/async/src/track-leaks.ts","kind":"import-statement","original":"./track-leaks"},{"path":"packages/common/async/src/trigger.ts","kind":"import-statement","original":"./trigger"}],"format":"esm"},"packages/common/async/src/test-stream.ts":{"bytes":5087,"imports":[{"path":"node:stream","kind":"import-statement","external":true},{"path":"packages/common/async/src/events.ts","kind":"import-statement","original":"./events"},{"path":"packages/common/async/src/timeout.ts","kind":"import-statement","original":"./timeout"}],"format":"esm"},"packages/common/async/src/update-scheduler.ts":{"bytes":9920,"imports":[{"path":"packages/common/async/src/task-scheduling.ts","kind":"import-statement","original":"./task-scheduling"}],"format":"esm"},"packages/common/async/src/index.ts":{"bytes":2419,"imports":[{"path":"packages/common/async/src/callback.ts","kind":"import-statement","original":"./callback"},{"path":"packages/common/async/src/chain.ts","kind":"import-statement","original":"./chain"},{"path":"packages/common/async/src/debounce.ts","kind":"import-statement","original":"./debounce"},{"path":"packages/common/async/src/errors.ts","kind":"import-statement","original":"./errors"},{"path":"packages/common/async/src/event-emitter.ts","kind":"import-statement","original":"./event-emitter"},{"path":"packages/common/async/src/events.ts","kind":"import-statement","original":"./events"},{"path":"packages/common/async/src/latch.ts","kind":"import-statement","original":"./latch"},{"path":"packages/common/async/src/observable.ts","kind":"import-statement","original":"./observable"},{"path":"packages/common/async/src/observable-value.ts","kind":"import-statement","original":"./observable-value"},{"path":"packages/common/async/src/mutex.ts","kind":"import-statement","original":"./mutex"},{"path":"packages/common/async/src/sink.ts","kind":"import-statement","original":"./sink"},{"path":"packages/common/async/src/stream-to-array.ts","kind":"import-statement","original":"./stream-to-array"},{"path":"packages/common/async/src/timeout.ts","kind":"import-statement","original":"./timeout"},{"path":"packages/common/async/src/timer.ts","kind":"import-statement","original":"./timer"},{"path":"packages/common/async/src/testing.ts","kind":"import-statement","original":"./testing"},{"path":"packages/common/async/src/trigger.ts","kind":"import-statement","original":"./trigger"},{"path":"packages/common/async/src/types.ts","kind":"import-statement","original":"./types"},{"path":"packages/common/async/src/until.ts","kind":"import-statement","original":"./until"},{"path":"packages/common/async/src/task-scheduling.ts","kind":"import-statement","original":"./task-scheduling"},{"path":"packages/common/async/src/test-stream.ts","kind":"import-statement","original":"./test-stream"},{"path":"packages/common/async/src/track-leaks.ts","kind":"import-statement","original":"./track-leaks"},{"path":"packages/common/async/src/update-scheduler.ts","kind":"import-statement","original":"./update-scheduler"}],"format":"esm"}},"outputs":{"packages/common/async/dist/lib/node/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":83110},"packages/common/async/dist/lib/node/index.cjs":{"imports":[{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"zen-observable","kind":"import-statement","external":true},{"path":"zen-push","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"node:stream","kind":"import-statement","external":true}],"exports":["CancellableObservableProvider","DeferredTask","Event","EventSubscriptions","MulticastObservable","Mutex","MutexGuard","Observable","ObservableProvider","PushStream","TestStream","TimeoutError","Timer","Trigger","TriggerState","UpdateScheduler","addListener","asyncChain","asyncReturn","asyncTimeout","createPromiseFromCallback","debounce","dumpLeaks","latch","observableError","onEvent","runInContext","runInContextAsync","scheduleExponentialBackoffTaskInterval","scheduleMicroTask","scheduleTask","scheduleTaskInterval","sink","sleep","sleepWithContext","streamToArray","synchronized","toError","trackLeaks","trackResource","trigger","unrefTimeout","until","untilError","untilPromise","waitForCondition","waitForEvent"],"entryPoint":"packages/common/async/src/index.ts","inputs":{"packages/common/async/src/callback.ts":{"bytesInOutput":191},"packages/common/async/src/index.ts":{"bytesInOutput":0},"packages/common/async/src/chain.ts":{"bytesInOutput":219},"packages/common/async/src/debounce.ts":{"bytesInOutput":144},"packages/common/async/src/errors.ts":{"bytesInOutput":473},"packages/common/async/src/timeout.ts":{"bytesInOutput":1487},"packages/common/async/src/event-emitter.ts":{"bytesInOutput":694},"packages/common/async/src/events.ts":{"bytesInOutput":7783},"packages/common/async/src/latch.ts":{"bytesInOutput":987},"packages/common/async/src/observable.ts":{"bytesInOutput":3695},"packages/common/async/src/trigger.ts":{"bytesInOutput":1835},"packages/common/async/src/observable-value.ts":{"bytesInOutput":975},"packages/common/async/src/mutex.ts":{"bytesInOutput":2444},"packages/common/async/src/sink.ts":{"bytesInOutput":285},"packages/common/async/src/stream-to-array.ts":{"bytesInOutput":967},"packages/common/async/src/timer.ts":{"bytesInOutput":1054},"packages/common/async/src/testing.ts":{"bytesInOutput":587},"packages/common/async/src/until.ts":{"bytesInOutput":760},"packages/common/async/src/task-scheduling.ts":{"bytesInOutput":3090},"packages/common/async/src/track-leaks.ts":{"bytesInOutput":2149},"packages/common/async/src/test-stream.ts":{"bytesInOutput":925},"packages/common/async/src/update-scheduler.ts":{"bytesInOutput":1855}},"bytes":34404}}}

@@ -6,3 +6,3 @@ import { type EventEmitter } from 'node:events';

*/
export declare const onEvent: (eventEmitter: EventEmitter, eventName: string, callback: (args: any) => void) => () => EventEmitter<[never]>;
export declare const onEvent: (eventEmitter: EventEmitter, eventName: string, callback: (args: any) => void) => () => EventEmitter;
/**

@@ -12,3 +12,3 @@ * @deprecated

export declare const addListener: (eventEmitter: EventEmitter, eventName: string, callback: () => void) => {
remove: () => EventEmitter<[never]>;
remove: () => EventEmitter;
};

@@ -15,0 +15,0 @@ /**

@@ -43,3 +43,3 @@ import { Context } from '@dxos/context';

* 2. User can explicitly define event visibility (public, protected, private).
* 3. Having events as class fields allows the compiler to check for correct event usage.
* 3. Havings events as class fields allows the compiler to check for correct event usage.
* 4. User can type the data that event will be emitting.

@@ -51,5 +51,2 @@ * 5. Uses composition instead of inheritance.

export declare class Event<T = void> implements ReadOnlyEvent<T> {
/**
* Wrap objects that have on/off style event emitters.
*/
static wrap<T>(emitter: EventEmitterLike, eventName: string): Event<T>;

@@ -164,11 +161,9 @@ private readonly _listeners;

/**
* Register an event listener.
* Registers an event listener.
* If provided callback was already registered as once-listener, it is made permanent.
*
* @param callback
* @param options.weak If true, the callback will be weakly referenced and will be garbage collected if no other references to it exist.
* @returns function that unsubscribes this event listener
*/
on(callback: (data: T) => void): UnsubscribeCallback;
on(ctx: Context, callback: (data: T) => void, options?: ListenerOptions): UnsubscribeCallback;
/**

@@ -210,11 +205,4 @@ * Unsubscribes this callback from new events. Includes persistent and once-listeners.

discardParameter(): Event<void>;
/**
* Triggers an event with at least `timeout` milliseconds between each event.
* If the event is triggered more often, the event is delayed until the timeout is reached.
* If event is emitted for the first time or event wasn't fired for `timeout` milliseconds,
* the event is emitted after `timeout / 8` ms.
*/
debounce(timeout?: number): Event<void>;
}
export {};
//# sourceMappingURL=events.d.ts.map
{
"name": "@dxos/async",
"version": "0.6.13-main.ed424a1",
"version": "0.6.13-staging.1e988a3",
"description": "Async utilities.",

@@ -13,4 +13,3 @@ "homepage": "https://dxos.org",

"node": {
"require": "./dist/lib/node/index.cjs",
"default": "./dist/lib/node-esm/index.mjs"
"default": "./dist/lib/node/index.cjs"
},

@@ -31,8 +30,8 @@ "types": "./dist/types/src/index.d.ts"

"zen-push": "^0.3.1",
"@dxos/context": "0.6.13-main.ed424a1",
"@dxos/log": "0.6.13-main.ed424a1",
"@dxos/invariant": "0.6.13-main.ed424a1",
"@dxos/node-std": "0.6.13-main.ed424a1",
"@dxos/util": "0.6.13-main.ed424a1",
"@dxos/debug": "0.6.13-main.ed424a1"
"@dxos/context": "0.6.13-staging.1e988a3",
"@dxos/debug": "0.6.13-staging.1e988a3",
"@dxos/log": "0.6.13-staging.1e988a3",
"@dxos/invariant": "0.6.13-staging.1e988a3",
"@dxos/node-std": "0.6.13-staging.1e988a3",
"@dxos/util": "0.6.13-staging.1e988a3"
},

@@ -39,0 +38,0 @@ "devDependencies": {

@@ -5,5 +5,7 @@ //

import { expect } from 'chai';
import { EventEmitter } from 'node:events';
import { describe, expect, test } from 'vitest';
import { describe, test } from '@dxos/test';
import { onEvent, waitForEvent } from './event-emitter';

@@ -10,0 +12,0 @@ import { latch } from './latch';

@@ -5,7 +5,8 @@ //

// import { setFlagsFromString } from 'node:v8';
// import { runInNewContext } from 'node:vm';
import { describe, expect, test } from 'vitest';
import { expect } from 'chai';
import { setFlagsFromString } from 'node:v8';
import { runInNewContext } from 'node:vm';
import { Context } from '@dxos/context';
import { describe, test } from '@dxos/test';

@@ -93,26 +94,26 @@ import { Event } from './events';

// test.skip('weak', async () => {
// setFlagsFromString('--expose_gc');
// const gc = runInNewContext('gc'); // nocommit
test.skip('weak', async () => {
setFlagsFromString('--expose_gc');
const gc = runInNewContext('gc'); // nocommit
// let called = 0;
// let callback: (() => void) | null = () => {
// called++;
// };
let called = 0;
let callback: (() => void) | null = () => {
called++;
};
// const event = new Event();
// event.on(new Context(), callback, { weak: true });
const event = new Event();
event.on(new Context(), callback, { weak: true });
// event.emit();
// expect(called).to.equal(1);
event.emit();
expect(called).to.equal(1);
// callback = null;
// while (event.listenerCount() > 0) {
// gc();
// await sleep(5);
// }
callback = null;
while (event.listenerCount() > 0) {
gc();
await sleep(5);
}
// event.emit();
// expect(called).to.equal(1);
// });
event.emit();
expect(called).to.equal(1);
});
});

@@ -68,3 +68,3 @@ //

* 2. User can explicitly define event visibility (public, protected, private).
* 3. Having events as class fields allows the compiler to check for correct event usage.
* 3. Havings events as class fields allows the compiler to check for correct event usage.
* 4. User can type the data that event will be emitting.

@@ -77,5 +77,2 @@ * 5. Uses composition instead of inheritance.

export class Event<T = void> implements ReadOnlyEvent<T> {
/**
* Wrap objects that have on/off style event emitters.
*/
static wrap<T>(emitter: EventEmitterLike, eventName: string): Event<T> {

@@ -267,3 +264,3 @@ const event = new Event<T>();

*/
// TODO(burdon): Factor out generic function.
// TODO(burdon): Provide function.
debounce(timeout = 0) {

@@ -352,11 +349,9 @@ let firing: NodeJS.Timeout | undefined;

/**
* Register an event listener.
* Registers an event listener.
* If provided callback was already registered as once-listener, it is made permanent.
*
* @param callback
* @param options.weak If true, the callback will be weakly referenced and will be garbage collected if no other references to it exist.
* @returns function that unsubscribes this event listener
*/
on(callback: (data: T) => void): UnsubscribeCallback;
on(ctx: Context, callback: (data: T) => void, options?: ListenerOptions): UnsubscribeCallback;

@@ -404,10 +399,2 @@ /**

discardParameter(): Event<void>;
/**
* Triggers an event with at least `timeout` milliseconds between each event.
* If the event is triggered more often, the event is delayed until the timeout is reached.
* If event is emitted for the first time or event wasn't fired for `timeout` milliseconds,
* the event is emitted after `timeout / 8` ms.
*/
debounce(timeout?: number): Event<void>;
}

@@ -414,0 +401,0 @@

@@ -5,5 +5,6 @@ //

import { describe, expect, test } from 'vitest';
import { expect } from 'chai';
import { expectToThrow } from '@dxos/debug';
import { describe, test } from '@dxos/test';

@@ -142,3 +143,3 @@ import { Mutex, synchronized } from './mutex';

expect(error!.stack!.includes('callmutex')).to.be.true;
}); // .skipEnvironments('webkit');
}).skipEnvironments('webkit');

@@ -145,0 +146,0 @@ test('works with explicit resource management syntax', async () => {

@@ -5,4 +5,6 @@ //

import { describe, expect, test } from 'vitest';
import { expect } from 'chai';
import { describe, test } from '@dxos/test';
import { type AsyncEvents, TimeoutError } from './errors';

@@ -9,0 +11,0 @@ import { latch } from './latch';

@@ -5,4 +5,6 @@ //

import { describe, expect, onTestFinished, test } from 'vitest';
import { expect } from 'chai';
import { afterTest, describe, test } from '@dxos/test';
import { Event } from './events';

@@ -25,3 +27,3 @@ import { MulticastObservable, Observable, PushStream } from './observable';

});
onTestFinished(() => subscription.unsubscribe());
afterTest(() => subscription.unsubscribe());
await trigger.wait();

@@ -49,4 +51,4 @@ });

onTestFinished(() => subscription1.unsubscribe());
onTestFinished(() => subscription2.unsubscribe());
afterTest(() => subscription1.unsubscribe());
afterTest(() => subscription2.unsubscribe());

@@ -104,3 +106,3 @@ const next = { new: 'value' };

});
onTestFinished(() => subscription.unsubscribe());
afterTest(() => subscription.unsubscribe());
expect(await result.wait()).to.deep.equal(6);

@@ -126,3 +128,3 @@ });

});
onTestFinished(() => subscription.unsubscribe());
afterTest(() => subscription.unsubscribe());
expect(await result.wait()).to.deep.equal(6);

@@ -129,0 +131,0 @@ });

@@ -5,5 +5,7 @@ //

import { describe, expect, test } from 'vitest';
import { expect } from 'chai';
import waitForExpect from 'wait-for-expect';
import { Context } from '@dxos/context';
import { describe, test } from '@dxos/test';

@@ -27,3 +29,5 @@ import { DeferredTask, scheduleTask } from './task-scheduling';

await expect.poll(() => error.message).toBe('test');
await waitForExpect(() => {
expect(error.message).to.eq('test');
});
});

@@ -30,0 +34,0 @@

@@ -64,3 +64,2 @@ //

}
this.schedule();

@@ -67,0 +66,0 @@ await this._nextTask.wait();

@@ -5,3 +5,3 @@ //

import { test } from 'vitest';
import { test } from '@dxos/test';

@@ -8,0 +8,0 @@ import { TestStream } from './test-stream';

@@ -5,5 +5,6 @@ //

import { describe, expect, test } from 'vitest';
import { expect } from 'chai';
import { expectToThrow } from '@dxos/debug';
import { describe, test } from '@dxos/test';

@@ -10,0 +11,0 @@ import { waitForCondition } from './testing';

@@ -5,4 +5,7 @@ //

import { describe, expect, test } from 'vitest';
import { expect } from 'chai';
import { expectToThrow } from '@dxos/debug';
import { describe, test } from '@dxos/test';
import { asyncTimeout, sleep } from './timeout';

@@ -19,3 +22,3 @@

const promise = sleep(200).then(() => 'test');
await expect(() => asyncTimeout(promise, 100, new Error('timeout'))).rejects.toThrowError();
await expectToThrow(() => asyncTimeout(promise, 100, new Error('timeout')));
});

@@ -22,0 +25,0 @@

@@ -5,7 +5,12 @@ //

import { describe, expect, test } from 'vitest';
import chai, { expect } from 'chai';
import chaiAsPromised from 'chai-as-promised';
import { describe, test } from '@dxos/test';
import { sleep } from './timeout';
import { Trigger, TriggerState, trigger } from './trigger';
chai.use(chaiAsPromised);
describe('trigger', () => {

@@ -51,3 +56,3 @@ test('trigger', async () => {

trigger.throw(error);
await expect(promise).rejects.toThrowError(error);
await expect(promise).to.be.rejectedWith(error);
expect(trigger.state).to.equal(TriggerState.REJECTED);

@@ -54,0 +59,0 @@ trigger.reset();

@@ -5,4 +5,7 @@ //

import { describe, expect, test } from 'vitest';
import { expect } from 'chai';
import { expectToThrow } from '@dxos/debug';
import { describe, test } from '@dxos/test';
import { sleep } from './timeout';

@@ -23,3 +26,3 @@ import { until } from './until';

test('error', async () => {
await expect(async () => {
await expectToThrow(async () => {
await until(async (resolve, reject) => {

@@ -29,7 +32,7 @@ await sleep(100);

});
}).rejects.toThrowError();
});
});
test('catch', async () => {
await expect(async () => {
await expectToThrow(async () => {
await until(async () => {

@@ -39,7 +42,7 @@ await sleep(100);

});
}).rejects.toThrowError();
});
});
test('timeout', async () => {
await expect(async () => {
await expectToThrow(async () => {
await until(async (resolve) => {

@@ -49,4 +52,4 @@ await sleep(500);

}, 100); // Timeout before complete.
}).rejects.toThrowError();
});
});
});

@@ -5,5 +5,6 @@ //

import { describe, expect, test } from 'vitest';
import { expect } from 'chai';
import { Context } from '@dxos/context';
import { describe, test } from '@dxos/test';

@@ -10,0 +11,0 @@ import { sleep } from './timeout';

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc