lib/runner/cursor.js
function (position, iteration, callback, scope) {
        var coords = _.isFunction(callback) && this.current();

        // if null or undefined implies use existing seek position
        _.isNil(position) && (position = this.position);
        _.isNil(iteration) && (iteration = this.iteration);

        // make the pointers stay within boundary
        if ((position >= this.length) || (iteration >= this.cycles) || (position < 0) || (iteration < 0) ||
            isNaN(position) || isNaN(iteration)) {
            return coords &&
                callback.call(scope || this, new Error('runcursor: seeking out of bounds: ' + [position, iteration]));
        }

        // floor the numbers
        position = ~~position;
        iteration = ~~iteration;

        // set the new positions
        this.position = Cursor.validate(position, 0, this.length);
        this.iteration = Cursor.validate(iteration, 0, this.cycles);

        // finally execute the callback with the seek position
        return coords && callback.call(scope || this, null, this.hasChanged(coords), this.current(), coords);
    }
function (position, iteration, callback, scope) {
        var coords = _.isFunction(callback) && this.current();

        // if null or undefined implies use existing seek position
        _.isNil(position) && (position = this.position);
        _.isNil(iteration) && (iteration = this.iteration);

        // make the pointers stay within boundary
        if ((position >= this.length) || (iteration >= this.cycles) || (position < 0) || (iteration < 0) ||
            isNaN(position) || isNaN(iteration)) {
            return coords &&
                callback.call(scope || this, new Error('runcursor: seeking out of bounds: ' + [position, iteration]));
        }

        // floor the numbers
        position = ~~position;
        iteration = ~~iteration;

        // set the new positions
        this.position = Cursor.validate(position, 0, this.length);
        this.iteration = Cursor.validate(iteration, 0, this.cycles);

        // finally execute the callback with the seek position
        return coords && callback.call(scope || this, null, this.hasChanged(coords), this.current(), coords);
    }
function ( position , iteration , callback , scope ) { var coords = _ . isFunction ( callback ) && this . current ( ) ; // if null or undefined implies use existing seek position _ . isNil ( position ) && ( position = this . position ) ; _ . isNil ( iteration ) && ( iteration = this . iteration ) ; // make the pointers stay within boundary if ( ( position >= this . length ) || ( iteration >= this . cycles ) || ( position < 0 ) || ( iteration < 0 ) || isNaN ( position ) || isNaN ( iteration ) ) { return coords && callback . call ( scope || this , new Error ( 'runcursor: seeking out of bounds: ' + [ position , iteration ] ) ) ; } // floor the numbers position = ~ ~ position ; iteration = ~ ~ iteration ; // set the new positions this . position = Cursor . validate ( position , 0 , this . length ) ; this . iteration = Cursor . validate ( iteration , 0 , this . cycles ) ; // finally execute the callback with the seek position return coords && callback . call ( scope || this , null , this . hasChanged ( coords ) , this . current ( ) , coords ) ; }
Seek to a specified Cursor

@param {Number} [position]
@param {Number} [iteration]
@param {Function} [callback] - receives `(err:Error, changed:Boolean, coords:Object, previous:Object)`
@param {Object} [scope]
Seek to a specified Cursor