Skip to content

The validate config in options is not work in compile function. #289

@Mr-zhao-dy

Description

@Mr-zhao-dy

when i use options as you show in README like this:
const toPathRaw = compile("/user/:id");
toPathRaw({ id: ":/" }, { validate: false }); //=> "/user/:/"
I got a error: TypeError: Expected "id" to match "[^\/#\?]+?", but got ":/"

if I fix my code like below,options works.
const toPathRaw = compile("/user/:id",{ validate: false });
toPathRaw({ id: ":/" });

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions