19 lines
676 B
TypeScript
19 lines
676 B
TypeScript
import type { BunMariaDBConfig } from "../types";
|
|
/**
|
|
* Sanitize string values ONLY for schema fields with explicit `html: true`.
|
|
* Other fields (including plain text that happens to contain HTML) are left untouched.
|
|
*/
|
|
export default function sanitizeHtmlFields<T extends Record<string, any> = Record<string, any>>({ table, data, config, }: {
|
|
table: string;
|
|
data: T;
|
|
config?: BunMariaDBConfig;
|
|
}): T;
|
|
/**
|
|
* Sanitize an array of row objects for insert.
|
|
*/
|
|
export declare function sanitizeHtmlFieldsBatch<T extends Record<string, any> = Record<string, any>>({ table, data, config, }: {
|
|
table: string;
|
|
data: T[];
|
|
config?: BunMariaDBConfig;
|
|
}): T[];
|