Skip to content

Commit

Permalink
Merge pull request #6 from bholloway/remove-overzealous-decode-check
Browse files Browse the repository at this point in the history
Remove overzealous decode check
  • Loading branch information
bholloway authored Feb 13, 2019
2 parents b2c8bf2 + 080db0e commit 179d8be
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 11 deletions.
4 changes: 2 additions & 2 deletions lib/process/debug-message.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

const PACKAGE_NAME = require('../../package.json').name,
PADDING = (new Array(11)).join(' ');
var PACKAGE_NAME = require('../../package.json').name,
PADDING = (new Array(11)).join(' ');

/**
* Format a debug message
Expand Down
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
2 changes: 1 addition & 1 deletion lib/process/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var debugMessage = require('./debug-message'),
encodeSourcesWith = require('./encode-sources-with'),
testCodec = require('./test-codec');

const CODECS = require('../../codec');
var CODECS = require('../../codec');

/**
* Process the given source-map per the given options.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "adjust-sourcemap-loader",
"version": "1.2.0",
"version": "2.0.0-alpha.1",
"description": "Webpack loader that adjusts source maps",
"main": "index.js",
"repository": {
Expand Down

0 comments on commit 179d8be

Please sign in to comment.