gulp-buddy.js
Advanced tools
Comparing version 0.1.3 to 1.0.0
34
index.js
@@ -7,2 +7,3 @@ 'use strict'; | ||
var hookStdio = require('hook-stdio'); | ||
var extend = require('util-extend'); | ||
var Detector = require('buddy.js/lib/detector'); | ||
@@ -13,8 +14,8 @@ var reporters = require('buddy.js/lib/reporters'); | ||
switch(reporter) { | ||
case "simple": | ||
return (output.indexOf("No magic numbers found") > -1); | ||
case "detailed": | ||
return (output.indexOf("No magic numbers found") > -1); | ||
case "json": | ||
return output === "[]"; | ||
case 'simple': | ||
return (output.indexOf('No magic numbers found') > -1); | ||
case 'detailed': | ||
return (output.indexOf('No magic numbers found') > -1); | ||
case 'json': | ||
return output === '[]'; | ||
default: | ||
@@ -28,8 +29,11 @@ return true; | ||
options = options || {}; | ||
options.ignore = options.ignore || [0, 1]; | ||
options.disableIgnore = options.disableIgnore || false; | ||
options.reporter = options.reporter || "simple"; | ||
options.enforceConst = options.enforceConst || false; | ||
options.noColor = options.noColor || false; | ||
options = extend({ | ||
ignore: [0, 1], | ||
disableIgnore: false, | ||
detectObjects: false, | ||
reporter: 'simple', | ||
enforceConst: false, | ||
noColor: false | ||
}, options); | ||
options.ignore = options.disableIgnore ? [] : options.ignore; | ||
@@ -40,4 +44,2 @@ if (options.noColor) { | ||
var ignore = options.disableIgnore ? [] : options.ignore; | ||
return through.obj(function (file, enc, cb) { | ||
@@ -57,6 +59,6 @@ if (file.isNull()) { | ||
var detector = new Detector(paths, options.enforceConst, ignore); | ||
var detector = new Detector(paths, options); | ||
var reporter = new reporters[options.reporter](detector); | ||
var output = ""; | ||
var output = ''; | ||
var unhook = hookStdio.stdout(function(string) { | ||
@@ -63,0 +65,0 @@ output += string; |
{ | ||
"name": "gulp-buddy.js", | ||
"version": "0.1.3", | ||
"version": "1.0.0", | ||
"description": "Gulp plugin for running buddy.js", | ||
@@ -38,4 +38,5 @@ "license": "MIT", | ||
"hook-stdio": "^1.0.0", | ||
"through2": "^0.6.1" | ||
"through2": "^0.6.1", | ||
"util-extend": "^1.0.1" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
65
0
4861
6
+ Addedutil-extend@^1.0.1
+ Addedutil-extend@1.0.3(transitive)