0.3.1 • Published 4 years ago

typesafe-path-matcher v0.3.1

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

typesafe-path-matcher

type-safe path matcher. requires typescript>4.1 (currently typescript@beta)

How to use

import { parser, match } from "typesafe-path-matcher"

const pathAST = parser("/@:user/posts/:post")

const result = match(pathAST, "/@user/posts/111")
if (result != null) {
    const userName = result.user
    const postID = result.post
    // const unk = result.hogehoge // it becomes compile-time error
}

LICENSE

MIT

0.3.1

4 years ago

0.3.0

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.1.0

4 years ago