Skip to content

Commit

Permalink
Merge pull request #5 from Bargamut/master
Browse files Browse the repository at this point in the history
Replace gulp-util to plugin-error and some upgrade
  • Loading branch information
heldinz authored Sep 23, 2018
2 parents 90ae4cb + 07b3ea2 commit 05300e6
Show file tree
Hide file tree
Showing 5 changed files with 1,726 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: node_js
node_js:
- '0.10'
- '10'
after_script:
- npm run coveralls
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';
var gutil = require('gulp-util');
var pluginError = require('plugin-error');
var through = require('through2');
var iconv = require('iconv-lite');

Expand All @@ -10,7 +10,7 @@ module.exports = function (options) {
options = options || {};

if (!options.from && !options.to) {
throw new gutil.PluginError('gulp-convert-encoding', 'At least one of `from` or `to` required');
throw new pluginError('gulp-convert-encoding', 'At least one of `from` or `to` required');
}

options.from = options.from || UTF8;
Expand All @@ -33,7 +33,7 @@ module.exports = function (options) {
.pipe(iconv.encodeStream(options.to, options.iconv.encode));
this.push(file);
} catch (err) {
this.emit('error', new gutil.PluginError('gulp-convert-encoding', err));
this.emit('error', new pluginError('gulp-convert-encoding', err));
}
}

Expand All @@ -43,7 +43,7 @@ module.exports = function (options) {
file.contents = iconv.encode(content, options.to, options.iconv.encode);
this.push(file);
} catch (err) {
this.emit('error', new gutil.PluginError('gulp-convert-encoding', err));
this.emit('error', new pluginError('gulp-convert-encoding', err));
}
}

Expand Down
Loading

0 comments on commit 05300e6

Please sign in to comment.