Skip to content

Commit

Permalink
address openai#159
Browse files Browse the repository at this point in the history
  • Loading branch information
isafulf committed Apr 3, 2023
1 parent 013a52a commit 75cc448
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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()
Expand Down
5 changes: 5 additions & 0 deletions apps/file-q-and-a/nextjs/src/services/utils.ts
Original file line number Diff line number Diff line change
@@ -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()
Expand Down

0 comments on commit 75cc448

Please sign in to comment.