Skip to content

Commit 7c0f927

Browse files
authored
chore: update dependencies (#57)
1 parent 609ff84 commit 7c0f927

8 files changed

Lines changed: 162 additions & 91 deletions

File tree

eslint.config.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { defineConfig, globalIgnores } from 'eslint/config';
2-
import base from 'eslint-config-cheminfo-typescript/base';
3-
import unicorn from 'eslint-config-cheminfo-typescript/unicorn';
2+
import ts from 'eslint-config-cheminfo-typescript';
43

5-
export default defineConfig(globalIgnores(['coverage', 'lib']), base, unicorn);
4+
export default defineConfig(globalIgnores(['coverage', 'lib']), ts);

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,16 @@
3636
"pako": "^2.1.0"
3737
},
3838
"devDependencies": {
39-
"@types/node": "^24.0.1",
40-
"@vitest/coverage-v8": "^3.2.3",
41-
"@zakodium/tsconfig": "^1.0.1",
42-
"eslint": "^9.29.0",
43-
"eslint-config-cheminfo-typescript": "^18.0.1",
39+
"@types/node": "^24.1.0",
40+
"@vitest/coverage-v8": "^3.2.4",
41+
"@zakodium/tsconfig": "^1.0.2",
42+
"eslint": "^9.31.0",
43+
"eslint-config-cheminfo-typescript": "^19.0.0",
4444
"pngjs": "^7.0.0",
45-
"prettier": "^3.5.3",
45+
"prettier": "^3.6.2",
4646
"rimraf": "^6.0.1",
4747
"typescript": "^5.8.3",
48-
"vitest": "^3.2.3"
48+
"vitest": "^3.2.4"
4949
},
5050
"repository": {
5151
"type": "git",

src/__tests__/convert_indexed_to_rgb.test.ts

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@ describe('rgb', () => {
1818
text: {},
1919
};
2020
const view = convertIndexedToRgb(decodedImage);
21+
2122
expect(view).toStrictEqual(Uint8Array.from([0, 0, 1]));
2223
});
24+
2325
it('1 bit with multiple rows', () => {
2426
const palette: IndexedColors = [
2527
[0, 0, 1],
@@ -36,6 +38,7 @@ describe('rgb', () => {
3638
};
3739

3840
const view = convertIndexedToRgb(decodedImage);
41+
3942
expect(view).toStrictEqual(
4043
Uint8Array.from([
4144
0, 0, 2, 0, 0, 2, 0, 0, 2, 0, 0, 2, 0, 0, 2, 0, 0, 2, 0, 0, 2, 0, 0, 2,
@@ -61,6 +64,7 @@ describe('rgb', () => {
6164
};
6265

6366
const view = convertIndexedToRgb(decodedImage);
67+
6468
expect(view).toStrictEqual(Uint8Array.from([0, 0, 1, 0, 0, 4]));
6569
});
6670

@@ -82,6 +86,7 @@ describe('rgb', () => {
8286
};
8387

8488
const view = convertIndexedToRgb(decodedImage);
89+
8590
expect(view).toStrictEqual(
8691
Uint8Array.from([
8792
0, 0, 4, 0, 0, 4, 0, 0, 4, 0, 0, 3, 0, 0, 1, 0, 0, 4, 0, 0, 4, 0, 0, 4,
@@ -114,6 +119,7 @@ describe('rgb', () => {
114119
};
115120

116121
const view = convertIndexedToRgb(decodedImage);
122+
117123
expect(view).toStrictEqual(
118124
Uint8Array.from([
119125
0, 0, 1, 0, 0, 2, 0, 0, 3, 0, 0, 4, 0, 0, 5, 0, 0, 6, 0, 0, 7, 0, 0, 8,
@@ -145,6 +151,7 @@ describe('rgb', () => {
145151
};
146152

147153
const view = convertIndexedToRgb(decodedImage);
154+
148155
expect(view).toStrictEqual(
149156
Uint8Array.from([
150157
0, 0, 1, 0, 0, 2, 0, 0, 3, 0, 0, 4, 0, 0, 0, 0, 0, 5, 0, 0, 6, 0, 0, 7,
@@ -172,6 +179,7 @@ describe('rgb', () => {
172179
};
173180

174181
const view = convertIndexedToRgb(decodedImage);
182+
175183
expect(view).toStrictEqual(
176184
Uint8Array.from([0, 0, 1, 0, 0, 2, 0, 0, 3, 0, 0, 4]),
177185
);
@@ -181,7 +189,7 @@ describe('rgb', () => {
181189
const img = loadAndDecode('palette.png');
182190

183191
expect(img.palette).toBeDefined();
184-
expect(img.depth).toStrictEqual(8);
192+
expect(img.depth).toBe(8);
185193

186194
const data = convertIndexedToRgb(img);
187195
const newImg = encode({
@@ -195,12 +203,15 @@ describe('rgb', () => {
195203
// fs.writeFileSync(path.join(import.meta.dirname, "../../img/palette.new.png"), newImg, { flag: "w+" });
196204

197205
const newImageParsed = decode(newImg);
198-
expect(newImageParsed.data.byteLength).toStrictEqual(90000);
206+
207+
expect(newImageParsed.data.byteLength).toBe(90000);
199208
});
209+
200210
it('minecraft texture with tRNS ', () => {
201211
const img = loadAndDecode('cocoa_stage2.png');
212+
202213
expect(img.palette).toBeDefined();
203-
expect(img.depth).toStrictEqual(4);
214+
expect(img.depth).toBe(4);
204215

205216
const data = convertIndexedToRgb(img);
206217
const newImg = encode({
@@ -215,7 +226,7 @@ describe('rgb', () => {
215226

216227
const newImageParsed = decode(newImg);
217228

218-
expect(newImageParsed.data.byteLength).toStrictEqual(1024);
229+
expect(newImageParsed.data.byteLength).toBe(1024);
219230
});
220231
});
221232

@@ -236,6 +247,7 @@ describe('rgba', () => {
236247
};
237248

238249
const view = convertIndexedToRgb(decodedImage);
250+
239251
expect(view).toStrictEqual(
240252
Uint8Array.from(
241253
[
@@ -251,6 +263,7 @@ describe('rgba', () => {
251263
),
252264
);
253265
});
266+
254267
it('4 bit with RGBA', () => {
255268
const palette: IndexedColors = [
256269
[0, 0, 0, 25],
@@ -275,6 +288,7 @@ describe('rgba', () => {
275288
};
276289

277290
const view = convertIndexedToRgb(decodedImage);
291+
278292
expect(view).toStrictEqual(
279293
Uint8Array.from([
280294
0, 0, 1, 255, 0, 0, 2, 90, 0, 0, 3, 0, 0, 0, 4, 0, 0, 0, 5, 255, 0, 0,
@@ -294,10 +308,12 @@ describe('errors', () => {
294308
channels: 1,
295309
text: {},
296310
};
311+
297312
expect(() => {
298313
convertIndexedToRgb(decodedImage);
299314
}).toThrow('Color palette is undefined.');
300315
});
316+
301317
it('throws if data length is not correct', () => {
302318
const palette: IndexedColors = [
303319
[0, 0, 1],

0 commit comments

Comments
 (0)