Skip to content

Add support for translating between character offsets and code point indices #14

Closed as not planned
@wooorm

Description

@wooorm

Initial checklist

Problem

Related: syntax-tree/unist#99.

remark-lint where a user provides a max size of say 80, and they don’t mean the way that JS stores strings.
To check if things are (not) allowed at that point, a lint tool needs to be aware of that difference, and be able to translate between the two.

Solution

Two new methods: toCodePointIndex(offset: number): number / fromCodePointIndex(index: number): number

Alternatives

Different utility.

Metadata

Metadata

Assignees

No one assigned

    Labels

    👎 phase/noPost cannot or will not be acted on🙅 no/wontfixThis is not (enough of) an issue for this project

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions