File tree 2 files changed +5
-6
lines changed
2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -274,7 +274,7 @@ export function generateUpdateParams(
274
274
} ;
275
275
}
276
276
277
- interface DynamoDbDaoInput < T > {
277
+ export interface DynamoDbDaoInput < T > {
278
278
tableName : string ;
279
279
documentClient : DocumentClient ;
280
280
optimisticLockingAttribute ?: keyof NumberPropertiesInType < T > ;
@@ -454,9 +454,8 @@ export default class DynamoDbDao<DataModel, KeySchema> {
454
454
key,
455
455
data,
456
456
...updateOptions ,
457
- optimisticLockVersionAttribute : this . optimisticLockingAttribute
458
- ? this . optimisticLockingAttribute . toString ( )
459
- : undefined ,
457
+ optimisticLockVersionAttribute :
458
+ this . optimisticLockingAttribute ?. toString ( ) ,
460
459
} ) ;
461
460
const { Attributes : attributes } = await this . documentClient
462
461
. update ( params )
Original file line number Diff line number Diff line change 2
2
3
3
import { DynamoDB } from 'aws-sdk' ;
4
4
import { v4 as uuid } from 'uuid' ;
5
- import DynamoDbDao from '../../src' ;
5
+ import DynamoDbDao , { DynamoDbDaoInput } from '../../src' ;
6
6
7
7
const { DYNAMODB_ENDPOINT = 'http://localhost:8000' } = process . env ;
8
8
@@ -101,7 +101,7 @@ export default class TestContext {
101
101
tableName,
102
102
documentClient,
103
103
optimisticLockingAttribute : useOptimisticLocking ? 'version' : undefined ,
104
- } ) ;
104
+ } as DynamoDbDaoInput < DataModel > ) ;
105
105
106
106
return new TestContext ( tableName , indexName , dao ) ;
107
107
}
You can’t perform that action at this time.
0 commit comments