def split_json(
        self,
        json_data: dict[str, Any],
        convert_lists: bool = False,
    ) -> list[dict]:
        """Splits JSON into a list of JSON chunks."""

        if convert_lists:
            chunks = self._json_split(
                self._list_to_dict_preprocessing(json_data)
            )
        else:
            chunks = self._json_split(json_data)

        # Remove the last chunk if it's empty
        if not chunks[-1]:
            chunks.pop()
        return chunks
Splits JSON into a list of JSON chunks.
py/shared/utils/splitter/text.py