Comparing version 0.3.0 to 0.3.1
@@ -1,3 +0,10 @@ | ||
# [Unreleased](https://github.com/G-Rath/audit-app/compare/v0.3.0...HEAD) (2020-09-18) | ||
# [Unreleased](https://github.com/G-Rath/audit-app/compare/v0.3.1...HEAD) (YYYY-MM-DD) | ||
# [0.3.1](https://github.com/G-Rath/audit-app/compare/v0.3.0...v0.3.1) (2020-09-19) | ||
### Bug Fixes | ||
- adjust imports to slightly reduce package size ([3dcd1f6d][]) | ||
- use singular or plural form for words based on related counts ([7f3c0c9c][]) | ||
# [0.3.0](https://github.com/G-Rath/audit-app/compare/v0.2.0...v0.3.0) (2020-09-18) | ||
@@ -30,2 +37,4 @@ | ||
[3dcd1f6d]: https://github.com/G-Rath/audit-app/commit/3dcd1f6d | ||
[7f3c0c9c]: https://github.com/G-Rath/audit-app/commit/7f3c0c9c | ||
[bfda8ade]: https://github.com/G-Rath/audit-app/commit/bfda8ade | ||
@@ -32,0 +41,0 @@ [f898766e]: https://github.com/G-Rath/audit-app/commit/f898766e |
@@ -15,2 +15,12 @@ "use strict"; | ||
]; | ||
const PluralToSingularMap = { | ||
vulnerabilities: 'vulnerability', | ||
packages: 'package' | ||
}; | ||
const wordWithCount = (count, word, countColor) => { | ||
var _a; | ||
const countString = (_a = countColor === null || countColor === void 0 ? void 0 : countColor(count)) !== null && _a !== void 0 ? _a : count; | ||
const wordString = count === 1 ? PluralToSingularMap[word] : word; | ||
return `${countString} ${wordString}`; | ||
}; | ||
const countStr = (str) => strip_ansi_1.default(str).length; | ||
@@ -100,11 +110,9 @@ const pad = (str) => ` ${str.trim()} `; | ||
const buildReportSummary = (report) => { | ||
var _a; | ||
const { statistics: { dependencies, // | ||
severities, vulnerable, ignored } } = report; | ||
const { statistics: { dependencies: { totalDependencies = '"some"' }, severities, vulnerable, ignored } } = report; | ||
return [ | ||
[ | ||
'', | ||
`found ${severityColors[getHighestSeverity(severities)](severities.total)} vulnerabilities`, | ||
`found ${wordWithCount(severities.total, 'vulnerabilities', severityColors[getHighestSeverity(severities)])}`, | ||
`(including ${ignored.total} ignored)`, | ||
`across ${(_a = dependencies.totalDependencies) !== null && _a !== void 0 ? _a : '"some"'} packages` | ||
`across ${wordWithCount(totalDependencies, 'packages')}` | ||
], | ||
@@ -111,0 +119,0 @@ vulnerable.total && [ |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -27,3 +8,3 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
const fs_1 = __importDefault(require("fs")); | ||
const path = __importStar(require("path")); | ||
const path_1 = __importDefault(require("path")); | ||
const yargs_1 = __importDefault(require("yargs/yargs")); | ||
@@ -47,3 +28,3 @@ const audit_1 = require("./audit"); | ||
const parseConfigFile = (filepath) => { | ||
const ext = path.parse(filepath).ext.substr(1); | ||
const ext = path_1.default.parse(filepath).ext.substr(1); | ||
if (ext !== 'json') { | ||
@@ -98,3 +79,3 @@ throw new Error(`Unsupported file type "${ext}"`); | ||
.strict(); | ||
const pathToDefaultConfig = path.join(argv.directory, DefaultConfigFile); | ||
const pathToDefaultConfig = path_1.default.join(argv.directory, DefaultConfigFile); | ||
if (!configPath && | ||
@@ -101,0 +82,0 @@ argv.config && |
{ | ||
"name": "audit-app", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "A cli tool for auditing apps & packages using their respective package managers.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
37562
533