Skip to content

Commit

Permalink
Type tweaks
Browse files Browse the repository at this point in the history
Appeasing (coercing!) the linter
  • Loading branch information
benrj committed Oct 26, 2021
1 parent c20ecd9 commit 1f513df
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ export function generateUpdateParams(
};
}

interface DynamoDbDaoInput<T> {
export interface DynamoDbDaoInput<T> {
tableName: string;
documentClient: DocumentClient;
optimisticLockingAttribute?: keyof NumberPropertiesInType<T>;
Expand Down Expand Up @@ -454,9 +454,8 @@ export default class DynamoDbDao<DataModel, KeySchema> {
key,
data,
...updateOptions,
optimisticLockVersionAttribute: this.optimisticLockingAttribute
? this.optimisticLockingAttribute.toString()
: undefined,
optimisticLockVersionAttribute:
this.optimisticLockingAttribute?.toString(),
});
const { Attributes: attributes } = await this.documentClient
.update(params)
Expand Down
4 changes: 2 additions & 2 deletions test/helpers/TestContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { DynamoDB } from 'aws-sdk';
import { v4 as uuid } from 'uuid';
import DynamoDbDao from '../../src';
import DynamoDbDao, { DynamoDbDaoInput } from '../../src';

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

Expand Down Expand Up @@ -101,7 +101,7 @@ export default class TestContext {
tableName,
documentClient,
optimisticLockingAttribute: useOptimisticLocking ? 'version' : undefined,
});
} as DynamoDbDaoInput<DataModel>);

return new TestContext(tableName, indexName, dao);
}
Expand Down

0 comments on commit 1f513df

Please sign in to comment.