JsonUtils Namespace

Utility functions for converting from JSON objects, with default values.

Function

Name Description
JsonUtils.asArray Get a value as an array.
JsonUtils.asBool Get a value as a boolean.
JsonUtils.asDouble Get a value as a double.
JsonUtils.asInt Get a value as an integer.
JsonUtils.asObject Get a value as an object.
JsonUtils.asString Get a value as a string.
JsonUtils.isEmptyObject Determine if a Javascript object is equivalent to {}.
JsonUtils.isEmptyObjectOrUndefined Determine if the input is undefined or an empty Javascript object.
JsonUtils.isNonEmptyObject Determine if the input is a non-empty Javascript object.
JsonUtils.setOrRemoveBoolean Set or remove a boolean on a json object, given a key name, a value, and a default value.
JsonUtils.setOrRemoveNumber Set or remove a number on a json object, given a key name, a value, and a default value.
JsonUtils.toObject Convert the input object into a "pure" JavaScript object, with only instances of "object" or primitives in the returned value.

Defined in

Last Updated: 12 June, 2024