input: Write a function to parse a json-formatted string into a dictionary. If the string is empty, return an empty dictionary.
  assert parse_json_to_dict('{"name": "John","age": 30,"address": {"city": "New York","state": "NY"}}')=={"name": "John","age": 30,"address": {"city": "New York","state": "NY"}}
  assert parse_json_to_dict('{"name": "Jane","age": 25,"address": {"city": "Los Angeles","state": "CA"}}')=={"name": "Jane","age": 25,"address": {"city": "Los Angeles","state": "CA"}}
  assert parse_json_to_dict('{}')=={}
  assert parse_json_to_dict('')=={}
output: def parse_json_to_dict(json_str):
      if json_str == '':
          return {}
      return json.loads(json_str)