summaryrefslogtreecommitdiff
path: root/cli/build.rs
diff options
context:
space:
mode:
authorYiyu Lin <linyiyu1992@gmail.com>2023-04-13 09:08:01 +0800
committerGitHub <noreply@github.com>2023-04-13 03:08:01 +0200
commitd790ea7d533c3c48b09a2f16f3fef549aa96be78 (patch)
treeb31fc35baf1f634054f52e94626f0399d187b99b /cli/build.rs
parent19c3e4f6dc31fd78e2793d0596d6a9cc3a30580a (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.rs4
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.