Skip to content

Build your personal knowledge base with Trilium Notes

Apply suggestion from @gemini-code-assist[bot]

Elian Doran1a54276b562e
diff --git a/packages/trilium-core/src/services/utils/binary.ts b/packages/trilium-core/src/services/utils/binary.ts
index 2cbf60b4d8..33689531dd 100644
--- a/packages/trilium-core/src/services/utils/binary.ts
+++ b/packages/trilium-core/src/services/utils/binary.ts
@@ -68,7 +68,7 @@ export function wrapStringOrBuffer(stringOrBuffer: string | Uint8Array) {
* U+FEFF code point, so this covers both UTF-8 and UTF-16 BOMs.
*/
export function stripBom(text: string): string {
- return text.charCodeAt(0) === 0xfeff ? text.slice(1) : text;
+ return text.startsWith("\uFEFF") ? text.slice(1) : text;
}
/**