MCPcopy Index your code
hub / github.com/ionic-team/ionic-framework / readSegments

Function readSegments

core/src/components/router/utils/path.ts:94–99  ·  view source on GitHub ↗
(loc: Location, root: string, useHash: boolean)

Source from the content-addressed store, hash-verified

92};
93
94export const readSegments = (loc: Location, root: string, useHash: boolean): string[] | null => {
95 const prefix = parsePath(root).segments;
96 const pathname = useHash ? loc.hash.slice(1) : loc.pathname;
97 const segments = parsePath(pathname).segments;
98 return removePrefix(prefix, segments);
99};
100
101/**
102 * Parses the path to:

Callers 2

getSegmentsMethod · 0.90
path.spec.tsxFile · 0.90

Calls 2

parsePathFunction · 0.85
removePrefixFunction · 0.85

Tested by

no test coverage detected