input: Write a function to parse a given json-formatted string into a dictionary. The function should return the parsed dictionary.
  assert json_parser('{"name": "John","age": 30,"address": {"city": "New York","state": "NY"}}')=={'name': 'John', 'age': 30, 'address': {'city': 'New York', 'state': 'NY'}}
  assert json_parser('{"item": "book","price": 15.99,"in_stock": true}')=={'item': 'book', 'price': 15.99, 'in_stock': True}
  assert json_parser('[]')==[]
  assert json_parser('{}')=={}
  assert json_parser('123')==123
output: import json
  
  def json_parser(json_str):
      return json.loads(json_str)