ADK for TypeScript: API Reference
    Preparing search index...

    Function toSnakeCaseName

    • Converts one string into snake_case.

      Handles lowerCamelCase, UpperCamelCase and space-separated text, as well as acronyms such as REST API and runs of consecutive uppercase letters.

      The Name suffix separates this from toSnakeCase in object_notation_utils.ts, which converts the keys of an object and takes a different argument.

      Parameters

      • text: string

        The input string.

      Returns string

      The snake_case form of text.

      toSnakeCaseName('camelCase'); // 'camel_case'
      toSnakeCaseName('UpperCamelCase'); // 'upper_camel_case'
      toSnakeCaseName('REST API'); // 'rest_api'