Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion __tests__/Str-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ describe('Str.isImage', () => {
expect(Str.isImage(buildTestURLForType('JPG'))).toBeTruthy();
expect(Str.isImage(buildTestURLForType('BMP'))).toBeTruthy();
expect(Str.isImage(buildTestURLForType('PNG'))).toBeTruthy();
expect(Str.isImage(buildTestURLForType('webp'))).toBeTruthy();
});

it('Does not confirm these types', () => {
// Note: These are types that React Native does not support as images so attempt to prevent their addition here
expect(Str.isImage(buildTestURLForType('tiff'))).toBeFalsy();
expect(Str.isImage(buildTestURLForType('webp'))).toBeFalsy();
expect(Str.isImage(buildTestURLForType('psd'))).toBeFalsy();
expect(Str.isImage(buildTestURLForType('pdf'))).toBeFalsy();
});
Expand Down
2 changes: 1 addition & 1 deletion lib/str.js
Original file line number Diff line number Diff line change
Expand Up @@ -1049,7 +1049,7 @@ const Str = {
* @returns {Boolean}
*/
isImage(url) {
return _.contains(['jpeg', 'jpg', 'gif', 'png', 'bmp'], this.getExtension(url));
return _.contains(['jpeg', 'jpg', 'gif', 'png', 'bmp', 'webp'], this.getExtension(url));
},

/**
Expand Down