remove async extension to a module

This commit is contained in:
Iuri Matias 2017-03-11 10:52:02 -05:00
parent c2c41549c1
commit 92f9df4117
3 changed files with 16 additions and 25 deletions

View File

@ -1,18 +1,7 @@
/*jshint esversion: 6, loopfunc: true */ /*jshint esversion: 6, loopfunc: true */
var async = require('async'); var async = require('../core/async_extend.js');
var SolcW = require('./solcW.js'); var SolcW = require('./solcW.js');
function asyncEachObject(object, iterator, callback) {
async.each(
Object.keys(object || {}),
function(key, next){
iterator(key, object[key], next);
},
callback
);
}
async.eachObject = asyncEachObject;
var Compiler = function(options) { var Compiler = function(options) {
this.plugins = options.plugins; this.plugins = options.plugins;
this.logger = options.logger; this.logger = options.logger;

14
lib/core/async_extend.js Normal file
View File

@ -0,0 +1,14 @@
var async = require('async');
function asyncEachObject(object, iterator, callback) {
async.each(
Object.keys(object || {}),
function(key, next){
iterator(key, object[key], next);
},
callback
);
}
async.eachObject = asyncEachObject;
module.exports = async;

View File

@ -1,16 +1,4 @@
var async = require('async'); var async = require('./async_extend.js');
// TODO: repeated, add this to an async extensions file
function asyncEachObject(object, iterator, callback) {
async.each(
Object.keys(object || {}),
function(key, next){
iterator(key, object[key], next);
},
callback
);
}
async.eachObject = asyncEachObject;
var ServicesMonitor = function(options) { var ServicesMonitor = function(options) {
this.events = options.events; this.events = options.events;