// instrument by jscoverage, do not modifly this file
(function () {
  var BASE;
  if (typeof global === 'object') {
    BASE = global;
  } else if (typeof window === 'object') {
    BASE = window;
  } else {
    throw new Error('[jscoverage] unknow ENV!');
  }
  if (!BASE._$jscoverage) {
    BASE._$jscoverage = {};
    BASE._$jscoverage_cond = {};
    BASE._$jscoverage_done = function (file, line, express) {
      if (arguments.length === 2) {
        BASE._$jscoverage[file][line] ++;
      } else {
        BASE._$jscoverage_cond[file][line] ++;
        return express;
      }
    };
    BASE._$jscoverage_init = function (base, file, lines) {
      var tmp = [];
      for (var i = 0; i < lines.length; i ++) {
        tmp[lines[i]] = 0;
      }
      base[file] = tmp;
    };
  }
})();
_$jscoverage_init(_$jscoverage, "lib/david.js",[9,10,11,12,13,16,19,20,21,22,25,27,28,29,40,43,46,48,54,56,57,58,59,60,62,66,67,71,75,78,89,91,93,94,95,98,100,101,102,105,107,108,109,113,115,121,123,124,127,128,131,144,155,157,159,161,162,166,172,174,175,176,180,191,193,196,197,198,200,203,204,205,207,208,209,212,214,216,218,220,221,223,226,227,244,246,249,250,251,253,256,257,258,260,261,262,265,267,269,271,273,275,279,282,284,285,286,288,290,292,294,296,298,300,302,307,308,313,314,326,327,335,336,339]);
_$jscoverage_init(_$jscoverage_cond, "lib/david.js",[40,43,46,56,60,66,93,93,100,107,123,127,161,172,196,207,220,226,249,260,273,282,282,288,290,294,296,296,300,307,313]);
_$jscoverage["lib/david.js"].source = ["/**"," * david"," * https://github.com/alanshaw/david"," *"," * Copyright (c) 2013 Alan Shaw"," * Licensed under the MIT license."," */","","var events = require('events');","var npm = require('npm');","var moment = require('moment');","var semver = require('semver');","var semverext = require('./semverext');","","// Give this module ability to emit events (and for others to listen)","var exports = new events.EventEmitter();","","function Package(name, stable, latest) {","\tthis.name = name;","\tthis.stable = stable;","\tthis.latest = latest;","\tthis.expires = moment().add(Package.TTL);","}","","Package.TTL = moment.duration({days: 1});","","var dependencies = {}; // Cache of the npm packages that projects depend on. Keyed by package name.","var dependenciesCount = 0; // The current number of dependencies in the cache","var maxDependencies = Infinity; // The maximum number of dependencies allowed in the cache","","/**"," * Cache a dependency if maxDependencies > 0."," * "," * @param {Package} dep"," * @return {Package} The cached dependency"," */","function cacheDependency(dep) {","\t","\t// Do we cache?","\tif(maxDependencies > 0) {","\t\t","\t\t// Is it a new entry?","\t\tif(!dependencies[dep.name]) {","\t\t\t","\t\t\t// Have we cached too many?","\t\t\tif(dependenciesCount + 1 > maxDependencies) {","\t\t\t\t","\t\t\t\tvar foundExpired = false,","\t\t\t\t\tdepNames = Object.keys(dependencies),","\t\t\t\t\tnow = new Date(),","\t\t\t\t\toldestDepName = depNames[0];","\t\t\t\t","\t\t\t\t// Find an expired dependency to remove from the cache","\t\t\t\tfor(var i = 0, len = depNames.length; i < len; ++i) {","\t\t\t\t\t","\t\t\t\t\tif(dependencies[depNames[i]].expires < now) {","\t\t\t\t\t\tfoundExpired = true;","\t\t\t\t\t\tdelete dependencies[depNames[i]];","\t\t\t\t\t\tbreak;","\t\t\t\t\t} else if(dependencies[depNames[i]].expires < dependencies[oldestDepName].expires) {","\t\t\t\t\t\t// Keep track of the oldest dependency incase we don't find an expired dependency","\t\t\t\t\t\toldestDepName = depNames;","\t\t\t\t\t}","\t\t\t\t}","\t\t\t\t","\t\t\t\tif(!foundExpired) {","\t\t\t\t\tdelete dependencies[oldestDepName];","\t\t\t\t}","\t\t\t\t","\t\t\t} else {","\t\t\t\tdependenciesCount++;","\t\t\t}","\t\t}","\t\t","\t\tdependencies[dep.name] = dep;","\t}","\t","\treturn dep;","}","","/**"," * Get a package for a given dependency name, guaranteed to be less old than Package.TTL"," * "," * @param {String} pkgName"," * @param {Function<Error, Package>} callback"," */","function getDependency(pkgName, callback) {","\t","\tsetImmediate(function() {","\t\t","\t\tvar dep = dependencies[pkgName];","\t\t","\t\tif(dep && dep.expires > new Date()) {","\t\t\tcallback(null, dep);","\t\t\treturn;","\t\t}","\t\t","\t\tnpm.load({}, function(err) {","\t\t\t","\t\t\tif(err) {","\t\t\t\tcallback(err);","\t\t\t\treturn;","\t\t\t}","\t\t\t","\t\t\tnpm.commands.view([pkgName, 'versions'], true, function(err, data) {","\t\t\t\t","\t\t\t\tif(err) {","\t\t\t\t\tcallback(err);","\t\t\t\t\treturn;","\t\t\t\t}","\t\t\t\t","\t\t\t\t// Get the latest dep in this tick (as it might have been updated in a tick between when it was first assigned and now)","\t\t\t\tdep = dependencies[pkgName];","\t\t\t\t","\t\t\t\tvar latest = Object.keys(data)[0],","\t\t\t\t\tversions = data[latest].versions,","\t\t\t\t\tstable = getLatestStable(versions),","\t\t\t\t\toldStable = dep ? dep.stable : undefined,","\t\t\t\t\toldLatest = dep ? dep.latest : undefined;","\t\t\t\t","\t\t\t\tdep = cacheDependency(new Package(pkgName, stable, latest));","\t\t\t\t","\t\t\t\tif(oldStable != stable) {","\t\t\t\t\texports.emit('stableVersionChange', pkgName, oldStable, stable);","\t\t\t\t}","\t\t\t\t","\t\t\t\tif(oldLatest != latest) {","\t\t\t\t\texports.emit('latestVersionChange', pkgName, oldLatest, latest);","\t\t\t\t}","\t\t\t\t","\t\t\t\tcallback(null, dep);","\t\t\t});","\t\t});","\t});","}","","/**"," * Determine if a version is a stable version or not."," * "," * @param {String} version"," * @return {Boolean}"," */","function isStable(version) {","\treturn !(/[a-z+\\-]/i.test(version || ''));","}","","/**"," * Get the latest stable version from a list of versions in ascending order."," * "," * @param {Array<String>} versions"," * @return {String}"," */","function getLatestStable(versions) {","\t","\tversions = versions.slice();","\t","\twhile(versions.length) {","\t\t","\t\tvar version = versions.pop();","\t\t","\t\tif(isStable(version)) {","\t\t\treturn version;","\t\t}","\t}","\t","\treturn null;","}","","// Convert dependencies specified as an array to an object","function normaliseDeps(deps) {","\t","\tif(Object.prototype.toString.call(deps) == '[object Array]') {","\t\t","\t\tdeps = deps.reduce(function(d, depName) {","\t\t\td[depName] = '*';","\t\t\treturn d;","\t\t}, {});","\t}","\t","\treturn deps;","}","","/**"," * Get a list of dependencies for the passed manifest."," * "," * @param {Object} manifest Parsed package.json file contents"," * @param {Object|Function<Error, Object>} [options] Options or callback"," * @param {Boolean} [options.dev] Consider devDependencies"," * @param {Function<Error, Object>} callback Function that receives the results"," */","exports.getDependencies = function(manifest, options, callback) {","\t","\tsetImmediate(function() {","\t\t","\t\t// Allow callback to be passed as second parameter","\t\tif(!callback) {","\t\t\tcallback = options;","\t\t\toptions = {};","\t\t} else {","\t\t\toptions = options || {};","\t\t}","\t\t","\t\tvar pkgs = {};","\t\tvar deps = normaliseDeps(manifest[options.dev ? 'devDependencies' : 'dependencies'] || {});","\t\tvar depNames = Object.keys(deps);","\t\t","\t\tif(!depNames.length) {","\t\t\tcallback(null, pkgs);","\t\t\treturn;","\t\t}","\t\t","\t\tvar processedDeps = 0;","\t\t","\t\tdepNames.forEach(function(depName) {","\t\t\t","\t\t\tgetDependency(depName, function(err, dep) {","\t\t\t\t","\t\t\t\tprocessedDeps++;","\t\t\t\t","\t\t\t\tif(err) {","\t\t\t\t\tconsole.log('Failed to get dependency', depName, err);","\t\t\t\t} else {","\t\t\t\t\tpkgs[depName] = {required: deps[depName], stable: dep.stable, latest: dep.latest};","\t\t\t\t}","\t\t\t\t","\t\t\t\tif(processedDeps == depNames.length) {","\t\t\t\t\tcallback(null, pkgs);","\t\t\t\t}","\t\t\t});","\t\t});","\t});","};","","/**"," * Get a list of updated packages for the passed manifest."," * "," * @param {Object} manifest Parsed package.json file contents"," * @param {Object|Function<Error, Object>} [options] Options or callback"," * @param {Boolean} [options.stable] Consider only stable packages"," * @param {Boolean} [options.dev] Consider devDependencies"," * @param {Boolean} [options.loose] Use loose option when querying semver"," * @param {Function<Error, Object>} callback Function that receives the results"," */","exports.getUpdatedDependencies = function(manifest, options, callback) {","\t","\tsetImmediate(function() {","\t\t","\t\t// Allow callback to be passed as second parameter","\t\tif(!callback) {","\t\t\tcallback = options;","\t\t\toptions = {};","\t\t} else {","\t\t\toptions = options || {};","\t\t}","\t\t","\t\tvar updatedPkgs = {};","\t\tvar deps = normaliseDeps(manifest[options.dev ? 'devDependencies' : 'dependencies'] || {});","\t\tvar depNames = Object.keys(deps);","\t\t","\t\tif(!depNames.length) {","\t\t\tcallback(null, updatedPkgs);","\t\t\treturn;","\t\t}","\t\t","\t\tvar processedDeps = 0;","\t\t","\t\tdepNames.forEach(function(depName) {","\t\t\t","\t\t\tgetDependency(depName, function(err, dep) {","\t\t\t\t","\t\t\t\tprocessedDeps++;","\t\t\t\t","\t\t\t\tif(err) {","\t\t\t\t\t","\t\t\t\t\tconsole.log('Failed to get dependency', depName, err);","\t\t\t\t\t","\t\t\t\t} else {","\t\t\t\t\t","\t\t\t\t\tvar pkgDepVersion = deps[depName] || '*';","\t\t\t\t\t","\t\t\t\t\t// TODO: Handle tags correctly","\t\t\t\t\tif(pkgDepVersion != 'latest' && pkgDepVersion != '*') {","\t\t\t\t\t\t","\t\t\t\t\t\tvar range = semver.validRange(pkgDepVersion, options.loose) || '';","\t\t\t\t\t\tvar version = options.stable ? dep.stable : dep.latest;","\t\t\t\t\t\tvar addToUpdatedPkgs = false;","\t\t\t\t\t\t","\t\t\t\t\t\tif(version) {","\t\t\t\t\t\t\t","\t\t\t\t\t\t\tif(!range) {","\t\t\t\t\t\t\t\t","\t\t\t\t\t\t\t\taddToUpdatedPkgs = true;","\t\t\t\t\t\t\t\t","\t\t\t\t\t\t\t} else if(!semver.satisfies(version, range, options.loose)) {","\t\t\t\t\t\t\t\t","\t\t\t\t\t\t\t\tif(options.stable && semverext.gtr(version, range, options.loose)) {","\t\t\t\t\t\t\t\t\t","\t\t\t\t\t\t\t\t\taddToUpdatedPkgs = true;","\t\t\t\t\t\t\t\t\t","\t\t\t\t\t\t\t\t} else if(!options.stable) {","\t\t\t\t\t\t\t\t\t","\t\t\t\t\t\t\t\t\taddToUpdatedPkgs = true;","\t\t\t\t\t\t\t\t}","\t\t\t\t\t\t\t}","\t\t\t\t\t\t}","\t\t\t\t\t\t","\t\t\t\t\t\tif(addToUpdatedPkgs) {","\t\t\t\t\t\t\tupdatedPkgs[depName] = {required: pkgDepVersion, stable: dep.stable, latest: dep.latest};","\t\t\t\t\t\t}","\t\t\t\t\t}","\t\t\t\t}","\t\t\t\t","\t\t\t\tif(processedDeps == depNames.length) {","\t\t\t\t\tcallback(null, updatedPkgs);","\t\t\t\t}","\t\t\t});","\t\t});","\t});","};","","/**"," * Set the TTL for cached packages."," * "," * @param {moment.duration} duration Time period the packages will be cacched for, expressed as a moment.duration."," */","exports.setCacheDuration = function(duration) {","\tPackage.TTL = duration;","};","","/**"," * Set the maximum number of dependencies that can be stored in the cache."," * "," * @param {Integer} size"," */","exports.setCacheSize = function(size) {","\tmaxDependencies = size;","};","","module.exports = exports;",""];
_$jscoverage_done("lib/david.js", 9);
var events = require("events");

_$jscoverage_done("lib/david.js", 10);
var npm = require("npm");

_$jscoverage_done("lib/david.js", 11);
var moment = require("moment");

_$jscoverage_done("lib/david.js", 12);
var semver = require("semver");

_$jscoverage_done("lib/david.js", 13);
var semverext = require("./semverext");

_$jscoverage_done("lib/david.js", 16);
var exports = new events.EventEmitter;

function Package(name, stable, latest) {
    _$jscoverage_done("lib/david.js", 19);
    this.name = name;
    _$jscoverage_done("lib/david.js", 20);
    this.stable = stable;
    _$jscoverage_done("lib/david.js", 21);
    this.latest = latest;
    _$jscoverage_done("lib/david.js", 22);
    this.expires = moment().add(Package.TTL);
}

_$jscoverage_done("lib/david.js", 25);
Package.TTL = moment.duration({
    days: 1
});

_$jscoverage_done("lib/david.js", 27);
var dependencies = {};

_$jscoverage_done("lib/david.js", 28);
var dependenciesCount = 0;

_$jscoverage_done("lib/david.js", 29);
var maxDependencies = Infinity;

function cacheDependency(dep) {
    _$jscoverage_done("lib/david.js", 40);
    if (_$jscoverage_done("lib/david.js", 40, maxDependencies > 0)) {
        _$jscoverage_done("lib/david.js", 43);
        if (_$jscoverage_done("lib/david.js", 43, !dependencies[dep.name])) {
            _$jscoverage_done("lib/david.js", 46);
            if (_$jscoverage_done("lib/david.js", 46, dependenciesCount + 1 > maxDependencies)) {
                _$jscoverage_done("lib/david.js", 48);
                var foundExpired = false, depNames = Object.keys(dependencies), now = new Date, oldestDepName = depNames[0];
                _$jscoverage_done("lib/david.js", 54);
                for (var i = 0, len = depNames.length; i < len; ++i) {
                    _$jscoverage_done("lib/david.js", 56);
                    if (_$jscoverage_done("lib/david.js", 56, dependencies[depNames[i]].expires < now)) {
                        _$jscoverage_done("lib/david.js", 57);
                        foundExpired = true;
                        _$jscoverage_done("lib/david.js", 58);
                        delete dependencies[depNames[i]];
                        _$jscoverage_done("lib/david.js", 59);
                        break;
                    } else {
                        _$jscoverage_done("lib/david.js", 60);
                        if (_$jscoverage_done("lib/david.js", 60, dependencies[depNames[i]].expires < dependencies[oldestDepName].expires)) {
                            _$jscoverage_done("lib/david.js", 62);
                            oldestDepName = depNames;
                        }
                    }
                }
                _$jscoverage_done("lib/david.js", 66);
                if (_$jscoverage_done("lib/david.js", 66, !foundExpired)) {
                    _$jscoverage_done("lib/david.js", 67);
                    delete dependencies[oldestDepName];
                }
            } else {
                _$jscoverage_done("lib/david.js", 71);
                dependenciesCount++;
            }
        }
        _$jscoverage_done("lib/david.js", 75);
        dependencies[dep.name] = dep;
    }
    _$jscoverage_done("lib/david.js", 78);
    return dep;
}

function getDependency(pkgName, callback) {
    _$jscoverage_done("lib/david.js", 89);
    setImmediate(function() {
        _$jscoverage_done("lib/david.js", 91);
        var dep = dependencies[pkgName];
        _$jscoverage_done("lib/david.js", 93);
        if (_$jscoverage_done("lib/david.js", 93, dep) && _$jscoverage_done("lib/david.js", 93, dep.expires > new Date)) {
            _$jscoverage_done("lib/david.js", 94);
            callback(null, dep);
            _$jscoverage_done("lib/david.js", 95);
            return;
        }
        _$jscoverage_done("lib/david.js", 98);
        npm.load({}, function(err) {
            _$jscoverage_done("lib/david.js", 100);
            if (_$jscoverage_done("lib/david.js", 100, err)) {
                _$jscoverage_done("lib/david.js", 101);
                callback(err);
                _$jscoverage_done("lib/david.js", 102);
                return;
            }
            _$jscoverage_done("lib/david.js", 105);
            npm.commands.view([ pkgName, "versions" ], true, function(err, data) {
                _$jscoverage_done("lib/david.js", 107);
                if (_$jscoverage_done("lib/david.js", 107, err)) {
                    _$jscoverage_done("lib/david.js", 108);
                    callback(err);
                    _$jscoverage_done("lib/david.js", 109);
                    return;
                }
                _$jscoverage_done("lib/david.js", 113);
                dep = dependencies[pkgName];
                _$jscoverage_done("lib/david.js", 115);
                var latest = Object.keys(data)[0], versions = data[latest].versions, stable = getLatestStable(versions), oldStable = dep ? dep.stable : undefined, oldLatest = dep ? dep.latest : undefined;
                _$jscoverage_done("lib/david.js", 121);
                dep = cacheDependency(new Package(pkgName, stable, latest));
                _$jscoverage_done("lib/david.js", 123);
                if (_$jscoverage_done("lib/david.js", 123, oldStable != stable)) {
                    _$jscoverage_done("lib/david.js", 124);
                    exports.emit("stableVersionChange", pkgName, oldStable, stable);
                }
                _$jscoverage_done("lib/david.js", 127);
                if (_$jscoverage_done("lib/david.js", 127, oldLatest != latest)) {
                    _$jscoverage_done("lib/david.js", 128);
                    exports.emit("latestVersionChange", pkgName, oldLatest, latest);
                }
                _$jscoverage_done("lib/david.js", 131);
                callback(null, dep);
            });
        });
    });
}

function isStable(version) {
    _$jscoverage_done("lib/david.js", 144);
    return !/[a-z+\-]/i.test(version || "");
}

function getLatestStable(versions) {
    _$jscoverage_done("lib/david.js", 155);
    versions = versions.slice();
    _$jscoverage_done("lib/david.js", 157);
    while (versions.length) {
        _$jscoverage_done("lib/david.js", 159);
        var version = versions.pop();
        _$jscoverage_done("lib/david.js", 161);
        if (_$jscoverage_done("lib/david.js", 161, isStable(version))) {
            _$jscoverage_done("lib/david.js", 162);
            return version;
        }
    }
    _$jscoverage_done("lib/david.js", 166);
    return null;
}

function normaliseDeps(deps) {
    _$jscoverage_done("lib/david.js", 172);
    if (_$jscoverage_done("lib/david.js", 172, Object.prototype.toString.call(deps) == "[object Array]")) {
        _$jscoverage_done("lib/david.js", 174);
        deps = deps.reduce(function(d, depName) {
            _$jscoverage_done("lib/david.js", 175);
            d[depName] = "*";
            _$jscoverage_done("lib/david.js", 176);
            return d;
        }, {});
    }
    _$jscoverage_done("lib/david.js", 180);
    return deps;
}

_$jscoverage_done("lib/david.js", 191);
exports.getDependencies = function(manifest, options, callback) {
    _$jscoverage_done("lib/david.js", 193);
    setImmediate(function() {
        _$jscoverage_done("lib/david.js", 196);
        if (_$jscoverage_done("lib/david.js", 196, !callback)) {
            _$jscoverage_done("lib/david.js", 197);
            callback = options;
            _$jscoverage_done("lib/david.js", 198);
            options = {};
        } else {
            _$jscoverage_done("lib/david.js", 200);
            options = options || {};
        }
        _$jscoverage_done("lib/david.js", 203);
        var pkgs = {};
        _$jscoverage_done("lib/david.js", 204);
        var deps = normaliseDeps(manifest[options.dev ? "devDependencies" : "dependencies"] || {});
        _$jscoverage_done("lib/david.js", 205);
        var depNames = Object.keys(deps);
        _$jscoverage_done("lib/david.js", 207);
        if (_$jscoverage_done("lib/david.js", 207, !depNames.length)) {
            _$jscoverage_done("lib/david.js", 208);
            callback(null, pkgs);
            _$jscoverage_done("lib/david.js", 209);
            return;
        }
        _$jscoverage_done("lib/david.js", 212);
        var processedDeps = 0;
        _$jscoverage_done("lib/david.js", 214);
        depNames.forEach(function(depName) {
            _$jscoverage_done("lib/david.js", 216);
            getDependency(depName, function(err, dep) {
                _$jscoverage_done("lib/david.js", 218);
                processedDeps++;
                _$jscoverage_done("lib/david.js", 220);
                if (_$jscoverage_done("lib/david.js", 220, err)) {
                    _$jscoverage_done("lib/david.js", 221);
                    console.log("Failed to get dependency", depName, err);
                } else {
                    _$jscoverage_done("lib/david.js", 223);
                    pkgs[depName] = {
                        required: deps[depName],
                        stable: dep.stable,
                        latest: dep.latest
                    };
                }
                _$jscoverage_done("lib/david.js", 226);
                if (_$jscoverage_done("lib/david.js", 226, processedDeps == depNames.length)) {
                    _$jscoverage_done("lib/david.js", 227);
                    callback(null, pkgs);
                }
            });
        });
    });
};

_$jscoverage_done("lib/david.js", 244);
exports.getUpdatedDependencies = function(manifest, options, callback) {
    _$jscoverage_done("lib/david.js", 246);
    setImmediate(function() {
        _$jscoverage_done("lib/david.js", 249);
        if (_$jscoverage_done("lib/david.js", 249, !callback)) {
            _$jscoverage_done("lib/david.js", 250);
            callback = options;
            _$jscoverage_done("lib/david.js", 251);
            options = {};
        } else {
            _$jscoverage_done("lib/david.js", 253);
            options = options || {};
        }
        _$jscoverage_done("lib/david.js", 256);
        var updatedPkgs = {};
        _$jscoverage_done("lib/david.js", 257);
        var deps = normaliseDeps(manifest[options.dev ? "devDependencies" : "dependencies"] || {});
        _$jscoverage_done("lib/david.js", 258);
        var depNames = Object.keys(deps);
        _$jscoverage_done("lib/david.js", 260);
        if (_$jscoverage_done("lib/david.js", 260, !depNames.length)) {
            _$jscoverage_done("lib/david.js", 261);
            callback(null, updatedPkgs);
            _$jscoverage_done("lib/david.js", 262);
            return;
        }
        _$jscoverage_done("lib/david.js", 265);
        var processedDeps = 0;
        _$jscoverage_done("lib/david.js", 267);
        depNames.forEach(function(depName) {
            _$jscoverage_done("lib/david.js", 269);
            getDependency(depName, function(err, dep) {
                _$jscoverage_done("lib/david.js", 271);
                processedDeps++;
                _$jscoverage_done("lib/david.js", 273);
                if (_$jscoverage_done("lib/david.js", 273, err)) {
                    _$jscoverage_done("lib/david.js", 275);
                    console.log("Failed to get dependency", depName, err);
                } else {
                    _$jscoverage_done("lib/david.js", 279);
                    var pkgDepVersion = deps[depName] || "*";
                    _$jscoverage_done("lib/david.js", 282);
                    if (_$jscoverage_done("lib/david.js", 282, pkgDepVersion != "latest") && _$jscoverage_done("lib/david.js", 282, pkgDepVersion != "*")) {
                        _$jscoverage_done("lib/david.js", 284);
                        var range = semver.validRange(pkgDepVersion, options.loose) || "";
                        _$jscoverage_done("lib/david.js", 285);
                        var version = options.stable ? dep.stable : dep.latest;
                        _$jscoverage_done("lib/david.js", 286);
                        var addToUpdatedPkgs = false;
                        _$jscoverage_done("lib/david.js", 288);
                        if (_$jscoverage_done("lib/david.js", 288, version)) {
                            _$jscoverage_done("lib/david.js", 290);
                            if (_$jscoverage_done("lib/david.js", 290, !range)) {
                                _$jscoverage_done("lib/david.js", 292);
                                addToUpdatedPkgs = true;
                            } else {
                                _$jscoverage_done("lib/david.js", 294);
                                if (_$jscoverage_done("lib/david.js", 294, !semver.satisfies(version, range, options.loose))) {
                                    _$jscoverage_done("lib/david.js", 296);
                                    if (_$jscoverage_done("lib/david.js", 296, options.stable) && _$jscoverage_done("lib/david.js", 296, semverext.gtr(version, range, options.loose))) {
                                        _$jscoverage_done("lib/david.js", 298);
                                        addToUpdatedPkgs = true;
                                    } else {
                                        _$jscoverage_done("lib/david.js", 300);
                                        if (_$jscoverage_done("lib/david.js", 300, !options.stable)) {
                                            _$jscoverage_done("lib/david.js", 302);
                                            addToUpdatedPkgs = true;
                                        }
                                    }
                                }
                            }
                        }
                        _$jscoverage_done("lib/david.js", 307);
                        if (_$jscoverage_done("lib/david.js", 307, addToUpdatedPkgs)) {
                            _$jscoverage_done("lib/david.js", 308);
                            updatedPkgs[depName] = {
                                required: pkgDepVersion,
                                stable: dep.stable,
                                latest: dep.latest
                            };
                        }
                    }
                }
                _$jscoverage_done("lib/david.js", 313);
                if (_$jscoverage_done("lib/david.js", 313, processedDeps == depNames.length)) {
                    _$jscoverage_done("lib/david.js", 314);
                    callback(null, updatedPkgs);
                }
            });
        });
    });
};

_$jscoverage_done("lib/david.js", 326);
exports.setCacheDuration = function(duration) {
    _$jscoverage_done("lib/david.js", 327);
    Package.TTL = duration;
};

_$jscoverage_done("lib/david.js", 335);
exports.setCacheSize = function(size) {
    _$jscoverage_done("lib/david.js", 336);
    maxDependencies = size;
};

_$jscoverage_done("lib/david.js", 339);
module.exports = exports;