Skip to content

Commit

Permalink
BREAKING (maybe) remove additional check that decoded source file exists
Browse files Browse the repository at this point in the history
  • Loading branch information
bholloway committed Aug 29, 2018
1 parent ea71b04 commit 0319bb2
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions lib/process/decode-sources-with.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
'use strict';

var fs = require('fs');

var getFieldAsFn = require('./get-field-as-fn');

/**
Expand Down Expand Up @@ -46,11 +44,7 @@ function decodeSourcesWith(codecs, mustDecode) {
}
// non-string implies error
if (typeof decoded !== 'string') {
return getNamedError('Decoder returned a truthy value but it is not a string file path:\n' + decoded);
}
// non-existant file implies error
else if (!fs.existsSync(decoded) || !fs.statSync(decoded).isFile()) {
return getNamedError('Cannot find file at absolute path:\n' + decoded);
return getNamedError('Decoder returned a truthy value but it is not a string:\n' + decoded);
}
// otherwise success
else {
Expand Down

0 comments on commit 0319bb2

Please sign in to comment.