input: Write a function to parse a JSON-formatted string into a dictionary. Return the dictionary after parsing. If the input string is empty, return an empty dictionary.
  import json
  
  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('') == {}
  assert parse_json_to_dict('{"fruit": "Apple","color": "Red"}') == {"fruit": "Apple","color": "Red"}
output: def parse_json_to_dict(json_str):
      if not json_str:
          return {}
      return json.loads(json_str)