Skip to content

Commit

Permalink
Merge pull request #79 from ahom/options
Browse files Browse the repository at this point in the history
fix: Adds options
  • Loading branch information
ahom authored Oct 14, 2021
2 parents a14ffd4 + 028622b commit 502c54b
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions src/db/resource-table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,39 @@ export class ResourceTableBuilder<H, S, HT, ST, A> {
this.tableName,
this.resourceType,
{
...this.props,
transform: undefined,
hashTransform: hashTransform,
sortTransform: sortTransform
}
);
}

withoutIncludedMeta() {
return new ResourceTableBuilder<H, S, HT, ST, A>(
this.dynamoDBClient,
this.tableName,
this.resourceType,
{
...this.props,
doNotIncludeMeta: true
}
);
}

withoutIncludedKeys() {
return new ResourceTableBuilder<H, S, HT, ST, A>(
this.dynamoDBClient,
this.tableName,
this.resourceType,
{
...this.props,
doNotIncludeKeys: true
}
);
}


withTransform(
transform: (key: H & S, attr: A) => any
) {
Expand All @@ -179,8 +206,7 @@ export class ResourceTableBuilder<H, S, HT, ST, A> {
this.tableName,
this.resourceType,
{
hashTransform: this.props.hashTransform,
sortTransform: this.props.sortTransform,
...this.props,
transform
}
);
Expand Down

0 comments on commit 502c54b

Please sign in to comment.