mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-18 17:25:16 -04: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)
|
@Column(DataType.TEXT)
|
||||||
get title (): string {
|
get title (): string {
|
||||||
return processData(this.getDataValue('title'), '')
|
return this.getDataValue('title') ?? ''
|
||||||
}
|
}
|
||||||
|
|
||||||
set title (value: string) {
|
set title (value: string) {
|
||||||
|
@ -122,7 +122,7 @@ export class Note extends Model<Note> {
|
||||||
|
|
||||||
@Column(DataType.TEXT({ length: 'long' }))
|
@Column(DataType.TEXT({ length: 'long' }))
|
||||||
get content (): string {
|
get content (): string {
|
||||||
return processData(this.getDataValue('content'), '')
|
return this.getDataValue('content') ?? ''
|
||||||
}
|
}
|
||||||
|
|
||||||
set content (value: string) {
|
set content (value: string) {
|
||||||
|
|
|
@ -81,7 +81,7 @@ export class Revision extends Model<Revision> {
|
||||||
|
|
||||||
@Column(DataType.TEXT({ length: 'long' }))
|
@Column(DataType.TEXT({ length: 'long' }))
|
||||||
get patch (): string {
|
get patch (): string {
|
||||||
return processData(this.getDataValue('patch'), '')
|
return this.getDataValue('patch') ?? ''
|
||||||
}
|
}
|
||||||
|
|
||||||
set patch (value: string) {
|
set patch (value: string) {
|
||||||
|
@ -90,7 +90,7 @@ export class Revision extends Model<Revision> {
|
||||||
|
|
||||||
@Column(DataType.TEXT({ length: 'long' }))
|
@Column(DataType.TEXT({ length: 'long' }))
|
||||||
get lastContent (): string {
|
get lastContent (): string {
|
||||||
return processData(this.getDataValue('lastContent'), '')
|
return this.getDataValue('lastContent') ?? ''
|
||||||
}
|
}
|
||||||
|
|
||||||
set lastContent (value: string) {
|
set lastContent (value: string) {
|
||||||
|
@ -99,7 +99,7 @@ export class Revision extends Model<Revision> {
|
||||||
|
|
||||||
@Column(DataType.TEXT({ length: 'long' }))
|
@Column(DataType.TEXT({ length: 'long' }))
|
||||||
get content (): string {
|
get content (): string {
|
||||||
return processData(this.getDataValue('content'), '')
|
return this.getDataValue('content') ?? ''
|
||||||
}
|
}
|
||||||
|
|
||||||
set content (value: string) {
|
set content (value: string) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue