ZAP will raise alerts if there are external JS scripts referenced or if it detects an known JS library that is out of date.
The former should work in all cases.
Detecting out of date libraries is done via the
Retire.js add-on which uses the
retire.js project.
You could submit a patch to that project for publicly available 3rd party libraries but probably not for custom ones.
If you want to detect those being out of date you would probably have to create you own passive scan rule (which could be implemented as a script).
Cheers,
Simon