lib/parser.js
function (arr, val) {

            debug('Finding all indices...');
            debug('Array: %o', arr);

            let indexes = [];

            for (let i = 0; i < arr.length; i++) {

                const
                    camelCaseVal = camelCase(val),
                    camelCaseKey = camelCase(arr[i]);

                if (arr[i] === val || camelCaseKey === camelCaseVal) {

                    debug('Matched index: %s', i);

                    indexes.push(i);
                }
            }

            debug('Found indices: %o', indexes);

            return indexes;
        }
function (arr, val) {

            debug('Finding all indices...');
            debug('Array: %o', arr);

            let indexes = [];

            for (let i = 0; i < arr.length; i++) {

                const
                    camelCaseVal = camelCase(val),
                    camelCaseKey = camelCase(arr[i]);

                if (arr[i] === val || camelCaseKey === camelCaseVal) {

                    debug('Matched index: %s', i);

                    indexes.push(i);
                }
            }

            debug('Found indices: %o', indexes);

            return indexes;
        }
function ( arr , val ) { debug ( 'Finding all indices...' ) ; debug ( 'Array: %o' , arr ) ; let indexes = [ ] ; for ( let i = 0 ; i < arr . length ; i ++ ) { const camelCaseVal = camelCase ( val ) , camelCaseKey = camelCase ( arr [ i ] ) ; if ( arr [ i ] === val || camelCaseKey === camelCaseVal ) { debug ( 'Matched index: %s' , i ) ; indexes . push ( i ) ; } } debug ( 'Found indices: %o' , indexes ) ; return indexes ; }
Find all indices of a value in an array
@param {Array<string>} arr Array to search in
@param {string} val Target value
@returns {Array<number>} List of indices
Find all indices of a value in an array