mirror of
https://github.com/zadam/trilium.git
synced 2025-10-28 00:36:33 +01:00
fixes in working with top level nodes and root node
This commit is contained in:
@@ -75,7 +75,9 @@ function isElectron() {
|
||||
|
||||
function assertArguments() {
|
||||
for (const i in arguments) {
|
||||
assert(arguments[i], `argument ${i} should not be falsy. Argument list: ${arguments}`);
|
||||
if (!arguments[i]) {
|
||||
throwError(`Argument idx#${i} should not be falsy: ${arguments[i]}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,4 +85,12 @@ function assert(expr, message) {
|
||||
if (!expr) {
|
||||
throwError(message);
|
||||
}
|
||||
}
|
||||
|
||||
function isTopLevelNode(node) {
|
||||
return isRootNode(node.getParent());
|
||||
}
|
||||
|
||||
function isRootNode(node) {
|
||||
return node.key === "root_1";
|
||||
}
|
||||
Reference in New Issue
Block a user