lib/collection/property-list.js
function (item, value) {
        var match,
            val,
            i;

        match = _.isString(item) ?
            this.reference[this._postman_listIndexCaseInsensitive ? item.toLowerCase() : item] :
            this.filter(function (member) {
                return member === item;
            });

        // If we don't have a match, there's nothing to do
        if (!match) { return false; }

        // if no value is provided, just check if item exists
        if (arguments.length === 1) {
            return Boolean(_.isArray(match) ? match.length : match);
        }

        // If this property allows multiple values and we get an array, we need to iterate through it and see
        // if any element matches.
        if (this._postman_listAllowsMultipleValues && _.isArray(match)) {
            for (i = 0; i < match.length; i++) {

                // use the value of the current element
                val = _.isFunction(match[i].valueOf) ? match[i].valueOf() : match[i];

                if (val === value) { return true; }
            }

            // no matches were found, so return false here.
            return false;
        }

        // We didn't have an array, so just check if the matched value equals the provided value.
        _.isFunction(match.valueOf) && (match = match.valueOf());

        return match === value;
    }
function (item, value) {
        var match,
            val,
            i;

        match = _.isString(item) ?
            this.reference[this._postman_listIndexCaseInsensitive ? item.toLowerCase() : item] :
            this.filter(function (member) {
                return member === item;
            });

        // If we don't have a match, there's nothing to do
        if (!match) { return false; }

        // if no value is provided, just check if item exists
        if (arguments.length === 1) {
            return Boolean(_.isArray(match) ? match.length : match);
        }

        // If this property allows multiple values and we get an array, we need to iterate through it and see
        // if any element matches.
        if (this._postman_listAllowsMultipleValues && _.isArray(match)) {
            for (i = 0; i < match.length; i++) {

                // use the value of the current element
                val = _.isFunction(match[i].valueOf) ? match[i].valueOf() : match[i];

                if (val === value) { return true; }
            }

            // no matches were found, so return false here.
            return false;
        }

        // We didn't have an array, so just check if the matched value equals the provided value.
        _.isFunction(match.valueOf) && (match = match.valueOf());

        return match === value;
    }
function ( item , value ) { var match , val , i ; match = _ . isString ( item ) ? this . reference [ this . _postman_listIndexCaseInsensitive ? item . toLowerCase ( ) : item ] : this . filter ( function ( member ) { return member === item ; } ) ; // If we don't have a match, there's nothing to do if ( ! match ) { return false ; } // if no value is provided, just check if item exists if ( arguments . length === 1 ) { return Boolean ( _ . isArray ( match ) ? match . length : match ) ; } // If this property allows multiple values and we get an array, we need to iterate through it and see // if any element matches. if ( this . _postman_listAllowsMultipleValues && _ . isArray ( match ) ) { for ( i = 0 ; i < match . length ; i ++ ) { // use the value of the current element val = _ . isFunction ( match [ i ] . valueOf ) ? match [ i ] . valueOf ( ) : match [ i ] ; if ( val === value ) { return true ; } } // no matches were found, so return false here. return false ; } // We didn't have an array, so just check if the matched value equals the provided value. _ . isFunction ( match . valueOf ) && ( match = match . valueOf ( ) ) ; return match === value ; }
Check whether an item exists in this list

@param {String|PropertyList.Type} item
@param {*=} value
@returns {Boolean}
Check whether an item exists in this list