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

Function metro_frontend_query_with_socket

packages/server/src/devtools.rs:829–854  ·  view source on GitHub ↗
(query: Option<&str>, web_socket_debugger_url: &str)

Source from the content-addressed store, hash-verified

827}
828
829fn metro_frontend_query_with_socket(query: Option<&str>, web_socket_debugger_url: &str) -> String {
830 let socket_param = web_socket_debugger_url
831 .trim_start_matches("ws://")
832 .trim_start_matches("wss://");
833 let mut params = vec![format!(
834 "ws={}",
835 percent_encode_query_component(socket_param)
836 )];
837 if let Some(query) = query {
838 let metadata_params = metro_frontend_metadata_params(query);
839 params.extend(
840 query
841 .split('&')
842 .filter(|param| {
843 !param.is_empty() && !param.starts_with("ws=") && !param.starts_with("wss=")
844 })
845 .map(ToOwned::to_owned),
846 );
847 for (key, param) in metadata_params {
848 if !query_has_param(query, &key) {
849 params.push(param);
850 }
851 }
852 }
853 params.join("&")
854}
855
856fn metro_frontend_metadata_params(query: &str) -> Vec<(String, String)> {
857 query

Callers

nothing calls this directly

Calls 3

query_has_paramFunction · 0.85
is_emptyMethod · 0.80

Tested by

no test coverage detected