Skip to content

Commit

Permalink
standardjs compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
batuhan committed Jun 4, 2016
1 parent 5bf72f2 commit 1189d5f
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions index.js
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down Expand Up @@ -53,4 +53,4 @@ function check (ip, cloud, cb) {
return cb()
}
})
}
}

0 comments on commit 1189d5f

Please sign in to comment.