electron-info
Advanced tools
Comparing version 1.11.0 to 1.11.1
@@ -0,1 +1,7 @@ | ||
## [1.11.1](https://github.com/ffflorian/electron-info/compare/v1.11.0...v1.11.1) (2019-08-21) | ||
### Bug Fixes | ||
- Apply limit only once ([#31](https://github.com/ffflorian/electron-info/issues/31)) ([63f89d4](https://github.com/ffflorian/electron-info/commit/63f89d4)) | ||
# [1.11.0](https://github.com/ffflorian/electron-info/compare/v1.10.0...v1.11.0) (2019-08-20) | ||
@@ -2,0 +8,0 @@ |
@@ -58,3 +58,4 @@ export interface RawDeps { | ||
private getVersions; | ||
private limitReleases; | ||
private loadReleasesFile; | ||
} |
@@ -57,8 +57,5 @@ "use strict"; | ||
this.logger.log('Getting all releases:', { colored, formatted }); | ||
let allReleases = yield this.getReleases(); | ||
if (this.options.limit) { | ||
this.logger.log('Limiting found versions', { limit: this.options.limit }); | ||
allReleases = allReleases.slice(0, this.options.limit); | ||
} | ||
return formatted ? this.formatReleases(allReleases, colored) : allReleases; | ||
const allReleases = yield this.getReleases(); | ||
const limitedReleases = this.limitReleases(allReleases, this.options.limit); | ||
return formatted ? this.formatReleases(limitedReleases, colored) : limitedReleases; | ||
}); | ||
@@ -69,6 +66,7 @@ } | ||
this.logger.log('Getting dependency releases:', { colored, dependency, formatted, version }); | ||
const allReleases = yield this.getAllReleases(false); | ||
const allReleases = yield this.getReleases(); | ||
const dependencyVersions = yield this.getVersions(allReleases, dependency, version); | ||
const filteredReleases = allReleases.filter(release => release.deps && dependencyVersions.includes(release.deps[dependency])); | ||
return formatted ? this.formatDependencyReleases(filteredReleases, colored) : filteredReleases; | ||
const limitedReleases = this.limitReleases(filteredReleases, this.options.limit); | ||
return formatted ? this.formatDependencyReleases(limitedReleases, colored) : limitedReleases; | ||
}); | ||
@@ -79,6 +77,7 @@ } | ||
this.logger.log('Getting Electron releases:', { colored, formatted, version }); | ||
const allReleases = yield this.getAllReleases(false); | ||
const allReleases = yield this.getReleases(); | ||
const electronVersions = yield this.getVersions(allReleases, 'electron', version); | ||
const filteredReleases = allReleases.filter(release => electronVersions.includes(release.version)); | ||
return formatted ? this.formatReleases(filteredReleases, colored) : filteredReleases; | ||
const limitedReleases = this.limitReleases(filteredReleases, this.options.limit); | ||
return formatted ? this.formatReleases(limitedReleases, colored) : limitedReleases; | ||
}); | ||
@@ -120,5 +119,5 @@ } | ||
const { data: releases } = yield axios_1.default.get(downloadUrl); | ||
this.logger.info('Received data from server:', `${util_1.inspect(releases, { breakLength: Infinity, sorted: true }) | ||
this.logger.info('Received data from server:', util_1.inspect(releases) | ||
.toString() | ||
.slice(0, 40)}...`); | ||
.slice(0, 40), '...'); | ||
if (!Array.isArray(releases)) { | ||
@@ -218,9 +217,17 @@ throw new Error('Invalid data received from server'); | ||
.map(release => (key === 'electron' ? release.version : release.deps[key])); | ||
if (this.options.limit) { | ||
this.logger.log('Limiting found versions', { limit: this.options.limit }); | ||
dependencyVersions = dependencyVersions.slice(0, this.options.limit); | ||
} | ||
return dependencyVersions; | ||
}); | ||
} | ||
limitReleases(releases, limit) { | ||
if (limit) { | ||
const slicedArray = releases.slice(0, limit); | ||
this.logger.log('Limiting found versions', { | ||
after: slicedArray.length, | ||
before: releases.length, | ||
limit, | ||
}); | ||
return slicedArray; | ||
} | ||
return releases; | ||
} | ||
loadReleasesFile(localPath) { | ||
@@ -227,0 +234,0 @@ return __awaiter(this, void 0, void 0, function* () { |
@@ -37,3 +37,3 @@ { | ||
"ts-node": "8.3.0", | ||
"tslint": "5.18.0", | ||
"tslint": "5.19.0", | ||
"tslint-config-prettier": "1.18.0", | ||
@@ -94,3 +94,3 @@ "tslint-plugin-prettier": "2.0.1", | ||
}, | ||
"version": "1.11.0" | ||
"version": "1.11.1" | ||
} |
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
47501
401