File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/__pycache__/json.cpython-310.pyc
Back
o ;jZ � @ s~ d Z ddlZddlZddlZddlZddlZe�e�Z ej Z dd� Zdefdd�Z dd � Zd d� Zdd � Zdd� Zdd� ZdS )z Functions to work with JSON � Nc C s | � � S )z� Performs a splitlines on the string. This function exists to make mocking possible in unit tests, since the member functions of the str/unicode builtins cannot be mocked. )� splitlines)�raw� r �C/opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/json.py�__split s r �sc C sx t �� }t| �D ]1\}}|dks|dkr9t�t j�� |�| |d� �\}}|W d � S 1 s4w Y qt�)z�Pass in a string and load JSON within it. The string may contain non-JSON text before and after the JSON document. Raises ValueError if no valid JSON was found. �{�[N)�json�JSONDecoder� enumerate� contextlib�suppress�JSONDecodeError� raw_decode� ValueError)r �decoder�idx�char�data�_r r r � find_json s $��r c C s>