backend/types/lib/validation.ts
creations fff3c3ca50
All checks were successful
Code quality checks / biome (push) Successful in 13s
- move config requiredVariables to contants
- change register email
- add verify route ( mostly still needs to be tested
2025-06-11 09:20:48 -04:00

39 lines
712 B
TypeScript

type genericValidation = {
length: { min: number; max: number };
regex: RegExp;
};
type validationResult = {
valid: boolean;
error?: string;
username?: string;
name?: string;
};
interface UrlValidationOptions {
failOnTrailingSlash?: boolean;
removeTrailingSlash?: boolean;
allowedProtocols?: string[];
requireProtocol?: boolean;
allowLocalhost?: boolean;
allowIP?: boolean;
maxLength?: number;
}
interface UrlValidationResult extends validationResult {
url?: string;
normalizedUrl?: string;
}
type simpleConfigValidation = {
isValid: boolean;
errors: string[];
};
export type {
genericValidation,
validationResult,
UrlValidationOptions,
UrlValidationResult,
simpleConfigValidation,
};