Function validateSnake

  • Converts to snake case with type validation.

    Convert every property names of nested objects to follow the snake case convention. If the input value does not follow the type T, it returns IValidation.Failure object. Otherwise, there's no problem on the input value, snake cased converted data would be stored in the data property of the output IValidation.Success object.

    Type Parameters

    • T

      Type of the input value

    Parameters

    • input: T

      Target object

    Returns IValidation<SnakeCase<T>>

    Validation result with snake case object

    Jeongho Nam - https://github.com/samchon

  • Converts to snake case with type validation.

    Convert every property names of nested objects to follow the snake case convention. If the input value does not follow the type T, it returns IValidation.Failure object. Otherwise, there's no problem on the input value, snake cased converted data would be stored in the data property of the output IValidation.Success object.

    Type Parameters

    • T

      Type of the input value

    Parameters

    • input: unknown

      Target object

    Returns IValidation<SnakeCase<T>>

    Validation result with snake case object

    Jeongho Nam - https://github.com/samchon