Skip to content

Add regex to match file extension in image caching#37

Open
orindholt wants to merge 1 commit into
cra-template:mainfrom
orindholt:patch-1
Open

Add regex to match file extension in image caching#37
orindholt wants to merge 1 commit into
cra-template:mainfrom
orindholt:patch-1

Conversation

@orindholt

Copy link
Copy Markdown

The current way that the pathname in caching images was problematic, because it was impossible to add multiple file extensions on the endsWith string method. This makes it way easier to just include other file extensions. As I wrote in the comment above the changed line, you can add in any other file extensions by including the necessary file extension name in the regex, ex. (jpg|png|gif).

The current way that the pathname in caching images was problematic, because it was impossible to add multiple file extensions on the endsWith string method. This makes it way easier to just include other file extensions. As I wrote in the comment above the changed line, you can  add in any other file extensions by including the necessary file extension name in the regex, ex. (jpg|png|gif).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant