MCPcopy Index your code
hub / github.com/getsentry/sentry-javascript / extractPathname

Function extractPathname

packages/hono/src/shared/patchAppRequest.ts:16–22  ·  view source on GitHub ↗
(input: string | Request | URL)

Source from the content-addressed store, hash-verified

14const INTERNAL_REQUEST_ORIGIN = 'auto.http.hono.internal_request';
15
16function extractPathname(input: string | Request | URL): string {
17 if (typeof input === 'string') {
18 return /^https?:\/\//.test(input) ? new URL(input).pathname : input;
19 }
20
21 return input instanceof Request ? new URL(input.url).pathname : input.pathname;
22}
23
24/**
25 * Patches `app.request()` on a Hono instance so that each internal dispatch

Callers 1

applyFunction · 0.85

Calls 1

testMethod · 0.65

Tested by

no test coverage detected