Skip to content

Commit e561484

Browse files
author
Michael Wittwer
committed
feat(aws-sdk-v3): fix code, disable lint for certain lines
since it removes necesarry code
1 parent 615a59c commit e561484

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

src/dynamo/expression/prepare-and-add-update-expressions.function.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ export function prepareAndAddUpdateExpressions(
2222
const sortedByActionKeyWord: Map<UpdateActionKeyword, UpdateExpression[]> = updateDefFns
2323
.map((updateDefFn) => {
2424
// TODO v3: investigate on how to remove any
25-
return updateDefFn(params.ExpressionAttributeNames, metadata)
25+
// tslint:disable-next-line:no-unnecessary-type-assertion
26+
return updateDefFn(params.ExpressionAttributeNames as any, metadata)
2627
})
2728
.reduce((result, expr) => {
2829
const actionKeyword = expr.type

src/dynamo/request/get/get.request.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ export class GetRequest<T, T2 extends Partial<T> = T> extends StandardRequest<
5353
.then(promiseTap((response) => this.logger.debug('response', response)))
5454
.then((getItemResponse) => {
5555
// TODO v3: investigate on how to remove any
56-
const response: GetResponse<T2> = { ...(getItemResponse) }
56+
// tslint:disable-next-line:no-unnecessary-type-assertion
57+
const response: GetResponse<T2> = { ...(getItemResponse as any) }
5758

5859
if (getItemResponse.Item) {
5960
response.Item = fromDb(<Attributes<T2>>getItemResponse.Item, <any>this.modelClazz)

src/mapper/mapper.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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 as any)[propMeta.nameDb] = <Attribute>toDbOne(propertyValue, propMeta)
187+
;(key as any)[propMeta.nameDb] = toDbOne(propertyValue, propMeta)
188188
return key
189189
}, <Attributes<T>>{})
190190
}
@@ -228,7 +228,7 @@ export function createKeyAttributes<T>(
228228
throw new Error('metadata for sort key must be defined')
229229
}
230230

231-
;(keyAttributeMap as any)[sortKeyMetadata.nameDb] = <Attribute>toDbOne(sortKey, sortKeyMetadata)
231+
;(keyAttributeMap as any)[sortKeyMetadata.nameDb] = toDbOne(sortKey, sortKeyMetadata)
232232
}
233233

234234
return keyAttributeMap

0 commit comments

Comments
 (0)