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

@dxos/context

Package Overview
Dependencies
Maintainers
13
Versions
2266
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dxos/context - npm Package Compare versions

Comparing version 0.1.18 to 0.1.19

dist/lib/browser/index.mjs.map

2

dist/lib/browser/meta.json

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

{"inputs":{"packages/common/context/src/context.ts":{"bytes":11074,"imports":[]},"packages/common/context/src/index.ts":{"bytes":447,"imports":[{"path":"packages/common/context/src/context.ts","kind":"import-statement"}]}},"outputs":{"packages/common/context/dist/lib/browser/index.mjs":{"imports":[],"exports":["Context"],"entryPoint":"packages/common/context/src/index.ts","inputs":{"packages/common/context/src/context.ts":{"bytesInOutput":2570},"packages/common/context/src/index.ts":{"bytesInOutput":0}},"bytes":2634}}}
{"inputs":{"packages/common/context/src/context.ts":{"bytes":11862,"imports":[]},"packages/common/context/src/index.ts":{"bytes":375,"imports":[{"path":"packages/common/context/src/context.ts","kind":"import-statement"}]}},"outputs":{"packages/common/context/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5339},"packages/common/context/dist/lib/browser/index.mjs":{"imports":[],"exports":["Context"],"entryPoint":"packages/common/context/src/index.ts","inputs":{"packages/common/context/src/context.ts":{"bytesInOutput":2686},"packages/common/context/src/index.ts":{"bytesInOutput":0}},"bytes":2785}}}

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

{"inputs":{"packages/common/context/src/context.ts":{"bytes":11074,"imports":[]},"packages/common/context/src/index.ts":{"bytes":447,"imports":[{"path":"packages/common/context/src/context.ts","kind":"import-statement"}]}},"outputs":{"packages/common/context/dist/lib/node/index.cjs":{"imports":[],"exports":[],"entryPoint":"packages/common/context/src/index.ts","inputs":{"packages/common/context/src/index.ts":{"bytesInOutput":119},"packages/common/context/src/context.ts":{"bytesInOutput":2611}},"bytes":3714}}}
{"inputs":{"packages/common/context/src/context.ts":{"bytes":11862,"imports":[]},"packages/common/context/src/index.ts":{"bytes":375,"imports":[{"path":"packages/common/context/src/context.ts","kind":"import-statement"}]}},"outputs":{"packages/common/context/dist/lib/node/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5459},"packages/common/context/dist/lib/node/index.cjs":{"imports":[],"exports":[],"entryPoint":"packages/common/context/src/index.ts","inputs":{"packages/common/context/src/index.ts":{"bytesInOutput":119},"packages/common/context/src/context.ts":{"bytesInOutput":2738}},"bytes":3876}}}

@@ -17,2 +17,4 @@ export declare type ContextErrorHandler = (error: Error) => void;

* Throwing an error inside the callback will result in the error being logged, but not re-thrown.
*
* NOTE: Will call the callback immediately if the context is already disposed.
*/

@@ -19,0 +21,0 @@ onDispose(callback: DisposeCallback): void;

{
"name": "@dxos/context",
"version": "0.1.18",
"version": "0.1.19",
"description": "Async utils.",

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

"dependencies": {
"@dxos/log": "0.1.18",
"@dxos/util": "0.1.18"
"@dxos/log": "0.1.19",
"@dxos/util": "0.1.19"
},

@@ -23,0 +23,0 @@ "publishConfig": {

@@ -42,6 +42,15 @@ //

* Throwing an error inside the callback will result in the error being logged, but not re-thrown.
*
* NOTE: Will call the callback immediately if the context is already disposed.
*/
onDispose(callback: DisposeCallback) {
if (this._isDisposed) {
throw new Error('Context is already disposed');
// Call the callback immediately if the context is already disposed.
void (async () => {
try {
await callback();
} catch (error: any) {
log.catch(error);
}
})();
}

@@ -48,0 +57,0 @@

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