source/utils.js
function(selector) {
        var validSelectors = [
            'all',
            'label:',
            'id:',
            'group_id:',
            'group:',
            'location_id:',
            'location:',
            'scene_id:'
        ], isValid = false;

        if(!selector || !selector.length) {
            return false;
        }

        validSelectors.every(function(sel) {
            if(selector.startsWith(sel)) {
                isValid = true;

                return false;
            }

            return true;
        });

        return isValid;
    }
function(selector) {
        var validSelectors = [
            'all',
            'label:',
            'id:',
            'group_id:',
            'group:',
            'location_id:',
            'location:',
            'scene_id:'
        ], isValid = false;

        if(!selector || !selector.length) {
            return false;
        }

        validSelectors.every(function(sel) {
            if(selector.startsWith(sel)) {
                isValid = true;

                return false;
            }

            return true;
        });

        return isValid;
    }
function ( selector ) { var validSelectors = [ 'all' , 'label:' , 'id:' , 'group_id:' , 'group:' , 'location_id:' , 'location:' , 'scene_id:' ] , isValid = false ; if ( ! selector || ! selector . length ) { return false ; } validSelectors . every ( function ( sel ) { if ( selector . startsWith ( sel ) ) { isValid = true ; return false ; } return true ; } ) ; return isValid ; }
Checks the light selector if it's valid.

See: <http://api.developer.lifx.com/docs/selectors>

@param {string} selector
@returns {boolean}
Checks the light selector if it s valid .