Shared code in a google cloud function in different regions

I have the same exact google cloud function that I’m deploying to 2 different regions; for my European customers, none of their data can leave their country. Is there a way that I can share the code within my cloud function so that I can access the same code in the 2 different regions while having the 2 distinct endpoints?

   functions.http('helloHttp', async (req, res) => {
           //all the code I want to share is here!
   })