Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
public
/
sequelize
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
不要怂,就是干,撸起袖子干!
Commit 57aba974
authored
Apr 08, 2019
by
Jesse Rosenberger
Committed by
Sushant
Apr 08, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
docs(typescript): typo with associations (#10707)
1 parent
175da2d0
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
docs/typescript.md
types/test/e2e/docs-example.ts
docs/typescript.md
View file @
57aba97
...
@@ -43,7 +43,7 @@ class User extends Model {
...
@@ -43,7 +43,7 @@ class User extends Model {
// actively include a relation.
// actively include a relation.
public
readonly
projects
?:
Project
[];
public
readonly
projects
?:
Project
[];
public
static
associ
t
ations
:
{
public
static
associations
:
{
projects
:
Association
<
User
,
Project
>
;
projects
:
Association
<
User
,
Project
>
;
};
};
}
}
...
...
types/test/e2e/docs-example.ts
View file @
57aba97
...
@@ -34,7 +34,7 @@ class User extends Model {
...
@@ -34,7 +34,7 @@ class User extends Model {
// actively include a relation.
// actively include a relation.
public
readonly
projects
?:
Project
[];
public
readonly
projects
?:
Project
[];
public
static
associ
t
ations
:
{
public
static
associations
:
{
projects
:
Association
<
User
,
Project
>
;
projects
:
Association
<
User
,
Project
>
;
};
};
}
}
...
@@ -133,7 +133,7 @@ async function stuff() {
...
@@ -133,7 +133,7 @@ async function stuff() {
});
});
const
ourUser
=
await
User
.
findByPk
(
1
,
{
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!
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
console
.
log
(
ourUser
.
projects
!
[
0
].
name
);
// Note the `!` null assertion since TS can't know if we included
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment