Skip to content

Commit

Permalink
refactor(lib): use canonical join instead of literal slash symbol
Browse files Browse the repository at this point in the history
  • Loading branch information
micalevisk committed Apr 23, 2023
1 parent 19606fd commit dd5962e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/readers/file-system.reader.ts
@@ -1,4 +1,5 @@
import * as fs from 'fs';
import * as path from 'path';
import { Reader } from './reader';

export class FileSystemReader implements Reader {
Expand All @@ -9,7 +10,7 @@ export class FileSystemReader implements Reader {
}

public read(name: string): Promise<string> {
return fs.promises.readFile(`${this.directory}/${name}`, 'utf8');
return fs.promises.readFile(path.join(this.directory, name), 'utf8');
}

public async readAnyOf(filenames: string[]): Promise<string | undefined> {
Expand Down

0 comments on commit dd5962e

Please sign in to comment.