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
29
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-aaccfd472a61651f2cd223e08a772916adea0d39 to 0.0.0-next-aafcfc5ac487a7962baee26ca6c5870e66de2533

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-aaccfd472a61651f2cd223e08a772916adea0d39",
"version": "0.0.0-next-aafcfc5ac487a7962baee26ca6c5870e66de2533",
"repository": {

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

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

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

},
"gitHead": "aaccfd472a61651f2cd223e08a772916adea0d39"
"gitHead": "aafcfc5ac487a7962baee26ca6c5870e66de2533"
}

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