
    j                         d Z ddlZd Zd ZdS )zJSONpath utility functions as needed within pysim.

As pySim-sell has the ability to represent SIM files as JSON strings,
adding JSONpath allows us to conveniently modify individual sub-fields
of a file or record in its JSON representation.
    Nc                 T    t          j        |          }|                    |           S )zFind/Match a JSON path within a given JSON-serializable dict.
    Args:
        js_dict : JSON-serializable dict to operate on
        js_path : JSONpath string
    Returns: Result of the JSONpath expression
    )jsonpath_ngparsefind)js_dictjs_pathjsonpath_exprs      D/home/jenkins/jenkins/workspace/simtester-sanitize/pySim/jsonpath.pyjs_path_findr      s(      %g..Mg&&&    c                     t          j        |          }|                    |            |                    | |           dS )zFind/Match a JSON path within a given JSON-serializable dict.
    Args:
        js_dict : JSON-serializable dict to operate on
        js_path : JSONpath string
        new_val : New value for field in js_dict at js_path
    N)r   r   r   update)r   r   new_valr	   s       r
   js_path_modifyr   %   sD      %g..Mw'*****r   )__doc__r   r   r    r   r
   <module>r      sE        $' ' '	+ 	+ 	+ 	+ 	+r   