mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2025-12-02 18:12:11 +00:00
update extension api
This commit is contained in:
@@ -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