Skip to content

Potential illegal array access on number in setCharacters.ts #108

@ifree

Description

@ifree

Hi! I noticed what appears to be a type inconsistency in the buildLinearOrder function that might cause issues. I wanted to bring this to your attention in case it's unintentional.

From what I can see, spacesRangeStart is destructured as a number from the array returned by getDelimiterPos (line 167):

const spacesRangeFont = node.getRangeFontName(
    spacesRangeStart,
    spacesRangeStart[0]  // This might be causing an issue
) as FontName

However, the code tries to access spacesRangeStart[0] as if it were an array, which might not work as expected, or if I've misunderstood the code's intention.

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions