Skip to content

Template Matching #2

@Radiergummi

Description

@Radiergummi

I'm looking for a way to compare a given URI against a template to check whether the URI matches that template. Say, for example:

const uri = 'https://example.com/books/42';
const template = 'https://example.com/books/{id}';

From glancing over the source code, it looks like I could somehow use the parse function for that, but it certainly isn't obvious to me. Maybe a match(template: string, uri: string): boolean function would be a good addition to the library?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions