Skip to content

Typo in Tokenizer code? #2709

Open
Open
@rirze

Description

@rirze

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Affected Resource(s)

On line 135 in cdktf/lib/private/tokens/encoding.ts:

if (startMatch && endMatch) {
      if (startMatch.index > startIndex && startMatch.index > startIndex) {  // this conditional is repeated?
        const lede = this.str.substring(
          startIndex,
          Math.min(startMatch.index, endMatch.index)
        );
        fragments.addLiteral(lede);
      }

In the second line, the if statement has the same conditional repeated. Is this intentional-- am I missing some crucial TS knowledge?

If I had to guess what the second conditional would be, then I would guess endMatch.index > startIndex. But I'm not so confident in the logic here to definitively open that PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcdktffeature/tokensgood first issueGood for newcomershelp wantedCommunity contributions welcome as the core team is unlikely to work on this soonpriority/backlogLow priority (though possibly still important). Unlikely to be worked on within the next 6 months.size/smallestimated < 1 day

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions