MCPcopy
hub / github.com/getsentry/sentry / parseLocationConfig

Function parseLocationConfig

tests/js/sentry-test/reactTestingLibrary.tsx:261–283  ·  view source on GitHub ↗
(location: LocationConfig | undefined)

Source from the content-addressed store, hash-verified

259}
260
261function parseLocationConfig(location: LocationConfig | undefined): InitialEntry {
262 if (!location) {
263 return LocationFixture().pathname;
264 }
265
266 if (!location.query && !location.state) {
267 return location.pathname;
268 }
269
270 const config: InitialEntry = {
271 pathname: location.pathname,
272 };
273
274 if (location.query) {
275 config.search = parseQueryString(location.query);
276 }
277
278 if (location.state) {
279 config.state = location.state;
280 }
281
282 return config;
283}
284
285function parseQueryString(query: Record<string, string | number | string[]> | undefined) {
286 if (!query) {

Callers 1

getInitialRouterConfigFunction · 0.85

Calls 2

LocationFixtureFunction · 0.90
parseQueryStringFunction · 0.85

Tested by

no test coverage detected