It takes a JSON object and a lookup table, and returns a new JSON object with the keys in the lookup table replaced with their corresponding values

  • Type Parameters

    • T = any

    Parameters

    • data: any

      The data to be translated.

    • table: { [x: string]: string }

      The table of replacements.

    Returns T

    A function that takes two arguments, data and table, and returns a new object.