Skip to content

Commit

Permalink
Merge pull request #2549 from apeltop/fix-typo
Browse files Browse the repository at this point in the history
refactor: fix typo
  • Loading branch information
kamilmysliwiec committed Mar 19, 2024
2 parents d6587f1 + a1ef593 commit 217d9e4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions lib/configuration/nest-configuration.loader.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Reader, ReaderFileLackPersmissionsError } from '../readers';
import { Reader, ReaderFileLackPermissionsError } from '../readers';
import { Configuration } from './configuration';
import { ConfigurationLoader } from './configuration.loader';
import { defaultConfiguration } from './defaults';
Expand Down Expand Up @@ -33,9 +33,9 @@ export class NestConfigurationLoader implements ConfigurationLoader {
]);

if (contentOrError) {
const isMissingPersmissionsError =
contentOrError instanceof ReaderFileLackPersmissionsError;
if (isMissingPersmissionsError) {
const isMissingPermissionsError =
contentOrError instanceof ReaderFileLackPermissionsError;
if (isMissingPermissionsError) {
console.error(contentOrError.message);
process.exit(1);
}
Expand Down
6 changes: 3 additions & 3 deletions lib/readers/file-system.reader.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as fs from 'fs';
import * as path from 'path';
import { Reader, ReaderFileLackPersmissionsError } from './reader';
import { Reader, ReaderFileLackPermissionsError } from './reader';

export class FileSystemReader implements Reader {
constructor(private readonly directory: string) {}
Expand All @@ -15,7 +15,7 @@ export class FileSystemReader implements Reader {

public readAnyOf(
filenames: string[],
): string | undefined | ReaderFileLackPersmissionsError {
): string | undefined | ReaderFileLackPermissionsError {
let firstFilePathFoundButWithInsufficientPermissions: string | undefined;

for (let id = 0; id < filenames.length; id++) {
Expand All @@ -41,7 +41,7 @@ export class FileSystemReader implements Reader {
}

if (firstFilePathFoundButWithInsufficientPermissions) {
return new ReaderFileLackPersmissionsError(
return new ReaderFileLackPermissionsError(
firstFilePathFoundButWithInsufficientPermissions,
readErr.code,
);
Expand Down
4 changes: 2 additions & 2 deletions lib/readers/reader.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export class ReaderFileLackPersmissionsError extends Error {
export class ReaderFileLackPermissionsError extends Error {
constructor(
public readonly filePath: string,
public readonly fsErrorCode: string,
Expand All @@ -12,5 +12,5 @@ export interface Reader {
read(name: string): string;
readAnyOf(
filenames: string[],
): string | undefined | ReaderFileLackPersmissionsError;
): string | undefined | ReaderFileLackPermissionsError;
}

0 comments on commit 217d9e4

Please sign in to comment.