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

Function proxied_target_port

packages/server/src/devtools.rs:758–767  ·  view source on GitHub ↗
(target_id: &str)

Source from the content-addressed store, hash-verified

756}
757
758fn proxied_target_port(target_id: &str) -> Result<u16, String> {
759 let rest = target_id
760 .strip_prefix("metro-")
761 .or_else(|| target_id.strip_prefix("cdp-"))
762 .ok_or_else(|| "Not a proxied DevTools target id.".to_owned())?;
763 rest.split('-')
764 .next()
765 .and_then(|port| port.parse::<u16>().ok())
766 .ok_or_else(|| "Invalid proxied DevTools target id.".to_owned())
767}
768
769fn metro_devtools_frontend_url(port: u16, entry: &Value, web_socket_debugger_url: &str) -> String {
770 let frontend = string_value(entry, "devtoolsFrontendUrl");

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected