Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function createDownloadOpts(opts: any, platform: string, arch: string, electronVersion: string) {
if (opts.download != null) {
warn(`"build.download is deprecated — please use build.electronDownload instead`)
}
const downloadOpts = Object.assign({
cache: opts.cache,
strictSSL: opts["strict-ssl"]
}, opts.electronDownload || opts.download)
subOptionWarning(downloadOpts, "download", "platform", platform)
subOptionWarning(downloadOpts, "download", "arch", arch)
subOptionWarning(downloadOpts, "download", "version", electronVersion)
return downloadOpts
}
function subOptionWarning (properties: any, optionName: any, parameter: any, value: any) {
if (properties.hasOwnProperty(parameter)) {
warn(`${optionName}.${parameter} will be inferred from the main options`)
}
properties[parameter] = value
}