lookUp = (needle, haystack) => {
  const value = haystack[needle]
  if (value === undefined) {
    // TODO: remove this or replace with a better integrated warning
    // When using the resolve-related hooks for finding out paths we'd get paths not included in the bundle trigger this case. Now it should not happen unless policy is incomplete.
    // This needs more observation/investigation
    console.trace(`Cannot find a match for ${needle} in policy`)
  }
  return value
}
Looks up a value in a haystack object based on the given needle.

@template {string | number} T
@param {T} needle - The value to look for.
@param {Record<T, any>} haystack - The object to search in.
@returns {any} - The value found in the haystack, or undefined if not found.