lib/token-store/index.js
function createCursorWithPadding(tokens, comments, indexMap, startLoc, endLoc, beforeCount, afterCount) {
    if (typeof beforeCount === "undefined" && typeof afterCount === "undefined") {
        return new ForwardTokenCursor(tokens, comments, indexMap, startLoc, endLoc);
    }
    if (typeof beforeCount === "number" || typeof beforeCount === "undefined") {
        return new PaddedTokenCursor(tokens, comments, indexMap, startLoc, endLoc, beforeCount | 0, afterCount | 0);
    }
    return createCursorWithCount(cursors.forward, tokens, comments, indexMap, startLoc, endLoc, beforeCount);
}
function createCursorWithPadding(tokens, comments, indexMap, startLoc, endLoc, beforeCount, afterCount) {
    if (typeof beforeCount === "undefined" && typeof afterCount === "undefined") {
        return new ForwardTokenCursor(tokens, comments, indexMap, startLoc, endLoc);
    }
    if (typeof beforeCount === "number" || typeof beforeCount === "undefined") {
        return new PaddedTokenCursor(tokens, comments, indexMap, startLoc, endLoc, beforeCount | 0, afterCount | 0);
    }
    return createCursorWithCount(cursors.forward, tokens, comments, indexMap, startLoc, endLoc, beforeCount);
}
function createCursorWithPadding ( tokens , comments , indexMap , startLoc , endLoc , beforeCount , afterCount ) { if ( typeof beforeCount === "undefined" && typeof afterCount === "undefined" ) { return new ForwardTokenCursor ( tokens , comments , indexMap , startLoc , endLoc ) ; } if ( typeof beforeCount === "number" || typeof beforeCount === "undefined" ) { return new PaddedTokenCursor ( tokens , comments , indexMap , startLoc , endLoc , beforeCount | 0 , afterCount | 0 ) ; } return createCursorWithCount ( cursors . forward , tokens , comments , indexMap , startLoc , endLoc , beforeCount ) ; }
Creates the cursor iterates tokens with options.
This is overload function of the below.

@param {Token[]} tokens - The array of tokens.
@param {Comment[]} comments - The array of comments.
@param {Object} indexMap - The map from locations to indices in `tokens`.
@param {number} startLoc - The start location of the iteration range.
@param {number} endLoc - The end location of the iteration range.
@param {Function|Object} opts - The option object. If this is a function then it's `opts.filter`.
@param {boolean} [opts.includeComments] - The flag to iterate comments as well.
@param {Function|null} [opts.filter=null] - The predicate function to choose tokens.
@param {number} [opts.count=0] - The maximum count of tokens the cursor iterates. Zero is no iteration for backward compatibility.
@returns {Cursor} The created cursor.
@private
 
Creates the cursor iterates tokens with options.

@param {Token[]} tokens - The array of tokens.
@param {Comment[]} comments - The array of comments.
@param {Object} indexMap - The map from locations to indices in `tokens`.
@param {number} startLoc - The start location of the iteration range.
@param {number} endLoc - The end location of the iteration range.
@param {number} [beforeCount=0] - The number of tokens before the node to retrieve.
@param {boolean} [afterCount=0] - The number of tokens after the node to retrieve.
@returns {Cursor} The created cursor.
@private
Creates the cursor iterates tokens with options . This is overload function of the below .