Skip to content

Commit 05c6eab

Browse files
committed
chore: fix prettier errors
1 parent 6a2e9f3 commit 05c6eab

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

src/save/__tests__/encodeBase64.test.ts

-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
import { createRgbaImage } from '../../../test/testUtils.js';
32
import { encode } from '../encode.js';
43
import { encodeBase64 } from '../encodeBase64.js';
@@ -86,6 +85,3 @@ test('legacy image-js test', () => {
8685
expect(typeof url).toBe('string');
8786
expect(base64Data).toBe(url.slice(url.indexOf(',') + 1));
8887
});
89-
90-
91-

src/save/encodeBase64.ts

+6-5
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ import type { ImageFormat } from './encode.js';
1010
* @returns base64 string.
1111
*/
1212
export function encodeBase64(image: Image, format: ImageFormat) {
13-
const buffer = encode(image, { format });
14-
const binaryString = new TextDecoder('latin1').decode(Uint8Array.from(buffer));
15-
const base64String = btoa(binaryString);
16-
return `data:image/${format};base64,${base64String}`;
13+
const buffer = encode(image, { format });
14+
const binaryString = new TextDecoder('latin1').decode(
15+
Uint8Array.from(buffer),
16+
);
17+
const base64String = btoa(binaryString);
18+
return `data:image/${format};base64,${base64String}`;
1719
}
18-

0 commit comments

Comments
 (0)