Skip to content

Commit 9e2e8ef

Browse files
committed
chore: upgrade dependencies and fix compatibility
1 parent d6f86ca commit 9e2e8ef

File tree

7 files changed

+326
-629
lines changed

7 files changed

+326
-629
lines changed

package.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -76,21 +76,21 @@
7676
]
7777
},
7878
"devDependencies": {
79-
"@eslint/js": "^9.20.0",
79+
"@eslint/js": "^10.0.1",
8080
"@fictjs/runtime": "^0.8.0",
81-
"@types/node": "^22.13.1",
82-
"@vitest/coverage-v8": "^3.2.4",
81+
"@types/node": "^25.2.2",
82+
"@vitest/coverage-v8": "^4.0.18",
8383
"commitizen": "^4.3.1",
84-
"eslint": "^9.20.1",
84+
"eslint": "^10.0.0",
8585
"husky": "^9.1.7",
86-
"jsdom": "^27.4.0",
87-
"lint-staged": "^15.4.3",
88-
"prettier": "^3.5.1",
89-
"rimraf": "^6.0.1",
90-
"tsup": "^8.4.0",
91-
"typescript": "^5.7.3",
92-
"typescript-eslint": "^8.24.0",
93-
"vite": "^7.1.12",
94-
"vitest": "^3.2.4"
86+
"jsdom": "^28.0.0",
87+
"lint-staged": "^16.2.7",
88+
"prettier": "^3.8.1",
89+
"rimraf": "^6.1.2",
90+
"tsup": "^8.5.1",
91+
"typescript": "^5.9.3",
92+
"typescript-eslint": "^8.54.0",
93+
"vite": "^7.3.1",
94+
"vitest": "^4.0.18"
9595
}
9696
}

pnpm-lock.yaml

Lines changed: 302 additions & 606 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/clipboard/useClipboard.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,13 @@ function fallbackCopy(value: string, documentRef: Document): boolean {
3131
documentRef.body.appendChild(textarea);
3232
textarea.select();
3333

34-
let ok = false;
3534
try {
36-
ok = documentRef.execCommand('copy');
35+
return documentRef.execCommand('copy');
3736
} catch {
38-
ok = false;
37+
return false;
38+
} finally {
39+
documentRef.body.removeChild(textarea);
3940
}
40-
41-
documentRef.body.removeChild(textarea);
42-
return ok;
4341
}
4442

4543
/**

test/async/useRequest.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ describe('useRequest', () => {
109109

110110
await state.runAsync(2);
111111
expect(failure).toHaveBeenCalled();
112-
const [, failedParams] = failure.mock.calls.at(-1)!;
112+
const [, failedParams] = failure.mock.calls[failure.mock.calls.length - 1]!;
113113
expect(failedParams).toEqual([2]);
114114
expect((state.error() as Error).message).toBe('boom');
115115
});

test/storage/useLocalStorage.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ describe('useLocalStorage', () => {
5959

6060
state.set(3);
6161
expect(onError).toHaveBeenCalled();
62-
expect((onError.mock.calls.at(-1)?.[0] as Error).message).toBe('cannot write');
62+
const lastOnErrorCall = onError.mock.calls[onError.mock.calls.length - 1];
63+
expect((lastOnErrorCall?.[0] as Error).message).toBe('cannot write');
6364
});
6465
});

test/storage/useSessionStorage.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ describe('useSessionStorage', () => {
5959

6060
state.set('b');
6161
expect(onError).toHaveBeenCalled();
62-
expect((onError.mock.calls.at(-1)?.[0] as Error).message).toBe('cannot write session');
62+
const lastOnErrorCall = onError.mock.calls[onError.mock.calls.length - 1];
63+
expect((lastOnErrorCall?.[0] as Error).message).toBe('cannot write session');
6364
});
6465
});

test/storage/useStorage.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ describe('useStorage', () => {
9393

9494
state.set({ a: 2 });
9595
expect(onError).toHaveBeenCalled();
96-
expect((onError.mock.calls.at(-1)?.[0] as Error).message).toBe('write failed');
96+
const lastOnErrorCall = onError.mock.calls[onError.mock.calls.length - 1];
97+
expect((lastOnErrorCall?.[0] as Error).message).toBe('write failed');
9798
});
9899
});

0 commit comments

Comments
 (0)