MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / stripQueryAndHash

Function stripQueryAndHash

apps/desktop/src/preload/index.ts:120–130  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

118}
119
120function stripQueryAndHash(value: string): string {
121 const hashIdx = value.indexOf('#')
122 const queryIdx = value.indexOf('?')
123 const cutIdx =
124 hashIdx === -1
125 ? queryIdx
126 : queryIdx === -1
127 ? hashIdx
128 : Math.min(hashIdx, queryIdx)
129 return cutIdx === -1 ? value : value.slice(0, cutIdx)
130}
131
132function decodeHrefPath(value: string): string {
133 const cleaned = stripQueryAndHash(value)

Callers 1

decodeHrefPathFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected