def to_json(text: str, delimeter: str = "|") -> dict:
    """Transforms a plain text into JSON

    The plain text should have key:value separated by a pipe.
    An example of a plain text::

        api:sdsfe3ss|username:343343

    The example above would be transformed to::

        {"api": "sdsfe3ss", "username": "343343"}

    :param text: Text that is being transformed
    :param delimeter: Key-Value delimeter. Optional
    :type text: str
    :type delimter: str
    :return: JSON object from the text
    :rtype: dict

    """
    result = {}
    kvs = text.strip().split(delimeter)
    kvs = [x.split(":", 1) for x in kvs if x is not None]
    for [key, value] in kvs:
        result[key] = value if value != "None" else ""
    return result