• Converts or omits an object's keys according to a mapping.

    Type Parameters

    • Inp extends Record<string, unknown>
    • const Mapping extends { [k in string | number | symbol]?: null | string }

    Parameters

    • inp: Inp

      An object whose keys will be remapped

    • mappings: Mapping

      A mapping of original keys to new keys. If a key is not present in the mapping, it will be left as is. If a key is mapped to null, it will be removed in the resulting object.

    Returns Remap<Inp, Mapping>

    A new object with keys remapped or omitted according to the mappings