Now with more download and copy link options.
This commit is contained in:
@@ -1,5 +1,19 @@
|
||||
// These are all file related functions.
|
||||
|
||||
// Use a defined list of unacceptable characters to remove from a filename.
|
||||
// Updated 2024-10-18
|
||||
export let clean_filename = function clean_filename(filename: any|string, unacceptable_chars: RegExp = /[ <>:"/\\|?*]/g, replacement_char: string = '_') {
|
||||
// console.log('*** clean_filename() ***');
|
||||
if (!filename) {
|
||||
return '';
|
||||
}
|
||||
|
||||
let cleaned_filename = filename.replace(unacceptable_chars, replacement_char);
|
||||
// console.log(cleaned_filename);
|
||||
return cleaned_filename;
|
||||
}
|
||||
|
||||
|
||||
export let format_bytes = function format_bytes(
|
||||
bytes: number,
|
||||
decimals: number = 2
|
||||
|
||||
Reference in New Issue
Block a user