Skip to content
Browse files

fix lint errors

  • Loading branch information...
1 parent 42143d9 commit 77930dba8d01d28cf541375488483c3903aa9c5e @caolan committed Mar 22, 2011
Showing with 13 additions and 9 deletions.
  1. +3 −3 index.html
  2. +9 −5 nimble.js
  3. +1 −1 nimble.min.js
View
6 index.html
@@ -238,7 +238,7 @@
<span class="download">
<strong>Download: </strong>
<a href="https://github.com/caolan/nimble/raw/master/nimble.js">Development</a> | <a href="https://github.com/caolan/nimble/raw/master/nimble.min.js">Production</a>
- <span class="size">(793 bytes, minified and gzipped)</span>
+ <span class="size">(794 bytes, minified and gzipped)</span>
</span>
<a href="https://github.com/caolan/nimble"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://d3nwyuy0nl342s.cloudfront.net/img/30f550e0d38ceb6ef5b81500c64d970b7fb0f028/687474703a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6f72616e67655f6666373630302e706e67" alt="Fork me on GitHub"></a>
@@ -517,12 +517,12 @@
<div class="section">
<h2>Nimble is small</h2>
<div id="sizegraph">
- <img src="https://chart.googleapis.com/chart?cht=bhs&chs=790x140&chd=t:3321,793|1859,0&chds=0,120&chco=4d89f9|00B88A,c6d9fd&chbh=60&chds=0,5500&chm=tunderscore,000000,0,0,16|tasync,000000,1,0,16|tnimble,000000,0,1,16" />
+ <img src="https://chart.googleapis.com/chart?cht=bhs&chs=790x140&chd=t:3321,794|1859,0&chds=0,120&chco=4d89f9|00B88A,c6d9fd&chbh=60&chds=0,5500&chm=tunderscore,000000,0,0,16|tasync,000000,1,0,16|tnimble,000000,0,1,16" />
</div>
<p>
By adding only the most frequently used features, and designing the code
with minification and gzip compression in mind, Nimble is able to fit into
- a tiny 793 bytes. Previously, I was including both underscore.js and
+ a tiny 794 bytes. Previously, I was including both underscore.js and
async.js, which adds up to over 5kb.
</p>
</div>
View
14 nimble.js
@@ -106,7 +106,7 @@
eachfn(obj, function (value, i, obj, callback) {
var args = [value, i, obj].slice(0, iterator.length - 1);
args[iterator.length - 1] = function (err, v) {
- results[results.length] = v
+ results[results.length] = v;
callback(err);
};
iterator.apply(this, args);
@@ -119,7 +119,9 @@
var filterSync = fallback('filter', function (obj, iterator, callback) {
var results = [];
eachSync(obj, function (v, k, obj) {
- iterator(v, k, obj) && (results[results.length] = v);
+ if (iterator(v, k, obj)) {
+ results[results.length] = v;
+ }
});
return results;
});
@@ -129,7 +131,9 @@
eachParallel(obj, function (value, k, obj, callback) {
var args = [value, k, obj].slice(0, iterator.length - 1);
args[iterator.length - 1] = function (err, a) {
- a && (results[results.length] = value);
+ if (a) {
+ results[results.length] = value;
+ }
callback(err);
};
iterator.apply(this, args);
@@ -148,7 +152,7 @@
var reduceSeries = function (obj, iterator, memo, callback) {
eachSeries(obj, function (value, i, obj, callback) {
var args = [memo, value, i, obj].slice(0, iterator.length - 1);
- args[iterator.length- 1] = function (err, v) {
+ args[iterator.length - 1] = function (err, v) {
memo = v;
callback(err);
};
@@ -197,4 +201,4 @@
});
};
-}(typeof exports == 'undefined' ? this._ = {}: exports));
+}(typeof exports === 'undefined' ? this._ = {}: exports));
View
2 nimble.min.js
@@ -1 +1 @@
-(function(a){var b=Object.keys||function(a){var b=[];for(var c in a)a.hasOwnProperty(c)&&b.push(c);return b};var c=function(a,b){var c=Array.prototype[a];return function(d,e,f){var g=d?d[a]:0;return g&&g===c?g.call(d,e,f):b(d,e,f)}};var d=c("forEach",function(a,c){var d=a instanceof Object;var e=d?b(a):a||[];for(var f=0,g=e.length;f<g;f++){var h=d?e[f]:f;c(a[h],h,a)}});var e=function(a,c,e){var f=a.length||b(a).length;if(!f)return e();var g=0;d(a,function(){var a=Array.prototype.slice.call(arguments,0,c.length-1);a[c.length-1]=function(a){a?(e(a),e=function(){}):++g===f&&e()},c.apply(this,a)})};var f=function(a,c,d){var e=b(a);if(!e.length)return d();var f=0;var g=function(){var b=e[f];var h=[a[b],b,a].slice(0,c.length-1);h[c.length-1]=function(a){a?(d(a),d=function(){}):++f===e.length?d():g()},c.apply(this,h)};g()};var g=c("map",function(a,b){var c=[];d(a,function(a,d,e){c[c.length]=b(a,d,e)});return c});var h=function(a){return function(b,c,d){var e=[];a(b,function(a,b,d,f){var g=[a,b,d].slice(0,c.length-1);g[c.length-1]=function(a,b){e[e.length]=b,f(a)},c.apply(this,g)},function(a){d(a,e)})}};var i=c("filter",function(a,b,c){var e=[];d(a,function(a,c,d){b(a,c,d)&&(e[e.length]=a)});return e});var j=function(a,b,c){var d=[];e(a,function(a,c,e,f){var g=[a,c,e].slice(0,b.length-1);g[b.length-1]=function(b,c){c&&(d[d.length]=a),f(b)},b.apply(this,g)},function(a){c(a,d)})};var k=c("reduce",function(a,b,c){d(a,function(a,d,e){c=b(c,a,d,e)});return c});var l=function(a,b,c,d){f(a,function(a,d,e,f){var g=[c,a,d,e].slice(0,b.length-1);g[b.length-1]=function(a,b){c=b,f(a)},b.apply(this,g)},function(a){d(a,c)})};a.each=function(a,b,c){return(c?e:d)(a,b,c)},a.map=function(a,b,c){return(c?h(e):g)(a,b,c)},a.filter=function(a,b,c){return(c?j:i)(a,b,c)},a.reduce=function(a,b,c,d){return(d?l:k)(a,b,c,d)},a.parallel=function(a,b){var c=new a.constructor;e(a,function(a,b,d){a(function(a){var e=Array.prototype.slice.call(arguments,1);c[b]=e.length<=1?e[0]:e,d(a)})},function(a){(b||function(){})(a,c)})},a.series=function(a,b){var c=new a.constructor;f(a,function(a,b,d){a(function(a,e){var f=Array.prototype.slice.call(arguments,1);c[b]=f.length<=1?f[0]:f,d(a)})},function(a){(b||function(){})(a,c)})}})(typeof exports=="undefined"?this._={}:exports)
+(function(a){var b=Object.keys||function(a){var b=[];for(var c in a)a.hasOwnProperty(c)&&b.push(c);return b};var c=function(a,b){var c=Array.prototype[a];return function(d,e,f){var g=d?d[a]:0;return g&&g===c?g.call(d,e,f):b(d,e,f)}};var d=c("forEach",function(a,c){var d=a instanceof Object;var e=d?b(a):a||[];for(var f=0,g=e.length;f<g;f++){var h=d?e[f]:f;c(a[h],h,a)}});var e=function(a,c,e){var f=a.length||b(a).length;if(!f)return e();var g=0;d(a,function(){var a=Array.prototype.slice.call(arguments,0,c.length-1);a[c.length-1]=function(a){a?(e(a),e=function(){}):++g===f&&e()},c.apply(this,a)})};var f=function(a,c,d){var e=b(a);if(!e.length)return d();var f=0;var g=function(){var b=e[f];var h=[a[b],b,a].slice(0,c.length-1);h[c.length-1]=function(a){a?(d(a),d=function(){}):++f===e.length?d():g()},c.apply(this,h)};g()};var g=c("map",function(a,b){var c=[];d(a,function(a,d,e){c[c.length]=b(a,d,e)});return c});var h=function(a){return function(b,c,d){var e=[];a(b,function(a,b,d,f){var g=[a,b,d].slice(0,c.length-1);g[c.length-1]=function(a,b){e[e.length]=b,f(a)},c.apply(this,g)},function(a){d(a,e)})}};var i=c("filter",function(a,b,c){var e=[];d(a,function(a,c,d){b(a,c,d)&&(e[e.length]=a)});return e});var j=function(a,b,c){var d=[];e(a,function(a,c,e,f){var g=[a,c,e].slice(0,b.length-1);g[b.length-1]=function(b,c){c&&(d[d.length]=a),f(b)},b.apply(this,g)},function(a){c(a,d)})};var k=c("reduce",function(a,b,c){d(a,function(a,d,e){c=b(c,a,d,e)});return c});var l=function(a,b,c,d){f(a,function(a,d,e,f){var g=[c,a,d,e].slice(0,b.length-1);g[b.length-1]=function(a,b){c=b,f(a)},b.apply(this,g)},function(a){d(a,c)})};a.each=function(a,b,c){return(c?e:d)(a,b,c)},a.map=function(a,b,c){return(c?h(e):g)(a,b,c)},a.filter=function(a,b,c){return(c?j:i)(a,b,c)},a.reduce=function(a,b,c,d){return(d?l:k)(a,b,c,d)},a.parallel=function(a,b){var c=new a.constructor;e(a,function(a,b,d){a(function(a){var e=Array.prototype.slice.call(arguments,1);c[b]=e.length<=1?e[0]:e,d(a)})},function(a){(b||function(){})(a,c)})},a.series=function(a,b){var c=new a.constructor;f(a,function(a,b,d){a(function(a,e){var f=Array.prototype.slice.call(arguments,1);c[b]=f.length<=1?f[0]:f,d(a)})},function(a){(b||function(){})(a,c)})}})(typeof exports==="undefined"?this._={}:exports)

0 comments on commit 77930db

Please sign in to comment.
Something went wrong with that request. Please try again.