mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-28 10:32:27 +08:00
23 lines
433 B
JavaScript
23 lines
433 B
JavaScript
![]() |
export default class NoteSet {
|
||
|
constructor(notes = []) {
|
||
|
this.notes = notes;
|
||
|
}
|
||
|
|
||
|
add(note) {
|
||
|
this.notes.push(note);
|
||
|
}
|
||
|
|
||
|
addAll(notes) {
|
||
|
this.notes.push(...notes);
|
||
|
}
|
||
|
|
||
|
hasNoteId(noteId) {
|
||
|
// TODO: optimize
|
||
|
return !!this.notes.find(note => note.noteId === noteId);
|
||
|
}
|
||
|
|
||
|
mergeIn(anotherNoteSet) {
|
||
|
this.notes = this.notes.concat(anotherNoteSet.arr);
|
||
|
}
|
||
|
}
|