src/lib/collections/comparer.js
function (value) {
        if (value === null || value === undefined || value === defaultComparer) {
            return defaultComparer;
        }

        else if (value instanceof Comparer) {
            return value;
        }

        else if (isFunction(value)) {
            return new Comparer(value);
        }

        else if (isFunction(value.compare)) {
            return new Comparer(value.compare);
        }

        else {
            return defaultComparer;
        }
    }
function (value) {
        if (value === null || value === undefined || value === defaultComparer) {
            return defaultComparer;
        }

        else if (value instanceof Comparer) {
            return value;
        }

        else if (isFunction(value)) {
            return new Comparer(value);
        }

        else if (isFunction(value.compare)) {
            return new Comparer(value.compare);
        }

        else {
            return defaultComparer;
        }
    }
function ( value ) { if ( value === null || value === undefined || value === defaultComparer ) { return defaultComparer ; } else if ( value instanceof Comparer ) { return value ; } else if ( isFunction ( value ) ) { return new Comparer ( value ) ; } else if ( isFunction ( value . compare ) ) { return new Comparer ( value . compare ) ; } else { return defaultComparer ; } }
Gets or creates a new Comparer object.
@param {Comparer|Object} value A Comparer object.
@returns {Comparer}
Gets or creates a new Comparer object .