MCPcopy Create free account
hub / github.com/solidjs/solid-router / normalizeSegment

Function normalizeSegment

src/recognizer/normalizer.ts:5–11  ·  view source on GitHub ↗
(segment: string)

Source from the content-addressed store, hash-verified

3// decoding the rest of the path
4const SEGMENT_RESERVED_CHARS = /%|\//g;
5export function normalizeSegment(segment: string): string {
6 if (segment.length < 3 || !segment.includes("%")) return segment;
7 return decodeURIComponent(segment).replace(
8 SEGMENT_RESERVED_CHARS,
9 encodeURIComponent
10 );
11}
12
13// We do not want to encode these characters when generating dynamic path segments
14// See https://tools.ietf.org/html/rfc3986#section-3.3

Callers 1

parseFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…