Skip to content

Build your personal knowledge base with Trilium Notes

chore(core): fix type error in getFlatText

Elian Dorana15b84b4e539
diff --git a/packages/trilium-core/src/becca/entities/bnote.ts b/packages/trilium-core/src/becca/entities/bnote.ts
index ea3c60803c..3d9a9fe2cc 100644
--- a/packages/trilium-core/src/becca/entities/bnote.ts
+++ b/packages/trilium-core/src/becca/entities/bnote.ts
@@ -775,7 +775,7 @@ class BNote extends AbstractBeccaEntity<BNote> {
*
* @returns - returns flattened textual representation of note, prefixes and attributes
*/
- getFlatText() {
+ getFlatText(): string {
if (!this.__flatTextCache) {
this.__flatTextCache = `${this.noteId} ${this.type} ${this.mime} `;
@@ -801,7 +801,7 @@ class BNote extends AbstractBeccaEntity<BNote> {
this.__flatTextCache = utils.normalize(this.__flatTextCache);
}
- return this.__flatTextCache;
+ return this.__flatTextCache as string;
}
invalidateThisCache() {