UNPKG

scriptguard-library

Version:

A secure and customizable text input field library for React.

7 lines (6 loc) 274 B
export function sanitizeFileName(filename: string): string { return filename .replace(/[\\/:*?"<>|]+/g, "") // remove forbidden chars .replace(/\s+/g, "-") // replace spaces with dashes .toLowerCase(); // normalize casing }