@@ -41,27 +41,65 @@ export const windowsFilenameKeys = [
4141 'windows_nupkg_full_filename' ,
4242] as const ;
4343export type WindowsBuildInfo = CommonBuildInfo &
44- Record < typeof windowsFilenameKeys [ number ] , string > ;
44+ Record < typeof windowsFilenameKeys [ number ] , string > & {
45+ installerOptions : {
46+ name : string ;
47+ } ;
48+ } ;
4549
4650export function assertBuildInfoIsWindows (
4751 buildInfo : unknown
4852) : asserts buildInfo is WindowsBuildInfo {
4953 assertObjectHasKeys ( buildInfo , 'buildInfo' , commonKeys ) ;
5054 assertObjectHasKeys ( buildInfo , 'buildInfo' , windowsFilenameKeys ) ;
55+ assert ( typeof buildInfo === 'object' , 'Expected buildInfo to be an object' ) ;
56+ assert ( buildInfo !== null , 'Expected buildInfo to be an object' ) ;
57+ assert (
58+ 'installerOptions' in buildInfo &&
59+ typeof buildInfo . installerOptions === 'object' ,
60+ 'Expected buildInfo.installerOptions to be an object'
61+ ) ;
62+ const { installerOptions } = buildInfo ;
63+ assert (
64+ typeof installerOptions === 'object' &&
65+ installerOptions !== null &&
66+ 'name' in installerOptions &&
67+ typeof installerOptions . name === 'string' ,
68+ 'Expected buildInfo.installerOptions.name to be a string'
69+ ) ;
5170}
5271
5372export const osxFilenameKeys = [
5473 'osx_dmg_filename' ,
5574 'osx_zip_filename' ,
5675] as const ;
5776export type OSXBuildInfo = CommonBuildInfo &
58- Record < typeof osxFilenameKeys [ number ] , string > ;
77+ Record < typeof osxFilenameKeys [ number ] , string > & {
78+ installerOptions : {
79+ title : string ;
80+ } ;
81+ } ;
5982
6083export function assertBuildInfoIsOSX (
6184 buildInfo : unknown
6285) : asserts buildInfo is OSXBuildInfo {
6386 assertObjectHasKeys ( buildInfo , 'buildInfo' , commonKeys ) ;
6487 assertObjectHasKeys ( buildInfo , 'buildInfo' , osxFilenameKeys ) ;
88+ assert ( typeof buildInfo === 'object' , 'Expected buildInfo to be an object' ) ;
89+ assert ( buildInfo !== null , 'Expected buildInfo to be an object' ) ;
90+ assert (
91+ 'installerOptions' in buildInfo &&
92+ typeof buildInfo . installerOptions === 'object' ,
93+ 'Expected buildInfo.installerOptions to be an object'
94+ ) ;
95+ const { installerOptions } = buildInfo ;
96+ assert (
97+ typeof installerOptions === 'object' &&
98+ installerOptions !== null &&
99+ 'title' in installerOptions &&
100+ typeof installerOptions . title === 'string' ,
101+ 'Expected buildInfo.installerOptions.title to be a string'
102+ ) ;
65103}
66104
67105export const ubuntuFilenameKeys = [
@@ -93,6 +131,7 @@ export type PackageDetails = {
93131 kind : PackageKind ;
94132 filename : string ;
95133 autoUpdatable : boolean ;
134+ appName : string ;
96135} & (
97136 | {
98137 kind : 'windows_setup' | 'windows_msi' | 'windows_zip' ;
@@ -129,6 +168,7 @@ export function getPackageDetails(
129168 kind,
130169 buildInfo,
131170 filename : buildInfo [ `${ kind } _filename` ] ,
171+ appName : buildInfo . installerOptions . name ,
132172 autoUpdatable : kind === 'windows_setup' ,
133173 } ;
134174 } else if ( kind === 'osx_dmg' || kind === 'osx_zip' ) {
@@ -137,6 +177,7 @@ export function getPackageDetails(
137177 kind,
138178 buildInfo,
139179 filename : buildInfo [ `${ kind } _filename` ] ,
180+ appName : buildInfo . installerOptions . title ,
140181 autoUpdatable : true ,
141182 } ;
142183 } else if ( kind === 'linux_deb' || kind === 'linux_tar' ) {
@@ -145,6 +186,7 @@ export function getPackageDetails(
145186 kind,
146187 buildInfo,
147188 filename : buildInfo [ `${ kind } _filename` ] ,
189+ appName : buildInfo . productName ,
148190 autoUpdatable : false ,
149191 } ;
150192 } else if ( kind === 'linux_rpm' || kind === 'rhel_tar' ) {
@@ -153,6 +195,7 @@ export function getPackageDetails(
153195 kind,
154196 buildInfo,
155197 filename : buildInfo [ `${ kind } _filename` ] ,
198+ appName : buildInfo . productName ,
156199 autoUpdatable : false ,
157200 } ;
158201 } else {
0 commit comments