diff options
| author | Luca Casonato <hello@lcas.dev> | 2021-09-08 11:14:29 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-09-08 11:14:29 +0200 |
| commit | e07f28d301b990ebf534cbb8d5fa9f507475c89f (patch) | |
| tree | 6a00f6a0abe0a7833a7d0feadf4e5d8c3509c12e /ext/url/lib.rs | |
| parent | 2de5587547247e3acdffecae1c74caf52a021580 (diff) | |
feat: add URLPattern API (#11941)
This adds support for the URLPattern API.
The API is added in --unstable only, as it has not yet shipped in any
browser. It is targeted for shipping in Chrome 95.
Spec: https://wicg.github.io/urlpattern/
Co-authored-by: crowlKats < crowlkats@toaxl.com >
Diffstat (limited to 'ext/url/lib.rs')
| -rw-r--r-- | ext/url/lib.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/ext/url/lib.rs b/ext/url/lib.rs index d8987c816..0f8d5c599 100644 --- a/ext/url/lib.rs +++ b/ext/url/lib.rs @@ -1,5 +1,7 @@ // Copyright 2018-2021 the Deno authors. All rights reserved. MIT license. +mod urlpattern; + use deno_core::error::generic_error; use deno_core::error::type_error; use deno_core::error::uri_error; @@ -14,11 +16,15 @@ use deno_core::ZeroCopyBuf; use std::panic::catch_unwind; use std::path::PathBuf; +use crate::urlpattern::op_urlpattern_parse; +use crate::urlpattern::op_urlpattern_process_match_input; + pub fn init() -> Extension { Extension::builder() .js(include_js_files!( prefix "deno:ext/url", "00_url.js", + "01_urlpattern.js", )) .ops(vec![ ("op_url_parse", op_sync(op_url_parse)), @@ -31,6 +37,11 @@ pub fn init() -> Extension { "op_url_stringify_search_params", op_sync(op_url_stringify_search_params), ), + ("op_urlpattern_parse", op_sync(op_urlpattern_parse)), + ( + "op_urlpattern_process_match_input", + op_sync(op_urlpattern_process_match_input), + ), ]) .build() } |
