@@ -111,26 +111,26 @@ function hasProperties<T extends Record<string, unknown>>(object: T): object is
111111export function partialPreferencesFromMap (
112112 map : Readonly < Record < string , string > >
113113) : Partial < GlobalPreferenceValues > {
114- const partial : Partial < GlobalPreferenceValues > = { } ;
114+ const partial : Record < string , unknown > = { } ;
115115
116- const auditing : Partial < GlobalPreferenceValues [ 'auditing' ] [ 'auditing' ] > = { } ;
116+ const auditingValues : Record < string , unknown > = { } ;
117117 const enableAuditLog = parseBoolean ( map [ PREFERENCE_KEYS . enableAuditLog ] ) ;
118- if ( enableAuditLog !== undefined ) auditing . enableAuditLog = enableAuditLog ;
118+ if ( enableAuditLog !== undefined ) auditingValues . enableAuditLog = enableAuditLog ;
119119
120120 const logFieldLevelChanges = parseBoolean ( map [ PREFERENCE_KEYS . logFieldLevelChanges ] ) ;
121121 if ( logFieldLevelChanges !== undefined )
122- auditing . logFieldLevelChanges = logFieldLevelChanges ;
122+ auditingValues . logFieldLevelChanges = logFieldLevelChanges ;
123123
124- if ( hasProperties ( auditing ) ) {
124+ if ( hasProperties ( auditingValues ) ) {
125125 partial . auditing = {
126- auditing : auditing as GlobalPreferenceValues [ 'auditing' ] [ 'auditing' ] ,
126+ auditing : auditingValues ,
127127 } ;
128128 }
129129
130- const formatting : Partial < GlobalPreferenceValues [ 'formatting' ] [ 'formatting' ] > = { } ;
130+ const formattingValues : Record < string , unknown > = { } ;
131131 const fullDateFormatRaw = map [ PREFERENCE_KEYS . fullDateFormat ] ;
132132 if ( fullDateFormatRaw !== undefined )
133- formatting . fullDateFormat = normalizeFormat ( fullDateFormatRaw ) ;
133+ formattingValues . fullDateFormat = normalizeFormat ( fullDateFormatRaw ) ;
134134
135135 const monthYearDateFormatRaw = map [ PREFERENCE_KEYS . monthYearDateFormat ] ;
136136 if ( monthYearDateFormatRaw !== undefined ) {
@@ -140,29 +140,29 @@ export function partialPreferencesFromMap(
140140 monthYearFormat as ( typeof MONTH_YEAR_FORMAT_OPTIONS ) [ number ]
141141 )
142142 )
143- formatting . monthYearDateFormat = monthYearFormat ;
143+ formattingValues . monthYearDateFormat = monthYearFormat ;
144144 }
145145
146- if ( hasProperties ( formatting ) ) {
146+ if ( hasProperties ( formattingValues ) ) {
147147 partial . formatting = {
148- formatting : formatting as GlobalPreferenceValues [ 'formatting' ] [ 'formatting' ] ,
148+ formatting : formattingValues ,
149149 } ;
150150 }
151151
152- const attachments : Partial < GlobalPreferenceValues [ 'attachments' ] [ 'attachments' ] > = { } ;
152+ const attachmentValues : Record < string , unknown > = { } ;
153153 const attachmentThumbnailSize = parseNumber (
154154 map [ PREFERENCE_KEYS . attachmentThumbnailSize ]
155155 ) ;
156156 if ( attachmentThumbnailSize !== undefined )
157- attachments . attachmentThumbnailSize = attachmentThumbnailSize ;
157+ attachmentValues . attachmentThumbnailSize = attachmentThumbnailSize ;
158158
159- if ( hasProperties ( attachments ) ) {
159+ if ( hasProperties ( attachmentValues ) ) {
160160 partial . attachments = {
161- attachments : attachments as GlobalPreferenceValues [ 'attachments' ] [ 'attachments' ] ,
161+ attachments : attachmentValues ,
162162 } ;
163163 }
164164
165- return partial ;
165+ return partial as Partial < GlobalPreferenceValues > ;
166166}
167167
168168export function mergeWithDefaultValues (
0 commit comments