@bhplugin/vue3-datatable
Version:
Vue3 Datatable - fully customizable & easy to use datatable library
19 lines (18 loc) • 928 B
TypeScript
/**
* Pure utility functions used across composables and components.
* No Vue reactivity — these are stateless helpers.
*/
/** Resolve a dot-notation field path from a row object. */
export declare const cellValue: (item: Record<string, unknown>, field: string | undefined) => unknown;
/** Format a date value to `YYYY-MM-DD` string. Returns empty string on invalid input. */
export declare const dateFormat: (date: unknown) => string;
/** Replace `{0}`, `{1}`, etc. placeholders in a template string. */
export declare const stringFormat: (template: string, ...args: Array<string | number>) => string;
/**
* Lightweight HTML sanitizer — strips dangerous elements and attributes.
* SSR-safe (pure string operations, no DOM APIs).
*
* Strips: script, style, iframe, object, embed, form tags + content.
* Strips: on* event attributes, javascript: URIs.
*/
export declare const sanitizeHtml: (html: string) => string;