isafulf 2023-04-02 17:26:53 -07:00
parent 013a52a80d
commit 75cc4483d7
2 changed files with 10 additions and 0 deletions

View File

@ -1,6 +1,11 @@
// A function that takes a file name and a string and returns true if the file name is contained in the string
// after removing punctuation and whitespace from both
export const isFileNameInString = (fileName: string, str: string) => {
// Check if the input string is null or undefined
if (!str) {
return false;
}
// Convert both to lowercase and remove punctuation and whitespace
const normalizedFileName = fileName
.toLowerCase()

View File

@ -1,6 +1,11 @@
// A function that takes a file name and a string and returns true if the file name is contained in the string
// after removing punctuation and whitespace from both
export const isFileNameInString = (fileName: string, str: string) => {
// Check if the input string is null or undefined
if (!str) {
return false;
}
// Convert both to lowercase and remove punctuation and whitespace
const normalizedFileName = fileName
.toLowerCase()