Function assertSnake

  • Converts to snake case with type assertion.

    Convert every property names of nested objects to follow the snake case convention. If the input value does not follow the type T, it throws TypeGuardError.

    Type Parameters

    • T

      Type of the input value

    Parameters

    Returns SnakeCase<T>

    Snake case object

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

  • Converts to snake case with type assertion.

    Convert every property names of nested objects to follow the snake case convention. If the input value does not follow the type T, it throws TypeGuardError.

    Type Parameters

    • T

      Type of the input value

    Parameters

    • input: unknown

      Target object

    • OptionalerrorFactory: ((props: TypeGuardError.IProps) => Error)

      Custom error factory. Default is TypeGuardError

    Returns SnakeCase<T>

    Snake case object

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