• Transforms the keys of the given object using the current transformation strategy.

    Type Parameters

    • T extends object

      The type of the object.

    Parameters

    • data: Readonly<T>

      The object whose keys are to be transformed.

    • transformer: Readonly<BasaltKeyTransformer>

      The key transformation strategy to use.

    Returns T

    A new object with transformed keys. (T)

    (BasaltError) - If the provided data object is null or undefined. (CORE_DATA_KEY_ERROR.DATA_IS_NULL)

    (BasaltError) - If the provided data object is not a plain object. (CORE_DATA_KEY_ERROR.DATA_MUST_BE_OBJECT)

    // Return { myKey: "value" }
    transformKeys(\{ "my-key": "value" \}, new BasaltCamelCaseTransformer());