Comparing version 0.1.0 to 0.1.1
{ | ||
"name": "treegulp", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "treegulp provides a shorthand for organizing your gulp tasks into a dependency tree.", | ||
@@ -5,0 +5,0 @@ "main": "treegulp.js", |
@@ -5,3 +5,5 @@ var gulp = require('gulp'); | ||
var treegulp = function() { | ||
var i, result = {}; | ||
var i, | ||
args = Array.prototype.slice.call(arguments), // Make a real Array. | ||
result = {}; | ||
result.names = []; | ||
@@ -11,27 +13,22 @@ result.dependencies = []; | ||
for (i = 0; i < arguments.length; ++i) { | ||
var argument = arguments[i]; | ||
var argument = arguments[i]; | ||
// Have to loop primitively because 'args' may grow in the loop. | ||
for (i = 0; i < args.length; ++i) { | ||
var argument = args[i]; | ||
// If the argument is a string, treat it as a name. | ||
if (typeof argument === 'string') { | ||
result.names.push(argument); | ||
} | ||
else if (typeof argument === 'object') { | ||
// Gather the argument into a list, whatever it is. | ||
var dependencyList; | ||
if (Array.isArray(argument)) { | ||
dependencyList = argument; | ||
} | ||
else { | ||
dependencyList = [argument]; | ||
} | ||
// Add each dependency's first name to the dependencies. | ||
for (j = 0; j < dependencyList.length; ++j) { | ||
result.dependencies.push(dependencyList[j].names[0]); | ||
} | ||
} | ||
// If it's a function, use it as a callback method. | ||
else if (typeof argument === 'function') { | ||
result.methods.push(argument); | ||
} | ||
// If it's an array, add each element into args to process later. | ||
else if (Array.isArray(argument)) { | ||
args = args.concat(argument); | ||
} | ||
// Objects are assumed to be of the form returned by this function. | ||
else if (typeof argument === 'object') { | ||
result.dependencies.push(argument); | ||
} | ||
} | ||
@@ -38,0 +35,0 @@ |
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 README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
11626
6
1
123
86