MCPcopy
hub / github.com/vercel/next.js / truncateUrl

Function truncateUrl

packages/next/src/server/dev/log-requests.ts:210–220  ·  view source on GitHub ↗
(url: string)

Source from the content-addressed store, hash-verified

208}
209
210function truncateUrl(url: string): string {
211 const { protocol, host, pathname, search } = new URL(url)
212
213 return (
214 protocol +
215 '//' +
216 truncate(host, 16) +
217 truncate(pathname, 24) +
218 truncate(search, 16)
219 )
220}
221
222function formatCacheStatus(cacheStatus: FetchMetric['cacheStatus']): string {
223 switch (cacheStatus) {

Callers 1

logFetchMetricFunction · 0.85

Calls 1

truncateFunction · 0.70

Tested by

no test coverage detected