Skip to content

JSDoc Parser breaks with a complex @pattern tag #18273

Open
@egandro

Description

@egandro

TypeScript Version: 2.5.2

Code

  /**
   * @pattern ^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9-.]+$
   */
  public emailPattern: string;

Expected behavior:
expected '^[a-zA-Z0-9_.+-]+' to equal '^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$'

Actual behavior:

This is parsed -^[a-zA-Z0-9_.+-]+
This is expected +^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+.[a-zA-Z0-9-.]+$

Maybe I am doing something stupid or the parser is broken.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: JSDocRelates to JSDoc parsing and type generationHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions