New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More

gear

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gear - npm Package Compare versions

Comparing version

to
0.7.0

@@ -29,2 +29,3 @@ /*

new gear.Queue({registry: new gear.Registry({module: 'gear-lib'})})

@@ -34,2 +35,4 @@ .load(namespace)

.concat()
.jslint({callback: function(blob) {
}})
.tasks({

@@ -36,0 +39,0 @@ dev: {task: ['write', 'build/gear.js']},

@@ -27,32 +27,31 @@ /*

var content = '',
props = {};
var result = '',
props = {},
self = this;
parts.forEach(function(part) {
content += part;
result += part;
var attr;
if (typeof part === 'object') {
for (attr in part) {
if (part instanceof Blob) {
Object.keys(part).forEach(function(attr) {
props[attr] = part[attr];
}
});
}
});
var attr;
for (attr in properties) {
Object.keys(properties).forEach(function(attr) {
props[attr] = properties[attr];
}
});
Object.defineProperty(this, '_content', {get: function() {
return content;
}});
Object.keys(props).forEach(function(attr) {
if (attr !== 'result') {
Object.defineProperty(self, attr, {enumerable: true, value: props[attr]});
}
});
Object.defineProperty(this, 'properties', {get: function() {
return props;
}});
Object.defineProperty(this, 'result', {value: result});
};
Blob.prototype.toString = function() {
return this._content;
return this.result;
};

@@ -59,0 +58,0 @@

@@ -38,5 +38,5 @@ /*

// Task type determines how blobs are processed
switch (task.type) {
case 'append': // Add blobs to queue
// Task parameters determine how blobs are processed
switch (task.length) {
case 2: // Add blobs to queue
if (options === undefined) {

@@ -55,7 +55,13 @@ options = [];

case 'iterate': // Task can look at all blobs at once
task.call(this, options, blobs, done);
case 3:
if (task.type === 'collect') { // Task can look at all blobs at once
task.call(this, options, blobs, done);
} else if (task.type === 'slice') { // Select up to options.length blobs
async.map(blobs.slice(0, Array.isArray(options) ? options.length : 1), task.bind(this, options), done);
} else { // Transform blob on a per task basis
async.map(blobs, task.bind(this, options), done);
}
break;
case 'reduce': // Reduce blobs operating on a per task basis
case 4: // Reduce blobs operating on a per task basis
async.reduce(blobs, new Blob(), task.bind(this, options), function(err, results) {

@@ -65,10 +71,2 @@ done(err, [results]);

break;
case 'slice': // Select up to options.length blobs
async.map(blobs.slice(0, Array.isArray(options) ? options.length : 1), task.bind(this, options), done);
break;
default: // Transform blob on a per task basis
async.map(blobs, task.bind(this, options), done);
break;
}

@@ -75,0 +73,0 @@ };

@@ -15,7 +15,6 @@ /*

*/
var concat = exports.concat = function concat(options, prev, blob, done) {
exports.concat = function(options, prev, blob, done) {
options = options || {};
done(null, new blob.constructor([prev, options.callback ? options.callback(blob) : blob]));
};
concat.type = 'reduce';
})(typeof exports === 'undefined' ? gear.tasks : exports);

@@ -16,6 +16,5 @@ /*

*/
var load = exports.load = function load(string, done) {
exports.load = function(string, done) {
done(null, new Blob(string));
};
load.type = 'append';

@@ -32,3 +31,3 @@ /**

};
get.type = 'iterate';
get.type = 'collect';

@@ -46,3 +45,3 @@ /**

};
log.type = 'iterate';
log.type = 'collect';

@@ -58,6 +57,5 @@ /**

var self = this;
this._log('INSPECT: ' + blobs.length + (blobs.length > 1 ? ' blobs' : ' blob'));
blobs.forEach(function(blob, index) {
self._log(blob.toString());
self._log('blob ' + (index + 1) + ': ' + JSON.stringify(blob, null, ' '));
});

@@ -67,3 +65,3 @@

};
inspect.type = 'iterate';
inspect.type = 'collect';

@@ -77,5 +75,5 @@ /**

*/
var noop = exports.noop = function noop(dummy, blob, done) {
exports.noop = function(dummy, blob, done) {
done(null, blob);
};
})(typeof exports === 'undefined' ? gear.tasks : exports);

@@ -17,3 +17,3 @@ /*

*/
var read = exports.read = function read(options, done) {
exports.read = function(options, done) {
options = (typeof options === 'string') ? {name: options} : options;

@@ -23,3 +23,2 @@ var encoding = options.encoding || 'utf8';

};
read.type = 'append';
})(typeof exports === 'undefined' ? gear.tasks : exports);

@@ -73,3 +73,3 @@ /*

};
tasks.type = 'iterate';
tasks.type = 'collect';
})(typeof exports === 'undefined' ? gear.tasks : exports);
{
"name": "gear",
"version": "0.6.1",
"version": "0.7.0",
"description": "Gear.js - Task-based build system.",

@@ -17,4 +17,4 @@ "author": "Stephen Murphy <stephen@hypernaut.com>",

"mocha": "1.0.x",
"gear-lib": ">= 0.4.x"
"gear-lib": ">= 0.7.x"
}
}