In my scenario, I am dealing with an Array of resources that includes a dynamic resource like "guides/:guideId/packages" and a currentURL (guides/GUIDE007/packages):
const resources = ["guides", "guides/files", "guides/:guideId/packages"];
const currentURL = "guides/GUIDE007/packages";
const findMatch = (resources, currentURL) => { return ... ?? }
const matchingResource = findMatch(resources, currentURL);
console.log(matchingResource) // guides/:guideId/packages
What is the most effective method for identifying a match in the array that corresponds to the resource format, given that the currentURL aligns with a resource?