@mongodb-js/compass-utils
Advanced tools
Comparing version 0.0.0-next-fb4a1f2a7bd24298659048854c23ace5519cc4c8 to 0.0.0-next-fc7d8174c38f419f2dc8c5ffabd4d0943e284819
declare class AbortError extends Error { | ||
constructor(); | ||
constructor(message?: string); | ||
name: string; | ||
} | ||
export declare const throwIfAborted: (signal?: AbortSignal) => void; | ||
export declare const createCancelError: () => AbortError; | ||
export declare const throwIfAborted: (signal?: { | ||
aborted: boolean; | ||
reason?: Error; | ||
}) => void; | ||
export declare const createCancelError: (message?: string) => AbortError; | ||
export declare function isCancelError(error: any): error is AbortError; | ||
@@ -8,0 +11,0 @@ export declare function raceWithAbort<T>(promise: Promise<T>, signal: AbortSignal): Promise<T>; |
@@ -5,4 +5,4 @@ "use strict"; | ||
class AbortError extends Error { | ||
constructor() { | ||
super('This operation was aborted'); | ||
constructor(message) { | ||
super(message ?? 'This operation was aborted'); | ||
this.name = 'AbortError'; | ||
@@ -17,6 +17,15 @@ } | ||
exports.throwIfAborted = throwIfAborted; | ||
const createCancelError = () => { | ||
const createCancelError = (message) => { | ||
const controller = new AbortController(); | ||
controller.abort(); | ||
return controller.signal.reason ?? new AbortError(); | ||
if (message && controller.signal.reason) { | ||
Object.defineProperty(controller.signal.reason, 'message', { | ||
get() { | ||
return message; | ||
}, | ||
configurable: true, | ||
enumerable: true, | ||
}); | ||
} | ||
return controller.signal.reason ?? new AbortError(message); | ||
}; | ||
@@ -23,0 +32,0 @@ exports.createCancelError = createCancelError; |
export declare function getAppName(): string | undefined; | ||
export declare function getAppVersion(): string | undefined; | ||
export declare function getStoragePath(): string; | ||
//# sourceMappingURL=electron.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getStoragePath = exports.getAppName = void 0; | ||
exports.getStoragePath = exports.getAppVersion = exports.getAppName = void 0; | ||
function getElectronApp() { | ||
@@ -23,2 +23,6 @@ let app; | ||
exports.getAppName = getAppName; | ||
function getAppVersion() { | ||
return getElectronApp()?.getVersion(); | ||
} | ||
exports.getAppVersion = getAppVersion; | ||
function getStoragePath() { | ||
@@ -25,0 +29,0 @@ const basepath = getElectronApp()?.getPath('userData'); |
export type { AmpersandMethodOptions } from './promisify-ampersand-method'; | ||
export { promisifyAmpersandMethod } from './promisify-ampersand-method'; | ||
export { getAppName, getStoragePath } from './electron'; | ||
export { getAppName, getStoragePath, getAppVersion } from './electron'; | ||
export { raceWithAbort, cancellableWait, createCancelError, isCancelError, throwIfAborted, } from './cancellable-promise'; | ||
//# sourceMappingURL=index.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.throwIfAborted = exports.isCancelError = exports.createCancelError = exports.cancellableWait = exports.raceWithAbort = exports.getStoragePath = exports.getAppName = exports.promisifyAmpersandMethod = void 0; | ||
exports.throwIfAborted = exports.isCancelError = exports.createCancelError = exports.cancellableWait = exports.raceWithAbort = exports.getAppVersion = exports.getStoragePath = exports.getAppName = exports.promisifyAmpersandMethod = void 0; | ||
var promisify_ampersand_method_1 = require("./promisify-ampersand-method"); | ||
@@ -9,2 +9,3 @@ Object.defineProperty(exports, "promisifyAmpersandMethod", { enumerable: true, get: function () { return promisify_ampersand_method_1.promisifyAmpersandMethod; } }); | ||
Object.defineProperty(exports, "getStoragePath", { enumerable: true, get: function () { return electron_1.getStoragePath; } }); | ||
Object.defineProperty(exports, "getAppVersion", { enumerable: true, get: function () { return electron_1.getAppVersion; } }); | ||
var cancellable_promise_1 = require("./cancellable-promise"); | ||
@@ -11,0 +12,0 @@ Object.defineProperty(exports, "raceWithAbort", { enumerable: true, get: function () { return cancellable_promise_1.raceWithAbort; } }); |
@@ -16,3 +16,3 @@ { | ||
"homepage": "https://github.com/mongodb-js/compass", | ||
"version": "0.0.0-next-fb4a1f2a7bd24298659048854c23ace5519cc4c8", | ||
"version": "0.0.0-next-fc7d8174c38f419f2dc8c5ffabd4d0943e284819", | ||
"repository": { | ||
@@ -44,3 +44,3 @@ "type": "git", | ||
"lint": "npm run eslint . && npm run prettier -- --check .", | ||
"depcheck": "depcheck", | ||
"depcheck": "compass-scripts check-peer-deps && depcheck", | ||
"check": "npm run typecheck && npm run lint && npm run depcheck", | ||
@@ -54,11 +54,7 @@ "check-ci": "npm run check", | ||
}, | ||
"optionalDependencies": { | ||
"@electron/remote": "^2.1.1", | ||
"electron": "^28.1.4" | ||
}, | ||
"devDependencies": { | ||
"@mongodb-js/eslint-config-compass": "0.0.0-next-fb4a1f2a7bd24298659048854c23ace5519cc4c8", | ||
"@mongodb-js/mocha-config-compass": "0.0.0-next-fb4a1f2a7bd24298659048854c23ace5519cc4c8", | ||
"@mongodb-js/prettier-config-compass": "0.0.0-next-fb4a1f2a7bd24298659048854c23ace5519cc4c8", | ||
"@mongodb-js/tsconfig-compass": "0.0.0-next-fb4a1f2a7bd24298659048854c23ace5519cc4c8", | ||
"@mongodb-js/eslint-config-compass": "0.0.0-next-fc7d8174c38f419f2dc8c5ffabd4d0943e284819", | ||
"@mongodb-js/mocha-config-compass": "0.0.0-next-fc7d8174c38f419f2dc8c5ffabd4d0943e284819", | ||
"@mongodb-js/prettier-config-compass": "0.0.0-next-fc7d8174c38f419f2dc8c5ffabd4d0943e284819", | ||
"@mongodb-js/tsconfig-compass": "0.0.0-next-fc7d8174c38f419f2dc8c5ffabd4d0943e284819", | ||
"@types/chai": "^4.2.21", | ||
@@ -77,3 +73,7 @@ "@types/mocha": "^9.0.0", | ||
}, | ||
"gitHead": "fb4a1f2a7bd24298659048854c23ace5519cc4c8" | ||
"dependencies": { | ||
"@electron/remote": "^2.1.2", | ||
"electron": "^30.4.0" | ||
}, | ||
"gitHead": "fc7d8174c38f419f2dc8c5ffabd4d0943e284819" | ||
} |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
46490
159
+ Added@electron/remote@^2.1.2
+ Addedelectron@^30.4.0
+ Added@types/node@20.17.12(transitive)
+ Addedelectron@30.5.1(transitive)
+ Addedundici-types@6.19.8(transitive)
- Removed@types/node@18.19.70(transitive)
- Removedelectron@28.3.3(transitive)
- Removedundici-types@5.26.5(transitive)