MCPcopy Create free account
hub / github.com/rolldown/rolldown / try_replace

Method try_replace

crates/rolldown_plugin_replace/src/plugin.rs:96–105  ·  view source on GitHub ↗
(
    &'text self,
    code: &'text str,
    magic_string: &mut MagicString<'text>,
  )

Source from the content-addressed store, hash-verified

94 }
95
96 fn try_replace<'text>(
97 &'text self,
98 code: &'text str,
99 magic_string: &mut MagicString<'text>,
100 ) -> bool {
101 match self.matcher {
102 HybridRegex::Optimize(ref regex) => self.optimized_replace(code, magic_string, regex),
103 HybridRegex::Ecma(ref regex) => self.fallback_replace(code, magic_string, regex),
104 }
105 }
106
107 fn optimized_replace<'text>(
108 &'text self,

Callers 2

transformMethod · 0.80
render_chunkMethod · 0.80

Calls 2

optimized_replaceMethod · 0.80
fallback_replaceMethod · 0.80

Tested by

no test coverage detected