Javascript assets in a theme component

This seems to show how to do it for a plugin: How to ship javascript library with plugin?
Still haven’t found anything for a theme component.