Skip to content

Commit 1f513df

Browse files
committed
Type tweaks
Appeasing (coercing!) the linter
1 parent c20ecd9 commit 1f513df

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/index.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ export function generateUpdateParams(
274274
};
275275
}
276276

277-
interface DynamoDbDaoInput<T> {
277+
export interface DynamoDbDaoInput<T> {
278278
tableName: string;
279279
documentClient: DocumentClient;
280280
optimisticLockingAttribute?: keyof NumberPropertiesInType<T>;
@@ -454,9 +454,8 @@ export default class DynamoDbDao<DataModel, KeySchema> {
454454
key,
455455
data,
456456
...updateOptions,
457-
optimisticLockVersionAttribute: this.optimisticLockingAttribute
458-
? this.optimisticLockingAttribute.toString()
459-
: undefined,
457+
optimisticLockVersionAttribute:
458+
this.optimisticLockingAttribute?.toString(),
460459
});
461460
const { Attributes: attributes } = await this.documentClient
462461
.update(params)

test/helpers/TestContext.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import { DynamoDB } from 'aws-sdk';
44
import { v4 as uuid } from 'uuid';
5-
import DynamoDbDao from '../../src';
5+
import DynamoDbDao, { DynamoDbDaoInput } from '../../src';
66

77
const { DYNAMODB_ENDPOINT = 'http://localhost:8000' } = process.env;
88

@@ -101,7 +101,7 @@ export default class TestContext {
101101
tableName,
102102
documentClient,
103103
optimisticLockingAttribute: useOptimisticLocking ? 'version' : undefined,
104-
});
104+
} as DynamoDbDaoInput<DataModel>);
105105

106106
return new TestContext(tableName, indexName, dao);
107107
}

0 commit comments

Comments
 (0)