Skip to content

Build your personal knowledge base with Trilium Notes

Merge remote-tracking branch 'origin/stable'

zadam6408a47a8ab4
diff --cc src/services/note_cache/entities/note.js
index 74b7b00ca9,9e00dd0a5f..4ea6dca0ea
--- a/src/services/note_cache/entities/note.js
+++ b/src/services/note_cache/entities/note.js
@@@ -142,16 -133,14 +142,24 @@@ class Note
return !!this.attributes.find(attr => attr.type === type && attr.name === name);
}
+ getAttributeCaseInsensitive(type, name, value) {
+ name = name.toLowerCase();
+ value = value ? value.toLowerCase() : null;
+
+ return this.attributes.find(
+ attr => attr.type === type
+ && attr.name.toLowerCase() === name
+ && (!value || attr.value.toLowerCase() === value));
+ }
+
+ hasLabel(name) {
+ return this.hasAttribute('label', name);
+ }
+
+ hasRelation(name) {
+ return this.hasAttribute('relation', name);
+ }
+
getLabelValue(name) {
const label = this.attributes.find(attr => attr.type === 'label' && attr.name === name);