Files
node/tools/eslint/node_modules/unist-util-stringify-position
Rich Trott c8f2d26632 tools: update ESLint to 4.2.0
ESLint 4.2.0 contains a fix for a bug that is blocking us from moving to
the non-legacy stricter indentation linting. Update to 4.2.0 to remove
the blocking issue.

PR-URL: https://github.com/nodejs/node/pull/14155
Ref: https://github.com/eslint/eslint/issues/8882
Ref: https://github.com/eslint/eslint/pull/8885
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-07-19 15:02:31 -04:00
..
…
…
2017-07-19 15:02:31 -04:00
…

unist-util-stringify-position Build Status Coverage Status

Stringify a Unist position or location.

Installation

npm:

npm install unist-util-stringify-position

Usage

var stringify = require('unist-util-stringify-position');

stringify({line: 2, column: 3 }); //=> '2:3'

stringify({
  start: {line: 2},
  end: {line: 3}
}); //=> '2:1-3:1'

stringify({
  type: 'text',
  value: '!',
  position: {
    start: {line: 5, column: 11},
    end: {line: 5, column: 12}
  }
}); //=> '5:11-5:12'

API

stringifyPosition(node|location|position)

Stringify one position, a location (start and end positions), or a node’s location.

Parameters
  • node (Node) — Node whose 'position' property to stringify
  • location (Location) — Location whose 'start' and 'end' positions to stringify
  • position (Position) — Location whose 'line' and 'column' to stringify
Returns

string? — A range ls:cs-le:ce (when given node or location) or a point l:c (when given position), where l stands for line, c for column, s for start, and e for end. null is returned if the given value is neither node, location, nor position.

License

MIT © Titus Wormer