backend/types/lib/validation.ts
creations 1e6003079b
All checks were successful
Code quality checks / biome (push) Successful in 11s
move validationResult to value instead, add create, delete, list, info route for guilds
2025-06-18 18:43:47 -04:00

38 lines
693 B
TypeScript

type genericValidation = {
length: { min: number; max: number };
regex: RegExp;
};
type validationResult = {
valid: boolean;
error?: string;
value?: 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,
};