Skip to content

Variable: SafeApiUrl ​

SafeApiUrl: Constructor<SafeApiUrl>

Defined in: types.ts:323

Constructor for SafeApiUrl branded type with validation.

Param ​

The URL string to validate and brand

Returns ​

A validated SafeApiUrl branded value

Throws ​

When the URL is invalid or fails security checks

Example ​

typescript
const apiUrl = SafeApiUrl('https://api.example.com/v1/');
SafeApiUrl('ftp://example.com');  // Throws: Invalid safe API URL