src/Parse.js
function wrap(func) {
      return function wrappedParsePromise() {
        var args = Array.prototype.slice.call(arguments, 0);
        var parsePromise = func.apply(this, args);
        var promise = $q(parsePromise.then.bind(parsePromise));
        wrapParsePromise(promise, parsePromise);
        return promise;
      };
    }
function wrap(func) {
      return function wrappedParsePromise() {
        var args = Array.prototype.slice.call(arguments, 0);
        var parsePromise = func.apply(this, args);
        var promise = $q(parsePromise.then.bind(parsePromise));
        wrapParsePromise(promise, parsePromise);
        return promise;
      };
    }
function wrap ( func ) { return function wrappedParsePromise ( ) { var args = Array . prototype . slice . call ( arguments , 0 ) ; var parsePromise = func . apply ( this , args ) ; var promise = $q ( parsePromise . then . bind ( parsePromise ) ) ; wrapParsePromise ( promise , parsePromise ) ; return promise ; } ; }
Wraps function.

@param {Function} func Function that returns
[Parse.Promise]{@link https://parse.com/docs/js/api/classes/Parse.Promise.html}.
@returns {Function} Function that returns $q promises.
Wraps function .