@stacksjs/stx
Version:
A performant UI Framework. Powered by Bun.
43 lines (42 loc) • 1.19 kB
TypeScript
/**
* Sanitize a directive parameter value
*/
export declare function sanitizeDirectiveParam(param: string, options?: SanitizeOptions): SanitizedParam;
/**
* Sanitize a file path parameter
*/
export declare function sanitizeFilePath(filePath: string, baseDir?: string): string | null;
/**
* Sanitize an expression parameter (used in @if, @foreach, etc.)
*/
export declare function sanitizeExpression(expr: string): SanitizedParam;
/**
* Sanitize multiple directive parameters at once
*/
export declare function sanitizeDirectiveParams(params: string[], options?: SanitizeOptions): SanitizedParam[];
/**
* Validate and sanitize component props
*/
export declare function sanitizeComponentProps(props: Record<string, unknown>): Record<string, unknown>;
/**
* Validation utilities
*/
export declare const validators: {
};
/**
* Options for parameter sanitization
*/
export declare interface SanitizeOptions {
allowHtml?: boolean
maxLength?: number
allowSpecialChars?: boolean
customSanitizer?: (value: string) => string
}
/**
* Result of parameter sanitization
*/
export declare interface SanitizedParam {
value: string
modified: boolean
warnings: string[]
}