Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function deleteByUUID(data, uuid) {
- if(Array.isArray(data)) {
- return data.map(item => {
- if(item.uuid == uuid) return false;
- if(item.data) {
- for(const key in item.data) {
- item.data[key] = deleteByUUID(item.data[key], uuid);
- }
- }
- return item;
- }).filter(q => q);
- } else {
- return data;
- }
- return data;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement