function convertToTokenMap(flattenedTokens) {
  return new Map(
    flattenedTokens.map((t) => {
      return [/** @type {string} */ (t.key), t];
    }),
  );
}
@template {Token} T
@param {Array<T>} flattenedTokens
@returns {Map<string, T>}