Read element other than Array #182

Closed
wants to merge 1 commit into from
+19 −0
View
19 lib/async.js
@@ -98,6 +98,25 @@
});
};
+// Modified
+// for read element
+async.element = function (element, iterator, callback) {
+ callback = callback || function () {};
+ if (element==null || element=='') {
+ return callback();
+ }
+ iterator(element, function (err) {
+ if (err) {
+ callback(err);
+ callback = function () {};
+ }
+ else {
+ callback(null);
+ }
+ });
+ };
+// Modified
+
async.forEachSeries = function (arr, iterator, callback) {
callback = callback || function () {};
if (!arr.length) {