MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / rewrite_loopback_metro_origins

Function rewrite_loopback_metro_origins

packages/server/src/devtools.rs:1055–1065  ·  view source on GitHub ↗
(port: u16, text: &str, proxy_prefix: &str)

Source from the content-addressed store, hash-verified

1053}
1054
1055fn rewrite_loopback_metro_origins(port: u16, text: &str, proxy_prefix: &str) -> String {
1056 [
1057 format!("http://127.0.0.1:{port}"),
1058 format!("http://localhost:{port}"),
1059 format!("http://[::1]:{port}"),
1060 ]
1061 .into_iter()
1062 .fold(text.to_owned(), |rewritten, origin| {
1063 rewritten.replace(&origin, proxy_prefix)
1064 })
1065}
1066
1067fn rewrite_absolute_metro_paths(text: &str, proxy_prefix: &str) -> String {
1068 let mut rewritten = String::with_capacity(text.len());

Callers 1

rewrite_metro_proxy_textFunction · 0.85

Calls 1

replaceMethod · 0.65

Tested by

no test coverage detected