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 beeff96f
authored
Nov 21, 2019
by
Todd Bealmear
Committed by
Sushant
Nov 22, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(types): add isSoftDeleted to Model (#11628)
1 parent
06a0d26c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
0 deletions
types/lib/model.d.ts
types/test/models/User.ts
types/lib/model.d.ts
View file @
beeff96
...
...
@@ -2728,6 +2728,15 @@ export abstract class Model<T = any, T2 = any> extends Hooks {
* values gotten from the DB, and apply all custom getters.
*/
public
toJSON
():
object
;
/**
* Helper method to determine if a instance is "soft deleted". This is
* particularly useful if the implementer renamed the deletedAt attribute to
* something different. This method requires paranoid to be enabled.
*
* Throws an error if paranoid is not enabled.
*/
public
isSoftDeleted
():
boolean
;
}
export
type
ModelType
=
typeof
Model
;
...
...
types/test/models/User.ts
View file @
beeff96
...
...
@@ -119,3 +119,6 @@ User.scope([
'custom2'
,
{
method
:
[
'custom'
,
32
]
}
])
const
instance
=
new
User
({
username
:
'foo'
,
firstName
:
'bar'
,
lastName
:
'baz'
});
instance
.
isSoftDeleted
()
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