From 1189d5f9b7c3e05bcd42b008fdba8fc748b2fe1d Mon Sep 17 00:00:00 2001 From: Batuhan Icoz Date: Sun, 5 Jun 2016 00:35:32 +0300 Subject: [PATCH] standardjs compatibility --- index.js | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/index.js b/index.js index 709af13..6a5026c 100644 --- a/index.js +++ b/index.js @@ -1,28 +1,28 @@ const parallel = require('async').parallel const ipRangeCheck = require('ip-range-check') -const whois = require('./lib/whois'); +const whois = require('./lib/whois') const providers = [ - require('./lib/azure'), - require('./lib/aws'), + require('./lib/azure'), + require('./lib/aws'), require('./lib/gce') -]; +] function WhichCloud (ip, done) { let name = WhichCloud.default - function checkersGenerator(ip) { - const checkers = []; + function checkersGenerator (ip) { + const checkers = [] providers.forEach(provider => { checkers.push(cb => { check(ip, provider(), (err = null, _name = null) => { - if (err) return cb(err); - if (_name) name = _name; - return cb(null); - }); - }); - }); - return checkers; + if (err) return cb(err) + if (_name) name = _name + return cb(null) + }) + }) + }) + return checkers } parallel(checkersGenerator(ip), function (err) { @@ -53,4 +53,4 @@ function check (ip, cloud, cb) { return cb() } }) -} \ No newline at end of file +}