New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@mongodb-js/compass-utils

Package Overview
Dependencies
Maintainers
30
Versions
493
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mongodb-js/compass-utils - npm Package Compare versions

Comparing version 0.0.0-next-f5e96f4dde195c3f4c44fc6c373583df1178a29d to 0.0.0-next-f6dcd616f47e1d3843402c3e0f47d541edec53f3

33

dist/cancellable-promise.js

@@ -21,22 +21,2 @@ "use strict";

exports.isCancelError = isCancelError;
function abortablePromise(abortSignal, successSignal) {
var _a;
if (abortSignal.aborted) {
return Promise.reject((_a = abortSignal.reason) !== null && _a !== void 0 ? _a : (0, exports.createCancelError)());
}
let reject;
const promise = new Promise(function (_resolve, _reject) {
reject = _reject;
});
const abort = () => {
successSignal.removeEventListener('abort', succeed);
reject((0, exports.createCancelError)());
};
const succeed = () => {
abortSignal.removeEventListener('abort', abort);
};
abortSignal.addEventListener('abort', abort, { once: true });
successSignal.addEventListener('abort', succeed, { once: true });
return promise;
}
async function raceWithAbort(promise, signal) {

@@ -47,11 +27,12 @@ var _a;

}
const successController = new AbortController();
const abortPromise = abortablePromise(signal, successController.signal);
let abortListener;
const pendingPromise = new Promise((_resolve, reject) => {
abortListener = () => { var _a; return reject((_a = signal.reason) !== null && _a !== void 0 ? _a : (0, exports.createCancelError)()); };
signal.addEventListener('abort', abortListener, { once: true });
});
try {
return await Promise.race([abortPromise, promise]);
return await Promise.race([pendingPromise, promise]);
}
finally {
if (!signal.aborted) {
successController.abort();
}
abortListener && signal.removeEventListener('abort', abortListener);
}

@@ -58,0 +39,0 @@ }

@@ -17,3 +17,3 @@ {

"homepage": "https://github.com/mongodb-js/compass",
"version": "0.0.0-next-f5e96f4dde195c3f4c44fc6c373583df1178a29d",
"version": "0.0.0-next-f6dcd616f47e1d3843402c3e0f47d541edec53f3",
"repository": {

@@ -58,6 +58,6 @@ "type": "git",

"devDependencies": {
"@mongodb-js/eslint-config-compass": "0.0.0-next-f5e96f4dde195c3f4c44fc6c373583df1178a29d",
"@mongodb-js/mocha-config-compass": "0.0.0-next-f5e96f4dde195c3f4c44fc6c373583df1178a29d",
"@mongodb-js/prettier-config-compass": "0.0.0-next-f5e96f4dde195c3f4c44fc6c373583df1178a29d",
"@mongodb-js/tsconfig-compass": "0.0.0-next-f5e96f4dde195c3f4c44fc6c373583df1178a29d",
"@mongodb-js/eslint-config-compass": "0.0.0-next-f6dcd616f47e1d3843402c3e0f47d541edec53f3",
"@mongodb-js/mocha-config-compass": "0.0.0-next-f6dcd616f47e1d3843402c3e0f47d541edec53f3",
"@mongodb-js/prettier-config-compass": "0.0.0-next-f6dcd616f47e1d3843402c3e0f47d541edec53f3",
"@mongodb-js/tsconfig-compass": "0.0.0-next-f6dcd616f47e1d3843402c3e0f47d541edec53f3",
"@types/chai": "^4.2.21",

@@ -76,3 +76,3 @@ "@types/mocha": "^9.0.0",

},
"gitHead": "f5e96f4dde195c3f4c44fc6c373583df1178a29d"
"gitHead": "f6dcd616f47e1d3843402c3e0f47d541edec53f3"
}

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