public/js/plugins/socket-adapter.js
// duck-typing check if object is room
duck-typing check if object is room
duck - typing check if object is room
function isRoom(room){
        if (!_.isObject(room)) return false;
        var fields = ['users', 'id', 'state', 'owner'];
        for (var i=0; i<fields.length; i++){
            if (_.isUndefined(room[fields[i]])) return false;
        }
        return true;
    }
function isRoom ( room ) { if ( ! _ . isObject ( room ) ) return false ; var fields = [ 'users' , 'id' , 'state' , 'owner' ] ; for ( var i = 0 ; i < fields . length ; i ++ ) { if ( _ . isUndefined ( room [ fields [ i ] ] ) ) return false ; } return true ; }
duck-typing check if object is room
duck - typing check if object is room