lib/line-column.js
function LineColumnFinder(str, options) {
  if (!(this instanceof LineColumnFinder)) {
    if (typeof options === "number") {
      return (new LineColumnFinder(str)).fromIndex(options);
    }
    return new LineColumnFinder(str, options);
  }

  this.str = str || "";
  this.lineToIndex = buildLineToIndex(this.str);

  options = options || {};
  this.origin = typeof options.origin === "undefined" ? 1 : options.origin;
}
function LineColumnFinder(str, options) {
  if (!(this instanceof LineColumnFinder)) {
    if (typeof options === "number") {
      return (new LineColumnFinder(str)).fromIndex(options);
    }
    return new LineColumnFinder(str, options);
  }

  this.str = str || "";
  this.lineToIndex = buildLineToIndex(this.str);

  options = options || {};
  this.origin = typeof options.origin === "undefined" ? 1 : options.origin;
}
function LineColumnFinder ( str , options ) { if ( ! ( this instanceof LineColumnFinder ) ) { if ( typeof options === "number" ) { return ( new LineColumnFinder ( str ) ) . fromIndex ( options ) ; } return new LineColumnFinder ( str , options ) ; } this . str = str || "" ; this . lineToIndex = buildLineToIndex ( this . str ) ; options = options || { } ; this . origin = typeof options . origin === "undefined" ? 1 : options . origin ; }
Finder for index and line-column from given string.

You can call this without `new` operator as it returns an instance anyway.

@class
@param {string} str - A string to be parsed.
@param {Object|number} [options] - Options.
This can be an index in the string for shorthand of `lineColumn(str, index)`.
@param {number} [options.origin=1] - The origin value of line and column.
Finder for index and line - column from given string .