mirror of
https://github.com/Novaloop-AG/healthchat-web.git
synced 2026-11-26 11:38:37 +00:00
Apply prettier formatting
This commit is contained in:
+7
-7
@@ -91,7 +91,7 @@ export default class EditorModel {
|
||||
}
|
||||
|
||||
public clone(): EditorModel {
|
||||
const clonedParts = this.parts.map(p => this.partCreator.deserializePart(p.serialize()));
|
||||
const clonedParts = this.parts.map((p) => this.partCreator.deserializePart(p.serialize()));
|
||||
return new EditorModel(clonedParts, this._partCreator, this.updateCallback);
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@ export default class EditorModel {
|
||||
}
|
||||
|
||||
public serializeParts(): SerializedPart[] {
|
||||
return this._parts.map(p => p.serialize());
|
||||
return this._parts.map((p) => p.serialize());
|
||||
}
|
||||
|
||||
private diff(newValue: string, inputType: string, caret: DocumentOffset): IDiff {
|
||||
@@ -160,7 +160,7 @@ export default class EditorModel {
|
||||
}
|
||||
|
||||
public reset(serializedParts: SerializedPart[], caret?: Caret, inputType?: string): void {
|
||||
this._parts = serializedParts.map(p => this._partCreator.deserializePart(p));
|
||||
this._parts = serializedParts.map((p) => this._partCreator.deserializePart(p));
|
||||
if (!caret) {
|
||||
caret = this.getPositionAtEnd();
|
||||
}
|
||||
@@ -218,7 +218,7 @@ export default class EditorModel {
|
||||
|
||||
private getTransformAddedLen(newPosition: DocumentPosition, inputType: string, diff: IDiff): number {
|
||||
const result = this.transformCallback(newPosition, inputType, diff);
|
||||
return Number.isFinite(result) ? result as number : 0;
|
||||
return Number.isFinite(result) ? (result as number) : 0;
|
||||
}
|
||||
|
||||
private setActivePart(pos: DocumentPosition, canOpenAutoComplete: boolean): Promise<void> {
|
||||
@@ -397,11 +397,11 @@ export default class EditorModel {
|
||||
|
||||
public positionForOffset(totalOffset: number, atPartEnd = false): DocumentPosition {
|
||||
let currentOffset = 0;
|
||||
const index = this._parts.findIndex(part => {
|
||||
const index = this._parts.findIndex((part) => {
|
||||
const partLen = part.text.length;
|
||||
if (
|
||||
(atPartEnd && (currentOffset + partLen) >= totalOffset) ||
|
||||
(!atPartEnd && (currentOffset + partLen) > totalOffset)
|
||||
(atPartEnd && currentOffset + partLen >= totalOffset) ||
|
||||
(!atPartEnd && currentOffset + partLen > totalOffset)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user