How to validate `Record<string, string>`?

My naïve attempt:
const Response = type({
  "*": "string",
});
type Response = typeof Response.infer;

const createResponse = (): Response => {
  const values: Record<string, string> = {
    value1: "one",
    value2: "two",
  };
  return values;
};

This results in error:
Property '"*"' is missing in type 'Record<string, string>' but required in type '{ "*": string; }'.
Was this page helpful?