stackmob-js-0.9.2.js
function(options, methods){
      options = options || {};

      // Wrap yes/no methods with a success method
      options['success'] = function(result){
        if ( methods['isValidResult'](result) ){
          if (typeof methods['yes'] === "function") methods['yes'](result);
        } else {
          if (typeof methods['no'] === "function") methods['no'](result);
        }
      };

      // Set default error method if one is not provided
      if ( !options['error'] && (typeof methods['error'] === "function") ) {
        options['error'] = methods['error'];
      }

      return options;
    }
function(options, methods){
      options = options || {};

      // Wrap yes/no methods with a success method
      options['success'] = function(result){
        if ( methods['isValidResult'](result) ){
          if (typeof methods['yes'] === "function") methods['yes'](result);
        } else {
          if (typeof methods['no'] === "function") methods['no'](result);
        }
      };

      // Set default error method if one is not provided
      if ( !options['error'] && (typeof methods['error'] === "function") ) {
        options['error'] = methods['error'];
      }

      return options;
    }
function ( options , methods ) { options = options || { } ; // Wrap yes/no methods with a success method options [ 'success' ] = function ( result ) { if ( methods [ 'isValidResult' ] ( result ) ) { if ( typeof methods [ 'yes' ] === "function" ) methods [ 'yes' ] ( result ) ; } else { if ( typeof methods [ 'no' ] === "function" ) methods [ 'no' ] ( result ) ; } } ; // Set default error method if one is not provided if ( ! options [ 'error' ] && ( typeof methods [ 'error' ] === "function" ) ) { options [ 'error' ] = methods [ 'error' ] ; } return options ; }
Helper method to allow altering callback methods
Helper method to allow altering callback methods