refactor(extensions): reintroduce builder (#10412)

This commit is contained in:
Aaron O'Mullan 2021-04-29 00:16:45 +02:00 committed by GitHub
parent e63c533154
commit e89295b176
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 141 additions and 112 deletions

View file

@ -17,12 +17,12 @@ use std::panic::catch_unwind;
use std::path::PathBuf;
pub fn init() -> Extension {
Extension::with_ops(
include_js_files!(
Extension::builder()
.js(include_js_files!(
prefix "deno:op_crates/url",
"00_url.js",
),
vec![
))
.ops(vec![
("op_url_parse", op_sync(op_url_parse)),
(
"op_url_parse_search_params",
@ -32,9 +32,8 @@ pub fn init() -> Extension {
"op_url_stringify_search_params",
op_sync(op_url_stringify_search_params),
),
],
None,
)
])
.build()
}
#[derive(Deserialize)]