Skip to content

Commit 57aba97

Browse files
abernixsushantdhiman
authored andcommitted
docs(typescript): typo with associations (#10707)
1 parent 175da2d commit 57aba97

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

docs/typescript.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class User extends Model {
4343
// actively include a relation.
4444
public readonly projects?: Project[];
4545

46-
public static associtations: {
46+
public static associations: {
4747
projects: Association<User, Project>;
4848
};
4949
}

types/test/e2e/docs-example.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class User extends Model {
3434
// actively include a relation.
3535
public readonly projects?: Project[];
3636

37-
public static associtations: {
37+
public static associations: {
3838
projects: Association<User, Project>;
3939
};
4040
}
@@ -133,7 +133,7 @@ async function stuff() {
133133
});
134134

135135
const ourUser = await User.findByPk(1, {
136-
include: [User.associations.Project],
136+
include: [User.associations.projects],
137137
rejectOnEmpty: true, // Specifying true here removes `null` from the return type!
138138
});
139139
console.log(ourUser.projects![0].name); // Note the `!` null assertion since TS can't know if we included

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy