Skip to content

transform a RegExp named group match to a more useful object

License

Notifications You must be signed in to change notification settings

stagas/match-to-token

Repository files navigation

match-to-token

transform a RegExp named group match to a more useful object

npm i match-to-token pnpm add match-to-token yarn add match-to-token

API

# matchToToken(match)

    # match

      null | RegExpMatchArray

    matchToToken(match)  =>

# RegExpToken

    # constructor(pattern)

# Token
# RegExpMatchArrayLike

    # index

      number

    # input

      string

# TokenJson

    # group

      string

    # source

      {

      # index

        number

      # input

        string

      # match

        string []

      }

    # value

      string

# matchToToken(match)

    # match

      null | RegExpMatchArray

    matchToToken(match)  =>

Contributing

Fork or edit and submit a PR.

All contributions are welcome!

License

MIT © 2022 stagas

About

transform a RegExp named group match to a more useful object

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published