@electron/get
Advanced tools
Comparing version 1.0.2 to 1.0.3
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var utils_1 = require("./utils"); | ||
var BASE_URL = 'https://github.com/electron/electron/releases/download/'; | ||
@@ -12,2 +13,4 @@ var NIGHTLY_BASE_URL = 'https://github.com/electron/nightlies/releases/download/'; | ||
if (usage === void 0) { usage = FileNameUse.LOCAL; } | ||
utils_1.ensureIsTruthyString(details, 'artifactName'); | ||
utils_1.ensureIsTruthyString(details, 'version'); | ||
if (details.isGeneric) { | ||
@@ -21,2 +24,4 @@ // When downloading we have to use the artifact name directly as that it was is stored in the release on GitHub | ||
} | ||
utils_1.ensureIsTruthyString(details, 'platform'); | ||
utils_1.ensureIsTruthyString(details, 'arch'); | ||
return [details.artifactName, details.version, details.platform, details.arch].join('-') + ".zip"; | ||
@@ -23,0 +28,0 @@ } |
@@ -81,2 +81,3 @@ "use strict"; | ||
artifactDetails = __assign({}, _artifactDetails); | ||
utils_1.ensureIsTruthyString(artifactDetails, 'version'); | ||
artifactDetails.version = utils_1.normalizeVersion(artifactDetails.version); | ||
@@ -83,0 +84,0 @@ fileName = artifact_utils_1.getArtifactFileName(artifactDetails); |
@@ -17,1 +17,2 @@ export declare function withTempDirectory<T>(fn: (directory: string) => Promise<T>): Promise<T>; | ||
export declare function getNodeArch(arch: string): string; | ||
export declare function ensureIsTruthyString<T, K extends keyof T>(obj: T, key: K): void; |
@@ -121,2 +121,8 @@ "use strict"; | ||
exports.getNodeArch = getNodeArch; | ||
function ensureIsTruthyString(obj, key) { | ||
if (!obj[key] || typeof obj[key] !== 'string') { | ||
throw new Error("Expected property \"" + key + "\" to be provided as a string but it was not"); | ||
} | ||
} | ||
exports.ensureIsTruthyString = ensureIsTruthyString; | ||
//# sourceMappingURL=utils.js.map |
@@ -0,1 +1,2 @@ | ||
import { ensureIsTruthyString } from './utils'; | ||
var BASE_URL = 'https://github.com/electron/electron/releases/download/'; | ||
@@ -10,2 +11,4 @@ var NIGHTLY_BASE_URL = 'https://github.com/electron/nightlies/releases/download/'; | ||
if (usage === void 0) { usage = FileNameUse.LOCAL; } | ||
ensureIsTruthyString(details, 'artifactName'); | ||
ensureIsTruthyString(details, 'version'); | ||
if (details.isGeneric) { | ||
@@ -19,2 +22,4 @@ // When downloading we have to use the artifact name directly as that it was is stored in the release on GitHub | ||
} | ||
ensureIsTruthyString(details, 'platform'); | ||
ensureIsTruthyString(details, 'arch'); | ||
return [details.artifactName, details.version, details.platform, details.arch].join('-') + ".zip"; | ||
@@ -21,0 +26,0 @@ } |
@@ -51,3 +51,3 @@ var __assign = (this && this.__assign) || function () { | ||
import { getDownloaderForSystem } from './downloader-resolver'; | ||
import { withTempDirectory, normalizeVersion, getHostArch } from './utils'; | ||
import { withTempDirectory, normalizeVersion, getHostArch, ensureIsTruthyString } from './utils'; | ||
export { getHostArch } from './utils'; | ||
@@ -78,2 +78,3 @@ var sumchecker = require('sumchecker'); | ||
artifactDetails = __assign({}, _artifactDetails); | ||
ensureIsTruthyString(artifactDetails, 'version'); | ||
artifactDetails.version = normalizeVersion(artifactDetails.version); | ||
@@ -80,0 +81,0 @@ fileName = getArtifactFileName(artifactDetails); |
@@ -17,1 +17,2 @@ export declare function withTempDirectory<T>(fn: (directory: string) => Promise<T>): Promise<T>; | ||
export declare function getNodeArch(arch: string): string; | ||
export declare function ensureIsTruthyString<T, K extends keyof T>(obj: T, key: K): void; |
@@ -114,2 +114,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
} | ||
export function ensureIsTruthyString(obj, key) { | ||
if (!obj[key] || typeof obj[key] !== 'string') { | ||
throw new Error("Expected property \"" + key + "\" to be provided as a string but it was not"); | ||
} | ||
} | ||
//# sourceMappingURL=utils.js.map |
{ | ||
"name": "@electron/get", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Utility for downloading artifacts from different versions of Electron", | ||
@@ -5,0 +5,0 @@ "main": "dist/cjs/index.js", |
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
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
79106
1202
15