lines-and-columns

  • Version 2.0.4
  • Published
  • 7.69 kB
  • No dependencies
  • MIT license

Install

npm i lines-and-columns
yarn add lines-and-columns
pnpm add lines-and-columns

Overview

Maps lines and columns to character offsets and back.

Index

Classes

class LinesAndColumns

class LinesAndColumns {}

    constructor

    constructor(string: string);

      method indexForLocation

      indexForLocation: (location: SourceLocation) => number | null;

        method locationForIndex

        locationForIndex: (index: number) => SourceLocation | null;

          Interfaces

          interface SourceLocation

          interface SourceLocation {}

            property column

            column: number;

              property line

              line: number;

                Package Files (1)

                Dependencies (0)

                No dependencies.

                Dev Dependencies (14)

                Peer Dependencies (0)

                No peer dependencies.

                Badge

                To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/lines-and-columns.

                • Markdown
                  [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/lines-and-columns)
                • HTML
                  <a href="https://www.jsdocs.io/package/lines-and-columns"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>