update extension api

This commit is contained in:
vcoppe committed 2025-11-12 14:48:17 +01:00
1 parent 110f23bdf1
commit 0eca588280
2 files changed
+43 -43

No files matched your search

@@ -66,12 +66,12 @@ export function remove(node: LayerTreeType, id: string) {
return node;
}
export function removeByPrefix(node: LayerTreeType, prefix: string) {
export function removeAll(node: LayerTreeType, ids: string[]) {
Object.keys(node).forEach((key) => {
if (key.startsWith(prefix)) {
if (ids.includes(key)) {
delete node[key];
} else if (typeof node[key] !== 'boolean') {
removeByPrefix(node[key], prefix);
removeAll(node[key], ids);
}
});
return node;