Skip to content

Commit 4b577a2

Browse files
committed
Use unknown over any
1 parent 96f2856 commit 4b577a2

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

packages/compass-e2e-tests/helpers/buildinfo.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ import assert from 'node:assert/strict';
55
const commonKeys = ['productName'];
66
type CommonBuildInfo = Record<typeof commonKeys[number], string>;
77

8-
function assertObjectHasKeys(obj: any, name: string, keys: readonly string[]) {
8+
function assertObjectHasKeys(
9+
obj: unknown,
10+
name: string,
11+
keys: readonly string[]
12+
) {
913
assert(
1014
typeof obj === 'object' && obj !== null,
1115
'Expected buildInfo to be an object'
@@ -47,29 +51,29 @@ type RHELBuildInfo = CommonBuildInfo &
4751
Record<typeof rhelFilenameKeys[number], string>;
4852

4953
export function assertBuildInfoIsWindows(
50-
buildInfo: any
54+
buildInfo: unknown
5155
): asserts buildInfo is WindowsBuildInfo {
5256
assertObjectHasKeys(buildInfo, 'buildInfo', commonKeys);
5357
assertObjectHasKeys(buildInfo, 'buildInfo', windowsFilenameKeys);
5458
}
5559

5660
export function assertBuildInfoIsOSX(
57-
buildInfo: any
61+
buildInfo: unknown
5862
): asserts buildInfo is OSXBuildInfo {
5963
assertObjectHasKeys(buildInfo, 'buildInfo', commonKeys);
6064
assertObjectHasKeys(buildInfo, 'buildInfo', osxFilenameKeys);
6165
}
6266

6367
export function assertBuildInfoIsUbuntu(
64-
buildInfo: any
68+
buildInfo: unknown
6569
): buildInfo is UbuntuBuildInfo {
6670
assertObjectHasKeys(buildInfo, 'buildInfo', commonKeys);
6771
assertObjectHasKeys(buildInfo, 'buildInfo', ubuntuFilenameKeys);
6872
return true;
6973
}
7074

7175
export function assertBuildInfoIsRHEL(
72-
buildInfo: any
76+
buildInfo: unknown
7377
): asserts buildInfo is RHELBuildInfo {
7478
assertObjectHasKeys(buildInfo, 'buildInfo', commonKeys);
7579
assertObjectHasKeys(buildInfo, 'buildInfo', rhelFilenameKeys);

0 commit comments

Comments
 (0)