MCPcopy Create free account
hub / github.com/angular/dev-infra / isValidDomain

Function isValidDomain

apps/functions/dns-redirecting/index.ts:3–6  ·  view source on GitHub ↗
(domain: string)

Source from the content-addressed store, hash-verified

1import * as functions from 'firebase-functions';
2
3const isValidDomain = (domain: string): boolean => {
4 // Only allow alphanumeric characters, dots, and hyphens
5 return /^[a-zA-Z0-9.-]+$/.test(domain);
6};
7
8export const dnsRedirecting = functions.https.onRequest(
9 {

Callers 1

index.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected