Skip to content

Commit

Permalink
fix: auditer -> auditor (#323)
Browse files Browse the repository at this point in the history
  • Loading branch information
quinnturner committed Dec 10, 2023
1 parent c863fee commit bc67ffe
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 17 deletions.
14 changes: 7 additions & 7 deletions lib/audit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { yellow } from "./colors.js";
import { ReportConfig } from "./common.js";
import type { AuditCiFullConfig } from "./config.js";
import type { Summary } from "./model.js";
import * as npmAuditer from "./npm-auditer.js";
import * as pnpmAuditer from "./pnpm-auditer.js";
import * as yarnAuditer from "./yarn-auditer.js";
import * as npmAuditor from "./npm-auditor.js";
import * as pnpmAuditor from "./pnpm-auditor.js";
import * as yarnAuditor from "./yarn-auditor.js";

const PARTIAL_RETRY_ERROR_MSG = {
// The three ENOAUDIT error messages for NPM are:
Expand All @@ -20,16 +20,16 @@ const PARTIAL_RETRY_ERROR_MSG = {

function getAuditor(
packageManager: "npm" | "yarn" | "pnpm",
): typeof yarnAuditer | typeof npmAuditer | typeof pnpmAuditer {
): typeof yarnAuditor | typeof npmAuditor | typeof pnpmAuditor {
switch (packageManager) {
case "yarn": {
return yarnAuditer;
return yarnAuditor;
}
case "npm": {
return npmAuditer;
return npmAuditor;
}
case "pnpm": {
return pnpmAuditer;
return pnpmAuditor;
}
default: {
throw new Error(`Invalid package manager: ${packageManager}`);
Expand Down
6 changes: 3 additions & 3 deletions lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ export {
type VulnerabilityLevels,
} from "./map-vulnerability.js";
export type { Summary } from "./model.js";
export { audit as npmAudit } from "./npm-auditer.js";
export { audit as pnpmAudit } from "./pnpm-auditer.js";
export { audit as yarnAudit } from "./yarn-auditer.js";
export { audit as npmAudit } from "./npm-auditor.js";
export { audit as pnpmAudit } from "./pnpm-auditor.js";
export { audit as yarnAudit } from "./yarn-auditor.js";
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions test/npm-auditer.spec.ts → test/npm-auditor.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { NPMAuditReportV1 } from "audit-types";
import { describe, expect, it } from "vitest";
import Allowlist from "../lib/allowlist.js";
import { auditWithFullConfig, report } from "../lib/npm-auditer.js";
import { auditWithFullConfig, report } from "../lib/npm-auditor.js";
import {
config as baseConfig,
summaryWithDefault,
Expand Down Expand Up @@ -36,7 +36,7 @@ function config(

// To modify what slow times are, need to use
// function() {} instead of () => {}
describe("npm-auditer", () => {
describe("npm-auditor", () => {
it("prints full report with critical severity", () => {
const summary = report(
reportNpmCritical,
Expand Down
4 changes: 2 additions & 2 deletions test/npm7-auditer.spec.ts → test/npm7-auditor.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { NPMAuditReportV2 } from "audit-types";
import semver from "semver";
import { describe, expect, it } from "vitest";
import Allowlist from "../lib/allowlist.js";
import { auditWithFullConfig, report } from "../lib/npm-auditer.js";
import { auditWithFullConfig, report } from "../lib/npm-auditor.js";
import {
config as baseConfig,
summaryWithDefault,
Expand Down Expand Up @@ -38,7 +38,7 @@ function config(
return baseConfig({ ...additions, "package-manager": "npm" });
}

describe("npm7-auditer", () => {
describe("npm7-auditor", () => {
it("prints full report with critical severity", () => {
const summary = report(
reportNpmCritical,
Expand Down
4 changes: 2 additions & 2 deletions test/pnpm-auditer.spec.ts → test/pnpm-auditor.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, expect, it } from "vitest";
import Allowlist from "../lib/allowlist.js";
import { report } from "../lib/pnpm-auditer.js";
import { report } from "../lib/pnpm-auditor.js";
import {
config as baseConfig,
summaryWithDefault,
Expand All @@ -23,7 +23,7 @@ function config(

// To modify what slow times are, need to use
// function() {} instead of () => {}
describe("pnpm-auditer", () => {
describe("pnpm-auditor", () => {
it("prints full report with critical severity", () => {
const summary = report(
reportPnpmCritical,
Expand Down
2 changes: 1 addition & 1 deletion test/yarn-auditer.spec.ts → test/yarn-auditor.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const canRunYarnBerry = semver.gte(
// To modify what slow times are, need to use
// function() {} instead of () => {}
describe(
"yarn-auditer",
"yarn-auditor",
() => {
it("prints full report with critical severity", async () => {
const summary = await audit(
Expand Down

0 comments on commit bc67ffe

Please sign in to comment.