Update package.json of the package with its new version and new versions of all dependencies

@param deps
@param packages
@param version
function updateDeps(deps, packages) {
    const lib = {};
    _.each(packages, pkg => {
        lib[pkg.name] = _.get(pkg, "nextRelease.version", _.get(pkg, "lastRelease.version"));
    });

    _.each(deps, (version, dep) => {
        if (dep in lib) {
            deps[dep] = "^" + lib[dep];
        }
    });
}