fix(core): update

This commit is contained in:
2021-05-17 15:46:59 +00:00
parent 6477b8a375
commit 40d12bc91e
10 changed files with 110 additions and 34 deletions

View File

@ -1,9 +1,9 @@
import { IModuleLicenseResult } from "./interfaces";
import { IModuleLicenseResult } from './interfaces';
export class CheckResult {
passingModules: IModuleLicenseResult[] = [];
failingModules: IModuleLicenseResult[] = [];
public addPassing(moduleResultArg: IModuleLicenseResult) {
this.passingModules.push(moduleResultArg);
}
@ -11,4 +11,4 @@ export class CheckResult {
public addFailing(moduleResultArg: IModuleLicenseResult) {
this.failingModules.push(moduleResultArg);
}
}
}

View File

@ -7,7 +7,7 @@ export class LicenseChecker {
async excludeLicenseWithinPath(pathArg: string, licenseArrayArg: string[]) {
const checkResult = new CheckResult();
const plainResultArray = await this.createPlainResultArray(pathArg);
plainResultArray.forEach(licenseResult => {
plainResultArray.forEach((licenseResult) => {
if (licenseArrayArg.indexOf(licenseResult.license) === -1) {
checkResult.addPassing(licenseResult);
} else {
@ -20,7 +20,7 @@ export class LicenseChecker {
async includeLicencesWithinPath(pathArg: string, licenseArrayArg: string[]) {
const checkResult = new CheckResult();
const plainResultArray = await this.createPlainResultArray(pathArg);
plainResultArray.forEach(licenseResult => {
plainResultArray.forEach((licenseResult) => {
if (licenseArrayArg.indexOf(licenseResult.license) !== -1) {
checkResult.addPassing(licenseResult);
} else {
@ -42,7 +42,7 @@ export class LicenseChecker {
license: refObject.licenses,
path: refObject.path,
publisher: refObject.publisher,
repository: refObject.repository
repository: refObject.repository,
});
}
return resultArray;
@ -52,7 +52,7 @@ export class LicenseChecker {
const done = plugins.smartpromise.defer<any>();
licenseChecker.init(
{
start: checkPathArg
start: checkPathArg,
},
(err, licenseJson) => {
if (err) {

View File

@ -6,4 +6,4 @@ export interface IModuleLicenseResult {
email: string;
path: string;
licenseFile: string;
}
}