as_object function:

  • Can also be called as as_map

  • Can also be called as as_hash

return the object if the argument is an object, nothing if it's not.

Examples:

  • running: (as_object {"key": 12}) will give: {"key": 12}

  • running: (as_object 312) will return nothing