Skip to content

Instantly share code, notes, and snippets.

@davidsara
Last active September 17, 2020 09:48
Show Gist options
  • Save davidsara/ea5e1e59f856d2f1b0ac53d05d48c3bf to your computer and use it in GitHub Desktop.
Save davidsara/ea5e1e59f856d2f1b0ac53d05d48c3bf to your computer and use it in GitHub Desktop.
#jArchi - Delete all unused elements (not used in any View).
// Delete all unused elements (not used in any View).
//
// (c) 2019 David Sara
function deleteUnusedElements() {
$("element").each(function(element) {
if($(element).objectRefs().isEmpty()) {
element.delete();
}
});
}
deleteUnusedElements();
console.log("Done.");
@vnevzorov
Copy link

Thank you, very helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment