-
translocator(text) → {Translocator}
-
Creates a translocator for the given text.
Parameters:
Name Type Description text
string Returns:
translocator
- Type
- Translocator
-
translocator::index(loc) → {number}
-
Finds the index in the text that matches the given location.
Parameters:
Name Type Description loc
Object location of format:
{ line: number, column: number }
Throws:
-
when the given location is outside of the text
- Type
- Error
Returns:
the index of the given location in the text
- Type
- number
-
-
translocator::location(index) → {Object}
-
Finds the location of the character in the text at the given index.
Parameters:
Name Type Description index
number the index of the character in the text to locate
Throws:
-
when the given index is outside of the text
- Type
- Error
Returns:
location of format:
{ line: number, column: number }
- Type
- Object
-
-
translocator::locations(range) → {Object}
-
Finds the start and end locations for the given range
Parameters:
Name Type Description range
Array.<number> start and end indexes of the format
[ start, end ]
Throws:
-
when the given index is outside of the text
- Type
- Error
Returns:
locations of the format
{ start: { line: number, column, number }, end: { line: number, column: number } }
- Type
- Object
-
-
translocator::range(locs, to) → {Arrary.<number>}
-
Finds start and end index for the given locations.
Parameters:
Name Type Description locs
Object start and end locationx of format:
{ start: { line: number, column, number }, end: { line: number, column: number } }
to
Object end location of format:
{ line: number, column: number }
Throws:
-
when the given location is outside of the text
- Type
- Error
Returns:
the range of the locations within the text of format
[ start, end ]
- Type
- Arrary.<number>
-
Maintenance
Commit Frequency
Further analysis of the maintenance status of translocator based on released npm versions cadence, the repository activity, and other data points determined that its maintenance is Inactive.
An important project maintenance signal to consider for translocator is that it hasn't seen any new versions released to npm in the past 12 months, and could be considered as a discontinued project, or that which receives low attention from its maintainers.
In the past month we didn't find any pull request activity or change in issues status has been detected for the GitHub repository.