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 8d1972f6
authored
Apr 24, 2019
by
Mirko Jotic
Committed by
Sushant
Apr 24, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(types): reorder model.get overload (#10797)
1 parent
0c447227
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
types/lib/model.d.ts
types/test/model.ts
types/lib/model.d.ts
View file @
8d1972f
...
@@ -2476,8 +2476,8 @@ export abstract class Model<T = any, T2 = any> extends Hooks {
...
@@ -2476,8 +2476,8 @@ export abstract class Model<T = any, T2 = any> extends Hooks {
* @param options.plain If set to true, included instances will be returned as plain objects
* @param options.plain If set to true, included instances will be returned as plain objects
*/
*/
public
get
(
options
?:
{
plain
?:
boolean
;
clone
?:
boolean
}):
object
;
public
get
(
options
?:
{
plain
?:
boolean
;
clone
?:
boolean
}):
object
;
public
get
(
key
:
string
,
options
?:
{
plain
?:
boolean
;
clone
?:
boolean
}):
unknown
;
public
get
<
K
extends
keyof
this
>
(
key
:
K
,
options
?:
{
plain
?:
boolean
;
clone
?:
boolean
}):
this
[
K
];
public
get
<
K
extends
keyof
this
>
(
key
:
K
,
options
?:
{
plain
?:
boolean
;
clone
?:
boolean
}):
this
[
K
];
public
get
(
key
:
string
,
options
?:
{
plain
?:
boolean
;
clone
?:
boolean
}):
unknown
;
/**
/**
* Set is used to update values on the instance (the sequelize representation of the instance that is,
* Set is used to update values on the instance (the sequelize representation of the instance that is,
...
...
types/test/model.ts
View file @
8d1972f
import
{
Association
,
HasOne
,
Model
,
Sequelize
,
DataTypes
}
from
'sequelize'
;
import
{
Association
,
HasOne
,
Model
,
Sequelize
}
from
'sequelize'
;
class
MyModel
extends
Model
{
class
MyModel
extends
Model
{
public
num
:
number
;
public
static
associations
:
{
public
static
associations
:
{
other
:
HasOne
;
other
:
HasOne
;
};
};
...
@@ -13,6 +14,9 @@ class OtherModel extends Model {}
...
@@ -13,6 +14,9 @@ class OtherModel extends Model {}
const
assoc
:
Association
=
MyModel
.
associations
.
other
;
const
assoc
:
Association
=
MyModel
.
associations
.
other
;
const
Instance
:
MyModel
=
new
MyModel
({
int
:
10
});
const
num
:
number
=
Instance
.
get
(
'num'
);
MyModel
.
findOne
({
MyModel
.
findOne
({
include
:
[
include
:
[
{
model
:
OtherModel
,
paranoid
:
true
}
{
model
:
OtherModel
,
paranoid
:
true
}
...
...
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