Exemplo n.º 1
0
def _convert_to_line_delimits(s):
    """Helper function that converts json lists to line delimited json."""

    # Determine we have a JSON list to turn to lines otherwise just return the
    # json object, only lists can
    if not s[0] == '[' and s[-1] == ']':
        return s
    s = s[1:-1]

    return convert_json_to_lines(s)
Exemplo n.º 2
0
def _convert_to_line_delimits(s):
    """Helper function that converts json lists to line delimited json."""

    # Determine we have a JSON list to turn to lines otherwise just return the
    # json object, only lists can
    if not s[0] == '[' and s[-1] == ']':
        return s
    s = s[1:-1]

    return convert_json_to_lines(s)
Exemplo n.º 3
0
def convert_to_line_delimits(s: str) -> str:
    """
    Helper function that converts JSON lists to line delimited JSON.
    """
    # Determine we have a JSON list to turn to lines otherwise just return the
    # json object, only lists can
    if not s[0] == "[" and s[-1] == "]":
        return s
    s = s[1:-1]

    return convert_json_to_lines(s)