Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
mdtanrikulu committed Sep 23, 2024
1 parent 9a20c9f commit d618cce
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/utils/isImageURI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ export const ALLOWED_IMAGE_MIMETYPES = [
];

export const IMAGE_SIGNATURES = {
'FFD8FF': 'image/jpeg',
FFD8FF: 'image/jpeg',
'89504E47': 'image/png',
'47494638': 'image/gif',
'424D': 'image/bmp',
'FF0A': 'image/jxl',
FF0A: 'image/jxl',
};

const MAX_FILE_SIZE = 300 * 1024 * 1024; // 300 MB
Expand Down
1 change: 0 additions & 1 deletion test/resolver.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,6 @@ describe('get banner/header', () => {
]
);


const HEADER_URI_TANRIKULU = new URL(
'https://ipfs.io/ipfs/QmUShgfoZQSHK3TQyuTfUpsc8UfeNfD8KwPUvDBUdZ4nmR'
);
Expand Down
9 changes: 7 additions & 2 deletions test/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ describe('resolve ipfs', () => {

it('resolve different ipfs uri cases with custom gateway', () => {
for (let uri of ipfsCases) {
const { uri: resolvedURI } = resolveURI(uri, { ipfs: 'https://custom-ipfs.io' });
const { uri: resolvedURI } = resolveURI(uri, {
ipfs: 'https://custom-ipfs.io',
});
expect(resolvedURI).toMatch(/^https:\/\/custom-ipfs.io\/?/);
}
});
Expand Down Expand Up @@ -321,7 +323,10 @@ describe('getImageURI', () => {

it('should handle errors in base64 decoding', () => {
const invalidBase64 = 'data:image/svg+xml;base64,Invalid Base64!!!';
const result = getImageURI({ metadata: { image: invalidBase64 }, jsdomWindow });
const result = getImageURI({
metadata: { image: invalidBase64 },
jsdomWindow,
});
expect(result).toBeNull();
});

Expand Down

0 comments on commit d618cce

Please sign in to comment.