Skip to content

Commit

Permalink
update minified build
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Early committed Aug 7, 2015
1 parent b61bd8e commit 63d9381
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 19 deletions.
18 changes: 10 additions & 8 deletions bower.json
Expand Up @@ -16,12 +16,19 @@
"devDependencies": {
"benchmark": "bestiejs/benchmark.js",
"bluebird": "^2.9.32",
"chai": "^3.1.0",
"coveralls": "^2.11.2",
"es6-promise": "^2.3.0",
"jscs": "^1.13.1",
"jshint": "~2.8.0",
"karma": "^0.13.2",
"karma-browserify": "^4.2.1",
"karma-firefox-launcher": "^0.1.6",
"karma-mocha": "^0.2.0",
"karma-mocha-reporter": "^1.0.2",
"lodash": "^3.9.0",
"mkdirp": "~0.5.1",
"mocha": "^2.2.5",
"native-promise-only": "^0.8.0-a",
"nodeunit": ">0.0.0",
"nyc": "^2.1.0",
Expand All @@ -40,14 +47,9 @@
"node_modules",
"bower_components",
"test",
"tests",
"support",
"deps",
"mocha_test",
"perf"
"tests"
],
"authors": [
"Caolan McMahon"
],
"version": "1.4.0"
}
]
}
2 changes: 1 addition & 1 deletion component.json
Expand Up @@ -14,4 +14,4 @@
"scripts": [
"lib/async.js"
]
}
}
20 changes: 13 additions & 7 deletions dist/async.js
Expand Up @@ -62,6 +62,12 @@
return _toString.call(obj) === '[object Array]';
};

// Ported from underscore.js isObject
var _isObject = function(obj) {
var type = typeof obj;
return type === 'function' || type === 'object' && !!obj;
};

function _isArrayLike(arr) {
return _isArray(arr) || (
// has a positive integer length property
Expand Down Expand Up @@ -165,7 +171,6 @@
switch (startIndex) {
case 0: return func.call(this, rest);
case 1: return func.call(this, arguments[0], rest);
case 2: return func.call(this, arguments[0], arguments[1], rest);
}
// Currently unused but handle cases outside of the switch statement:
// var args = Array(startIndex + 1);
Expand Down Expand Up @@ -462,6 +467,7 @@
}
async.detect = _createTester(async.eachOf, identity, _findGetResult);
async.detectSeries = _createTester(async.eachOfSeries, identity, _findGetResult);
async.detectLimit = _createTester(async.eachOfLimit, identity, _findGetResult);

async.sortBy = function (arr, iterator, callback) {
async.map(arr, function (x, callback) {
Expand Down Expand Up @@ -593,7 +599,7 @@
acc.times = parseInt(t.times, 10) || DEFAULT_TIMES;
acc.interval = parseInt(t.interval, 10) || DEFAULT_INTERVAL;
} else {
throw new Error('Unsupported argument type for \'times\': ' + typeof(t));
throw new Error('Unsupported argument type for \'times\': ' + typeof t);
}
}

Expand Down Expand Up @@ -1013,7 +1019,7 @@
function _console_fn(name) {
return _restParam(function (fn, args) {
fn.apply(null, args.concat([_restParam(function (err, args) {
if (typeof console !== 'undefined') {
if (typeof console === 'object') {
if (err) {
if (console.error) {
console.error(err);
Expand Down Expand Up @@ -1186,10 +1192,10 @@
return callback(e);
}
// if result is Promise object
if (typeof result !== 'undefined' && typeof result.then === "function") {
if (_isObject(result) && typeof result.then === "function") {
result.then(function(value) {
callback(null, value);
}).catch(function(err) {
})["catch"](function(err) {
callback(err.message ? err : new Error(err));
});
} else {
Expand All @@ -1199,11 +1205,11 @@
};

// Node.js
if (typeof module !== 'undefined' && module.exports) {
if (typeof module === 'object' && module.exports) {
module.exports = async;
}
// AMD / RequireJS
else if (typeof define !== 'undefined' && define.amd) {
else if (typeof define === 'function' && define.amd) {
define([], function () {
return async;
});
Expand Down
2 changes: 1 addition & 1 deletion dist/async.min.js

Large diffs are not rendered by default.

0 comments on commit 63d9381

Please sign in to comment.