mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-01-26 23:32:33 +00:00
Replace processData calls with ??
Many times processData was just used to ensure a default value is present. Since TS 3.7 the nullish coalescing operator ?? is supported for that. Signed-off-by: David Mehren <dmehren1@gmail.com>
This commit is contained in:
parent
ea9cd56a20
commit
dcdbd3bf35
2 changed files with 5 additions and 5 deletions
|
@ -113,7 +113,7 @@ export class Note extends Model<Note> {
|
|||
|
||||
@Column(DataType.TEXT)
|
||||
get title (): string {
|
||||
return processData(this.getDataValue('title'), '')
|
||||
return this.getDataValue('title') ?? ''
|
||||
}
|
||||
|
||||
set title (value: string) {
|
||||
|
@ -122,7 +122,7 @@ export class Note extends Model<Note> {
|
|||
|
||||
@Column(DataType.TEXT({ length: 'long' }))
|
||||
get content (): string {
|
||||
return processData(this.getDataValue('content'), '')
|
||||
return this.getDataValue('content') ?? ''
|
||||
}
|
||||
|
||||
set content (value: string) {
|
||||
|
|
|
@ -81,7 +81,7 @@ export class Revision extends Model<Revision> {
|
|||
|
||||
@Column(DataType.TEXT({ length: 'long' }))
|
||||
get patch (): string {
|
||||
return processData(this.getDataValue('patch'), '')
|
||||
return this.getDataValue('patch') ?? ''
|
||||
}
|
||||
|
||||
set patch (value: string) {
|
||||
|
@ -90,7 +90,7 @@ export class Revision extends Model<Revision> {
|
|||
|
||||
@Column(DataType.TEXT({ length: 'long' }))
|
||||
get lastContent (): string {
|
||||
return processData(this.getDataValue('lastContent'), '')
|
||||
return this.getDataValue('lastContent') ?? ''
|
||||
}
|
||||
|
||||
set lastContent (value: string) {
|
||||
|
@ -99,7 +99,7 @@ export class Revision extends Model<Revision> {
|
|||
|
||||
@Column(DataType.TEXT({ length: 'long' }))
|
||||
get content (): string {
|
||||
return processData(this.getDataValue('content'), '')
|
||||
return this.getDataValue('content') ?? ''
|
||||
}
|
||||
|
||||
set content (value: string) {
|
||||
|
|
Loading…
Reference in a new issue