Skip to content

Capture group name assignment fails with TypeError: Cannot read property 'slice' of null #17

Closed
@myAlterX

Description

@myAlterX

Hi,
Not sure if you are still maintaining this project, but is seems like a great way to simplify the use of RegExp. Congrats.
I found a problem where I'm running several strings through a match and if nothing matches, result is null which results in an error in the following line:

    return Array.prototype.reduce.call(result.slice(1), (result, current, index) => {

However I understand this is a workaround implementation for named captures which is now a part of the ECMAScript spec, so not sure if placing a check is the right move or simply to support named matches natively.

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