Skip to content

Commit

Permalink
Breaking: Rename stripBOM option to removeBOM
Browse files Browse the repository at this point in the history
  • Loading branch information
phated committed Nov 30, 2017
1 parent d5014e4 commit bfb56cd
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/src/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var config = {
since: {
type: 'date',
},
stripBOM: {
removeBOM: {
type: 'boolean',
default: true,
},
Expand Down
4 changes: 2 additions & 2 deletions lib/src/read-contents/read-buffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ function bufferFile(file, optResolver, onRead) {
return onRead(readErr);
}

var stripBOM = optResolver.resolve('stripBOM', file);
if (stripBOM) {
var removeBOM = optResolver.resolve('removeBOM', file);
if (removeBOM) {
file.contents = removeBomBuffer(data);
} else {
file.contents = data;
Expand Down
4 changes: 2 additions & 2 deletions lib/src/read-contents/read-stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ function streamFile(file, optResolver, onRead) {

var filePath = file.path;

var stripBOM = optResolver.resolve('stripBOM', file);
var removeBOM = optResolver.resolve('removeBOM', file);

file.contents = new lazystream.Readable(function() {
var contents = fs.createReadStream(filePath);

if (stripBOM) {
if (removeBOM) {
return contents.pipe(removeBomStream());
}

Expand Down
2 changes: 1 addition & 1 deletion test/src.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ describe('.src()', function() {
}

pipe([
vfs.src(bomInputPath, { stripBOM: false }),
vfs.src(bomInputPath, { removeBOM: false }),
concat(assert),
], done);
});
Expand Down

0 comments on commit bfb56cd

Please sign in to comment.