Socket
Socket
Sign inDemoInstall

gulp-custom-filter

Package Overview
Dependencies
28
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.2.5 to 0.3.0

gulp-custom-filter.iml

46

gulpfile.js

@@ -1,2 +0,2 @@

var coveralls = require('gulp-coveralls');
var coveralls = require('@kollavarsham/gulp-coveralls');
var eslint = require('gulp-eslint');

@@ -7,25 +7,27 @@ var gulp = require('gulp');

gulp.task('test', ['test:pre', 'eslint'], function() {
return gulp.src('./test/**/*_spec.js')
.pipe(jasmine())
.pipe(istanbul.writeReports())
.pipe(istanbul.enforceThresholds({ thresholds: { global: 90 } }));
});
gulp.task('test:pre', () =>
gulp.src(['./index.js', './lib/**/*.js'])
.pipe(istanbul())
.pipe(istanbul.hookRequire())
);
gulp.task('test:pre', function() {
return gulp.src(['./index.js', './lib/**/*.js'])
.pipe(istanbul())
.pipe(istanbul.hookRequire());
});
gulp.task('test', gulp.series('test:pre', () =>
gulp.src('./test/**/*_spec.js')
.pipe(jasmine())
.pipe(istanbul.writeReports())
.pipe(istanbul.enforceThresholds({ thresholds: { global: 90 } }))
));
gulp.task('coveralls', function() {
return gulp.src('./coverage/**/lcov.info')
.pipe(coveralls());
});
gulp.task('coveralls', () =>
gulp.src('./coverage/**/lcov.info')
.pipe(coveralls())
);
gulp.task('eslint', function() {
return gulp.src(['index.js', './lib'])
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failOnError());
});
gulp.task('lint', () =>
gulp.src(['index.js', './lib'])
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failOnError())
);
exports.default = gulp.parallel('lint', 'test');
'use strict';
var gutil = require('gulp-util');
var PluginError = require('plugin-error');
function isFunction(fn, moduleName, targetName) {
if (!fn || typeof fn !== 'function') {
throw new gutil.PluginError('gulp-custom-filter' + (moduleName ? '.' + moduleName : ''),
throw new PluginError('gulp-custom-filter' + (moduleName ? '.' + moduleName : ''),
(targetName || fn) + ' must be a function');

@@ -14,3 +14,3 @@ }

if (!str || typeof str !== 'string') {
throw new gutil.PluginError('gulp-custom-filter' + (moduleName ? '.' + moduleName : ''),
throw new PluginError('gulp-custom-filter' + (moduleName ? '.' + moduleName : ''),
(targetName || str) + ' must be a string');

@@ -22,3 +22,3 @@ }

if (!strOrArr || (typeof strOrArr !== 'string' && !Array.isArray(strOrArr))) {
throw new gutil.PluginError('gulp-custom-filter' + (moduleName ? '.' + moduleName : ''),
throw new PluginError('gulp-custom-filter' + (moduleName ? '.' + moduleName : ''),
(targetName || strOrArr) + ' must be a string or an array');

@@ -25,0 +25,0 @@ }

@@ -5,5 +5,6 @@ 'use strict';

var assertIsStringOrArray = require('./assertions').isStringOrArray;
var colors = require('ansi-colors');
var fs = require('fs');
var gutil = require('gulp-util');
var ig = require('ignore');
var log = require('fancy-log');
var minimatch = require('minimatch');

@@ -27,3 +28,3 @@ var path = require('path');

if (err) {
gutil.log(gutil.colors.red('gulp-custom-filter.ignore: ' + err));
log(colors.red('gulp-custom-filter.ignore: ' + err));
error = err;

@@ -30,0 +31,0 @@ } else {

{
"name": "gulp-custom-filter",
"version": "0.2.5",
"version": "0.3.0",
"description": "A gulp plugin to filter files by customized filters",
"main": "index.js",
"scripts": {
"test": "gulp test",
"test": "gulp",
"coveralls": "gulp coveralls"

@@ -28,16 +28,20 @@ },

"devDependencies": {
"gulp": "^3.9",
"gulp-coveralls": "^0.1",
"gulp-eslint": "^2.0",
"gulp-istanbul": "^0.10",
"gulp-jasmine": "^2.3",
"mock-fs": "^3.8"
"@kollavarsham/gulp-coveralls": "^0.2.2",
"gulp": "^4.0",
"gulp-eslint": "^5.0",
"gulp-istanbul": "^1.1",
"gulp-jasmine": "^4.0",
"mock-fs": "^4.8",
"tempfile": "^2.0.0",
"vinyl": "^2.2.0"
},
"dependencies": {
"gulp-util": "^3.0",
"ignore": "^3.0",
"minimatch": "^3.0.2",
"promise": "^7.1",
"through2": "^2.0"
"ansi-colors": "^3.2",
"fancy-log": "^1.3",
"ignore": "^5.0",
"minimatch": "^3.0",
"plugin-error": "^1.0",
"promise": "^8.0",
"through2": "^3.0"
}
}

@@ -214,2 +214,8 @@ # gulp-custom-filter

* v0.3.0
* Update library dependency
* Update supporting version of Node.js
* Now we support Node 6 or higher
* v0.2.5

@@ -216,0 +222,0 @@

'use strict';
var Buffer = require('buffer').Buffer;
var Vinyl = require('vinyl');
var filter = require('../');
var gutil = require('gulp-util');
var path = require('path');

@@ -10,3 +10,3 @@

files: [
new gutil.File({
new Vinyl({
base: __dirname,

@@ -16,7 +16,7 @@ path: path.join(__dirname, 'a.js'),

}),
new gutil.File({
new Vinyl({
base: __dirname,
path: path.join(__dirname, 'b.js')
}),
new gutil.File({
new Vinyl({
base: __dirname,

@@ -26,3 +26,3 @@ path: path.join(__dirname, 'x.less'),

}),
new gutil.File({
new Vinyl({
base: __dirname,

@@ -29,0 +29,0 @@ path: path.join(__dirname, 'y.less')

@@ -6,3 +6,4 @@ 'use strict';

var fixture = require('./fixture.js');
var mock = require('mock-fs');
var fs = require('fs');
var tempfile = require('tempfile');

@@ -26,10 +27,15 @@ describe('pattern filters', function() {

describe('ignore()', function() {
beforeEach(function () {
mock({
'.myignore': '*.js\n!b.js'
});
var ignoreFile;
beforeEach(function(done) {
ignoreFile = tempfile('.myignore');
fs.writeFile(ignoreFile, '*.js\n!b.js', done);
});
afterEach(function(done) {
fs.unlink(ignoreFile, done);
});
it('should pass files which equals to ignore file, if file is succesfully loaded', function (done) {
check(fixture.files, filters.ignore('.myignore'), function (filenames) {
check(fixture.files, filters.ignore(ignoreFile), function (filenames) {
expect(filenames).toEqual(['b.js', 'x.less', 'y.less']);

@@ -52,7 +58,3 @@ done();

});
afterEach(function() {
mock.restore();
});
});
});

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc