Function truncateStringAtBoundaryWithError

  • Truncates a string to a given max length.

    If the string required truncation, records an error through the error reporting mechanism.

    Parameters

    • metric: MetricType

      The metric to record an error to, if necessary,

    • value: unknown

      The string to truncate.

    • length: number

      The length to truncate to.

    Returns string

    A string with at most length bytes.

    Throws

    In case value is not a string.

Generated using TypeDoc