Skip to content

Commit

Permalink
docs(typescript): typo with associations (#10707)
Browse files Browse the repository at this point in the history
  • Loading branch information
abernix authored and sushantdhiman committed Apr 8, 2019
1 parent 175da2d commit 57aba97
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/typescript.md
Expand Up @@ -43,7 +43,7 @@ class User extends Model {
// actively include a relation.
public readonly projects?: Project[];

public static associtations: {
public static associations: {
projects: Association<User, Project>;
};
}
Expand Down
4 changes: 2 additions & 2 deletions types/test/e2e/docs-example.ts
Expand Up @@ -34,7 +34,7 @@ class User extends Model {
// actively include a relation.
public readonly projects?: Project[];

public static associtations: {
public static associations: {
projects: Association<User, Project>;
};
}
Expand Down Expand Up @@ -133,7 +133,7 @@ async function stuff() {
});

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

0 comments on commit 57aba97

Please sign in to comment.