feat: Introduce fe modular build system

This commit is contained in:
divocat
2025-10-02 21:40:16 +03:00
parent 4ef15f7340
commit 294cb21e91
21 changed files with 2294 additions and 17 deletions

View File

@@ -0,0 +1,23 @@
import { validateDomain } from './validateDomain';
import { validateIPV4 } from './validateIp';
import { ValidationResult } from './types.js';
export function validateDNS(value: string): ValidationResult {
if (!value) {
return { valid: false, message: 'DNS server address cannot be empty' };
}
if (validateIPV4(value).valid) {
return { valid: true, message: 'Valid' };
}
if (validateDomain(value).valid) {
return { valid: true, message: 'Valid' };
}
return {
valid: false,
message:
'Invalid DNS server format. Examples: 8.8.8.8 or dns.example.com or dns.example.com/nicedns for DoH',
};
}