diff options
author | Yiyu Lin <linyiyu1992@gmail.com> | 2023-04-13 09:08:01 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-13 03:08:01 +0200 |
commit | d790ea7d533c3c48b09a2f16f3fef549aa96be78 (patch) | |
tree | b31fc35baf1f634054f52e94626f0399d187b99b /cli/build.rs | |
parent | 19c3e4f6dc31fd78e2793d0596d6a9cc3a30580a (diff) |
refactor(cli,ext,ops): cleanup `regex` with `lazy-regex` (#17296)
- bump deps: the newest `lazy-regex` need newer `oncecell` and
`regex`
- reduce `unwrap`
- remove dep `lazy_static`
- make more regex cached
---------
Co-authored-by: Bartek IwaĆczuk <biwanczuk@gmail.com>
Diffstat (limited to 'cli/build.rs')
-rw-r--r-- | cli/build.rs | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/cli/build.rs b/cli/build.rs index 6d13f9a4d..9be441bcc 100644 --- a/cli/build.rs +++ b/cli/build.rs @@ -20,7 +20,6 @@ mod ts { use deno_core::op; use deno_core::OpState; use deno_runtime::deno_node::SUPPORTED_BUILTIN_NODE_MODULES; - use regex::Regex; use serde::Deserialize; use serde_json::json; use serde_json::Value; @@ -69,8 +68,7 @@ mod ts { fn op_load(state: &mut OpState, args: LoadArgs) -> Result<Value, AnyError> { let op_crate_libs = state.borrow::<HashMap<&str, PathBuf>>(); let path_dts = state.borrow::<PathBuf>(); - let re_asset = - Regex::new(r"asset:/{3}lib\.(\S+)\.d\.ts").expect("bad regex"); + let re_asset = lazy_regex::regex!(r"asset:/{3}lib\.(\S+)\.d\.ts"); let build_specifier = "asset:///bootstrap.ts"; // we need a basic file to send to tsc to warm it up. |