@@ -5,7 +5,11 @@ import assert from 'node:assert/strict';
55const commonKeys = [ 'productName' ] ;
66type 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
4953export 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
5660export 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
6367export 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
7175export 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