import type { ValidHex } from '../types';

import { getColour } from './getColour';

type Override<TokenFn extends (args: any) => any, ValidResult> = [Parameters<TokenFn>, ValidResult];

// @ts-expect-error
function createOverrides(overrides?: Array<Override<typeof getColour, ValidHex>>) {
  const overrideMap = new Map();
  overrides?.forEach((item) => overrideMap.set(item[0], item[1]));

  return overrideMap;
}

export default createOverrides;
