Skip to content

Commit

Permalink
refactor: do not monkeypatch fs
Browse files Browse the repository at this point in the history
  • Loading branch information
malept committed Apr 30, 2019
1 parent be84cbb commit ad760c2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const fs = require('fs')
const path = require('path')
const { promisify } = require('util')

fs.readFile = promisify(fs.readFile)
const readFile = promisify(fs.readFile)

const CHECKSUM_LINE = /^([\da-fA-F]+) ([ *])(.+)$/

Expand Down Expand Up @@ -94,7 +94,7 @@ class ChecksumValidator {

async readFile (filename, binary) {
debug(`Reading "${filename} (binary mode: ${binary})"`)
return fs.readFile(filename, this.encoding(binary))
return readFile(filename, this.encoding(binary))
}

async validate (baseDir, filesToCheck) {
Expand Down

0 comments on commit ad760c2

Please sign in to comment.