"use strict";

var semver = require("semver");

function isGitDependency(info) {
    return info.latest === "git";
}

function isAlreadyInstalled(info) {
    return info.updateTo === info.current;
}

function isUnstable(info) {
    // Check for hyphen in version string as this is a prerelease version according to SemVer
    return info.updateTo && info.updateTo.indexOf("-") !== -1;
}

function isExcluded(info, exclude) {
    return exclude.map(function (name) {
        return name.trim();
    }).indexOf(info.name) !== -1;
}

function isCurrentGreaterThanUpdateTo(info) {
    return info.current && info.updateTo !== "git" && semver.gt(info.current, info.updateTo);
}

function filter(config) {
    return function (info) {
        return isGitDependency(info) === false &&
            isAlreadyInstalled(info) === false &&
            isUnstable(info) === false &&
            isExcluded(info, config.exclude) === false &&
            isCurrentGreaterThanUpdateTo(info) === false;
    };
}

module.exports = filter;

@@ -318,32 +318,40 @@
 mVer%0A    return 
+Boolean(
 info.updateTo &&
@@ -376,32 +376,33 @@
 exOf(%22-%22) !== -1
+)
 ;%0A%7D%0A%0Afunction is
@@ -586,24 +586,32 @@
 %0A    return 
+Boolean(
 info.current
@@ -679,16 +679,17 @@
 pdateTo)
+)
 ;%0A%7D%0A%0Afun

Fix wrong boolean casts in filter.js