API to determine if symbol / component is part of local document or is from an external document?

Is there a way to tell if a component or symbol is local to a document? Or external?

I’m trying to reset all of the pluginData on an artboard but I don’t want to reset the pluginData if the component was created in an external document.