function resolverReducer(resolvers, map) {
  if (Array.isArray(resolvers)) {
    resolvers.forEach((r) => resolverReducer(r, map));
    return map;
  }

  if (typeof resolvers === 'string') {
    map.set(resolvers, null);
    return map;
  }

  if (typeof resolvers === 'object') {
    for (const key in resolvers) {
      map.set(key, resolvers[key]);
    }
    return map;
  }

  const err = new Error('invalid resolver config');
  err.name = ERROR_NAME;
  throw err;
}
@type {<T extends Map<string, unknown>>(resolvers: string[] | string | { [k: string]: string }, map: T) => T}