• Converts a camelCase string to kebab-case.

    Remarks

    This function expects a string input and returns a Result object containing either the converted string on success or an error on failure.

    Example

    Convert a camelCase string to kebab-case:

    camelToKebab('helloWorld');
    // => { ok: true, value: 'hello-world' }

    Example

    Handle an invalid input string:

    camelToKebab(42)
    // => { ok: false, error: Error('[strings.camelToKebab] Expected string value as input') }

    Parameters

    • str: string

      The camelCase string to convert.

    Returns Result<string, Error>

    A Result object containing either the converted string or an or an Error object if the provided input is not a string.

Generated using TypeDoc v0.24.7