Class: ObjectUtil

ObjectUtil()

new ObjectUtil()

This class provides some static methods which might be helpful when working with objects.

Source:

Methods

(static) getValue(queryKey, queryObject) → {*}

Method may be used to return a value of a given input object by a provided query key. The query key can be used in two ways:

  • Single-value: Find the first matching key in the provided object (Use with caution as the object/array order may not be as expected and/or deterministic!).
  • Backslash ("/") separated value: Find the last (!) matching key in the provided object.
Parameters:
Name Type Description
queryKey String

The key to be searched.

queryObject Object

The object to be searched on

Source:
Returns:

The target value or undefined if the given couldn't be found, or an object if a path was passed, from which we only could find a part, but not the most specific one. TODO Harmonize return values

Type
*