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:
David Mehren 2020-05-09 17:49:44 +02:00
parent ea9cd56a20
commit dcdbd3bf35
No known key found for this signature in database
GPG key ID: 6017AF117F9756CB
2 changed files with 5 additions and 5 deletions

View file

@ -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) {

View file

@ -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) {