electron-builder-util
Advanced tools
Comparing version 19.4.1 to 19.4.2
@@ -0,1 +1,23 @@ | ||
declare module "electron-builder-util/out/promise" { | ||
import BluebirdPromise from "bluebird-lst" | ||
export function printErrorAndExit(error: Error): void | ||
export function executeFinally<T>(promise: Promise<T>, task: (errorOccurred: boolean) => Promise<any>): Promise<T> | ||
export class NestedError extends Error { | ||
constructor(errors: Array<Error>, message?: string) | ||
} | ||
export function all(promises: Array<Promise<any>>): BluebirdPromise<any> | ||
export function throwError(errors: Array<Error>): void | ||
export function asyncAll(tasks: Array<() => Promise<any>>): BluebirdPromise<any[]> | ||
export function orNullIfFileNotExist<T>(promise: Promise<T>): Promise<T | null> | ||
export function orIfFileNotExist<T>(promise: Promise<T>, fallbackValue: T): Promise<T> | ||
} | ||
declare module "electron-builder-util/out/log" { | ||
@@ -158,20 +180,2 @@ import BluebirdPromise from "bluebird-lst" | ||
declare module "electron-builder-util/out/promise" { | ||
import BluebirdPromise from "bluebird-lst" | ||
export function printErrorAndExit(error: Error): void | ||
export function executeFinally<T>(promise: Promise<T>, task: (errorOccurred: boolean) => Promise<any>): Promise<T> | ||
export class NestedError extends Error { | ||
constructor(errors: Array<Error>, message?: string) | ||
} | ||
export function all(promises: Array<Promise<any>>): BluebirdPromise<any> | ||
export function throwError(errors: Array<Error>): void | ||
export function asyncAll(tasks: Array<() => Promise<any>>): BluebirdPromise<any[]> | ||
} | ||
declare module "electron-builder-util/out/tmp" { | ||
@@ -178,0 +182,0 @@ |
@@ -22,11 +22,3 @@ "use strict"; | ||
var _ref = (0, (_bluebirdLst || _load_bluebirdLst()).coroutine)(function* (file) { | ||
try { | ||
return yield (0, (_fsExtraP || _load_fsExtraP()).stat)(file); | ||
} catch (e) { | ||
if (e.code === "ENOENT") { | ||
return null; | ||
} else { | ||
throw e; | ||
} | ||
} | ||
return (0, (_promise || _load_promise()).orNullIfFileNotExist)((0, (_fsExtraP || _load_fsExtraP()).stat)(file)); | ||
}); | ||
@@ -147,2 +139,8 @@ | ||
var _promise; | ||
function _load_promise() { | ||
return _promise = require("./promise"); | ||
} | ||
var _util; | ||
@@ -149,0 +147,0 @@ |
@@ -51,2 +51,4 @@ "use strict"; | ||
exports.asyncAll = asyncAll; | ||
exports.orNullIfFileNotExist = orNullIfFileNotExist; | ||
exports.orIfFileNotExist = orIfFileNotExist; | ||
@@ -92,2 +94,13 @@ var _chalk; | ||
} | ||
function orNullIfFileNotExist(promise) { | ||
return orIfFileNotExist(promise, null); | ||
} | ||
function orIfFileNotExist(promise, fallbackValue) { | ||
return promise.catch(e => { | ||
if (e.code === "ENOENT" || e.code === "ENOTDIR") { | ||
return fallbackValue; | ||
} | ||
throw e; | ||
}); | ||
} | ||
//# sourceMappingURL=promise.js.map |
{ | ||
"name": "electron-builder-util", | ||
"version": "19.4.1", | ||
"version": "19.4.2", | ||
"main": "out/util.js", | ||
@@ -22,3 +22,3 @@ "author": "Vladimir Krivosheev", | ||
"node-emoji": "^1.5.1", | ||
"electron-builder-http": "~19.4.0", | ||
"electron-builder-http": "~19.4.2", | ||
"source-map-support": "^0.4.15", | ||
@@ -25,0 +25,0 @@ "7zip-bin": "^2.1.0", |
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 7 instances in 1 package
117868
1240
26