Skip to content

Some improvement ideas #3

@xuanswe

Description

@xuanswe

First of all, thanks for sharing your smart idea!

But, IMO, to be used in production, it requires some important improvements:

  1. It should be implemented as a typescript module and re-export only typedPath function in index.ts. The implementation detail should be private and placed in separated files.
  2. Currently, separator is hard-coded as a dot. In real life, we also want to use slash / to build url or file path. So the separator should be configurable.
  3. How to insert a dynamic value in the middle of the path? For example, how can we build url /users/:username/posts/:postId/comments?

Best regards

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