mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
various code quality fixes (#5792)
* various code quality fixes * reduce duplicated code * add safety check
This commit is contained in:
@@ -175,14 +175,14 @@ export class CommentsComponent implements OnChanges {
|
||||
}
|
||||
|
||||
isATask(): boolean {
|
||||
return this.taskId ? true : false;
|
||||
return !!this.taskId;
|
||||
}
|
||||
|
||||
isANode(): boolean {
|
||||
return this.nodeId ? true : false;
|
||||
return !!this.nodeId;
|
||||
}
|
||||
|
||||
private sanitize(input: string) {
|
||||
private sanitize(input: string): string {
|
||||
return input.replace(/<[^>]+>/g, '')
|
||||
.replace(/^\s+|\s+$|\s+(?=\s)/g, '')
|
||||
.replace(/\r?\n/g, '<br/>');
|
||||
|
Reference in New Issue
Block a user