* Simple wrapper around JSON.parse that casts the return value * to JsonObject. * Create a new wrapper if an array return value is desired. * @param {*} json JSON string to parse * @return {?JsonObject|undefined} May be extend to parse arrays.
(json)
| 4110 | * @return {?JsonObject|undefined} May be extend to parse arrays. |
| 4111 | */ |
| 4112 | function parseJson(json) { |
| 4113 | return /** @type {?JsonObject} */ (JSON.parse(/** @type {string} */ (json))); |
| 4114 | } |
| 4115 | |
| 4116 | /** |
| 4117 | * Parses the given `json` string without throwing an exception if not valid. |
no test coverage detected