Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ describe('normalizeFile', () => {

const invalidResult = await normalizeFile({ uri: 'uri', size: null, name: 'fromName.pdf', type: 'invalid' });
expect(invalidResult).toStrictEqual({ uri: 'uri', size: 0, name: 'fromName.pdf', type: 'application/pdf' });

const heicResult = await normalizeFile({ uri: 'uri', size: null, name: 'fromName.heic', type: null });
expect(heicResult).toStrictEqual({ uri: 'uri', size: 0, name: 'fromName.heic', type: 'image/heic' });

const heifResult = await normalizeFile({ uri: 'uri', size: null, name: 'fromName.heif', type: null });
expect(heifResult).toStrictEqual({ uri: 'uri', size: 0, name: 'fromName.heif', type: 'image/heif' });
});

it('should get type from uri if name and type are invalid', async () => {
Expand Down
2 changes: 2 additions & 0 deletions packages/uikit-utils/src/shared/file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ const EXTENSION_MIME_MAP = {
'gif': 'image/gif',
'webp': 'image/webp',
'svg': 'image/svg+xml',
'heic': 'image/heic',
'heif': 'image/heif',

// Video
'3gp': 'video/3gpp',
Expand Down