lib/parsers/bool.js
function (item, arr, options) {

            debug('Match');
            debug('Item: %s', item);
            debug('Array: %s', arr);
            debug('Options: %o', options);

            // normal item match (case-sensitive)
            let found = arr.indexOf(item) > -1;

            // case insensitive test if only item not found in case-sensitive mode
            if (options.caseInsensitive || (options.caseInsensitive && !found)) {

                debug('Checking case-insensitive too...');

                arr.map(target => {

                    if (target.toLowerCase() === item.toLowerCase()) {

                        found = true;
                    }
                });
            }

            debug('Found: %s', found);

            return found;
        }
function (item, arr, options) {

            debug('Match');
            debug('Item: %s', item);
            debug('Array: %s', arr);
            debug('Options: %o', options);

            // normal item match (case-sensitive)
            let found = arr.indexOf(item) > -1;

            // case insensitive test if only item not found in case-sensitive mode
            if (options.caseInsensitive || (options.caseInsensitive && !found)) {

                debug('Checking case-insensitive too...');

                arr.map(target => {

                    if (target.toLowerCase() === item.toLowerCase()) {

                        found = true;
                    }
                });
            }

            debug('Found: %s', found);

            return found;
        }
function ( item , arr , options ) { debug ( 'Match' ) ; debug ( 'Item: %s' , item ) ; debug ( 'Array: %s' , arr ) ; debug ( 'Options: %o' , options ) ; // normal item match (case-sensitive) let found = arr . indexOf ( item ) > - 1 ; // case insensitive test if only item not found in case-sensitive mode if ( options . caseInsensitive || ( options . caseInsensitive && ! found ) ) { debug ( 'Checking case-insensitive too...' ) ; arr . map ( target => { if ( target . toLowerCase ( ) === item . toLowerCase ( ) ) { found = true ; } } ) ; } debug ( 'Found: %s' , found ) ; return found ; }
Match item in an array
@param {string} item Item to search for
@param {array<string>} arr Array of string items
@param {any} options Search/Match options
@returns {bool} Match result
Match item in an array