Class: ObjectHelper

coreutils. ObjectHelper


new ObjectHelper()

Static helper class for objects

Methods


<static> createFromString(path)

Create object from path
Parameters:
Name Type Description
path string path to object from window
Returns:
created object
Type
object
Example
namespace.Object

<static> each(obj, callback, context)

Loop object and call calbback for each item
Parameters:
Name Type Description
obj object object
callback function callback function
context object | null scope of the callback

<static> extractKeys(source)

Extracts all keys of object and returns as array of strings
Parameters:
Name Type Description
source object object
Returns:
keys
Type
array.<string> | null

<static> getChildObject(obj, path)

Get deep child of the object using path
Parameters:
Name Type Description
obj object object
path string path to property
Returns:
value of property
Type
* | null
Example
Object: {a:{a:{a:1}}}
Path: a.a.a

<static> getConstructorFromString(path)

Searches for object constructor by string
Parameters:
Name Type Description
path string path to object from window
Returns:
constructor
Type
function
Example
namespace.Object

<static> hasDeepProperty(obj, propertyName)

Checsks if object has property
Parameters:
Name Type Description
obj object object
propertyName string name of the property
Returns:
has / has not
Type
boolean

<static> hasKey(obj, key)

Check if object has key
Parameters:
Name Type Description
obj object object
key string id of property
Returns:
has/has not
Type
boolean

<static> isFunction(obj)

Checks if element is of type Function
Parameters:
Name Type Description
obj * element to check
Returns:
is/is not
Type
boolean

<static> isInstanceOf(obj, type)

Check if objects is of specific type
Parameters:
Name Type Description
obj object object
type string type to check
Returns:
is / is not
Type
boolean

<static> isObject(obj)

Checks if element is of type Object
Parameters:
Name Type Description
obj * element to check
Returns:
is/is not
Type
boolean