Skip to content

Commit f37ae13

Browse files
committed
Refactor attribute decorators in Entity class to use the correct character for partition and sort key annotations. Update documentation examples to reflect these changes, ensuring consistency across the library.
1 parent 9c6765b commit f37ae13

6 files changed

Lines changed: 281 additions & 22 deletions

File tree

lib/decorators/index.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,19 @@ import {
2525
* @example
2626
* ```typescript
2727
* class User extends Entity {
28-
* @attribute.partitionKey.string()
28+
* attribute.partitionKey.string()
2929
* id: string;
3030
*
31-
* @attribute.sortKey.number()
31+
* attribute.sortKey.number()
3232
* createdAt: number;
3333
*
34-
* @attribute.string()
34+
* attribute.string()
3535
* name: string;
3636
*
37-
* @attribute.gsi.partitionKey.string({ indexName: 'NameIndex' })
37+
* attribute.gsi.partitionKey.string({ indexName: 'NameIndex' })
3838
* nameIndex: string;
3939
*
40-
* @attribute.lsi.sortKey.string({ indexName: 'StatusIndex' })
40+
* attribute.lsi.sortKey.string({ indexName: 'StatusIndex' })
4141
* status: string;
4242
* }
4343
* ```
@@ -124,7 +124,7 @@ const attribute = {
124124
* ```typescript
125125
* @entity.customName('CustomUser')
126126
* class User extends Entity {
127-
* @attribute.partitionKey.string()
127+
* attribute.partitionKey.string()
128128
* id: string;
129129
* }
130130
* ```

lib/entity/entityManager.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,10 @@ import { AttributeValues, ExpressionBuilder, fromDynamo, NotFoundError } from '@
7272
* @example
7373
* ```typescript
7474
* class User extends Entity {
75-
* @attribute.partitionKey.string()
75+
* attribute.partitionKey.string()
7676
* id: string;
7777
*
78-
* @attribute.string()
78+
* attribute.string()
7979
* name: string;
8080
* }
8181
*

lib/entity/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ import { DYNAMODE_ENTITY } from '@lib/utils';
1111
* @example
1212
* ```typescript
1313
* class User extends Entity {
14-
* @attribute.partitionKey.string()
14+
* attribute.partitionKey.string()
1515
* id: string;
1616
*
17-
* @attribute.string()
17+
* attribute.string()
1818
* name: string;
1919
*
2020
* constructor(props: { id: string; name: string }) {
@@ -55,7 +55,7 @@ export default class Entity {
5555
* @example
5656
* ```typescript
5757
* class Product extends Entity {
58-
* @attribute.partitionKey.string()
58+
* attribute.partitionKey.string()
5959
* id: string;
6060
*
6161
* constructor(props: { id: string }) {

lib/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
*
1818
* // Define an entity
1919
* class User extends Entity {
20-
* @attribute.partitionKey.string()
20+
* attribute.partitionKey.string()
2121
* id: string;
2222
*
23-
* @attribute.string()
23+
* attribute.string()
2424
* name: string;
2525
* }
2626
*

lib/module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ declare global {
3030
* import { Entity, TableManager, attribute } from 'dynamode';
3131
*
3232
* class User extends Entity {
33-
* @attribute.partitionKey.string()
33+
* attribute.partitionKey.string()
3434
* id: string;
3535
*
36-
* @attribute.string()
36+
* attribute.string()
3737
* name: string;
3838
* }
3939
*

0 commit comments

Comments
 (0)