MCPcopy Create free account
hub / github.com/getsentry/sentry-javascript / isValidProtocol

Function isValidProtocol

packages/core/src/utils/dsn.ts:12–14  ·  view source on GitHub ↗
(protocol?: string)

Source from the content-addressed store, hash-verified

10const DSN_REGEX = /^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;
11
12function isValidProtocol(protocol?: string): protocol is DsnProtocol {
13 return protocol === 'http' || protocol === 'https';
14}
15
16/**
17 * Renders the string representation of this Dsn.

Callers 1

validateDsnFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected