v1.0.0
An easy and simple approach for URL patterns in Deno
Repository
Current version released
4 years ago
Dependencies
std
Versions
URLPattern for Deno
An easy and simple approach for URL patterns in Deno. Inspired by snd’s url-pattern.
Usage
import { URLPattern } from 'https://deno.land/x/url_pattern/mod.ts'
const pattern = new URLPattern('/book/:id')
pattern.match('/book/') // >>> null
pattern.match('/book/123') // >>> { id: '123' }
const pattern2 = new URLPattern('*') // This will accept everything
pattern.match('') // >>> {}
pattern.match('/') // >>> {}