mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2026-10-27 02:27:18 +00:00
update extension api
This commit is contained in:
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;
|
||||
|
||||
Reference in new issue
Block a user