@@ -44,7 +44,7 @@ export function toDb<T>(item: T, modelConstructor?: ModelConstructor<T>): Attrib
4444 * initialize possible properties with default value providers
4545 */
4646 if ( metadata ) {
47- metadata . getPropertiesWithDefaultValueProvider ( ) . forEach ( propertyMetadata => {
47+ metadata . getPropertiesWithDefaultValueProvider ( ) . forEach ( ( propertyMetadata ) => {
4848 const currentVal = Reflect . get ( < any > item , propertyMetadata . name )
4949 if ( currentVal === undefined || currentVal === null ) {
5050 // tslint:disable-next-line:no-non-null-assertion
@@ -184,7 +184,7 @@ export function createToKeyFn<T>(modelConstructor: ModelConstructor<T>): (item:
184184 throw new Error ( `there is no value for property ${ propMeta . name . toString ( ) } but is ${ propMeta . key . type } key` )
185185 }
186186 const propertyValue = getPropertyValue ( item , propMeta . name )
187- key [ propMeta . nameDb ] = < Attribute > toDbOne ( propertyValue , propMeta )
187+ ; ( key as any ) [ propMeta . nameDb ] = < Attribute > toDbOne ( propertyValue , propMeta )
188188 return key
189189 } , < Attributes < T > > { } )
190190 }
@@ -220,15 +220,15 @@ export function createKeyAttributes<T>(
220220
221221 if ( hasSortKey ( metadata ) ) {
222222 if ( sortKey === null || sortKey === undefined ) {
223- throw new Error ( `please provide the sort key for attribute ${ metadata . getSortKey ( ) } ` )
223+ throw new Error ( `please provide the sort key for attribute ${ String ( metadata . getSortKey ( ) ) } ` )
224224 }
225225 const sortKeyProp = metadata . getSortKey ( )
226226 const sortKeyMetadata = metadata . forProperty ( sortKeyProp )
227227 if ( ! sortKeyMetadata ) {
228228 throw new Error ( 'metadata for sort key must be defined' )
229229 }
230230
231- keyAttributeMap [ sortKeyMetadata . nameDb ] = < Attribute > toDbOne ( sortKey , sortKeyMetadata )
231+ ; ( keyAttributeMap as any ) [ sortKeyMetadata . nameDb ] = < Attribute > toDbOne ( sortKey , sortKeyMetadata )
232232 }
233233
234234 return keyAttributeMap
0 commit comments