util
Summary
Aeris library utilities.
Item Index
Methods
abstractMethod
Syntax
abstractMethod
()
Summary
Representation of an abstract method that needs overriding.
argsToArray
Syntax
Summary
Converts an arguments object to a true array.
Parameters:
-
args
Arrayobject.
Returns:
average
Syntax
average
-
arr
Summary
Returns the average of an array of numbers.
expose
Syntax
expose
-
obj
-
path
Summary
Expose a variable at the provided path under the global namespace.
Eg. _.expose(MyClass, 'aeris.someSubNs.MyClass'); aeris.someSubNs.MyClass === MyClass // true
inherits
Syntax
inherits
-
ChildCtor
-
ParentCtor
Summary
Inherit the prototype methods from one constructor into another.
interval
Syntax
Summary
Similar to window.setInterval, but allows for an optional context and arguments to be passed to the function.
Returns:
Reference to the interval, to be used with clearInterval
.
isNumeric
Syntax
Summary
A loose test for number-like objects.
.isNumeric(123) // true .isNumeric('123') // true .isNumeric('foo') // false .isNumeric('10px') // false _.isNumberic(''); // false
Thanks to this guy: http://stackoverflow.com/a/1830844
Parameters:
-
obj
*
Returns:
path
Syntax
Summary
Return a reference to a object property from a dot-notated string.
For example var obj = { foo: bar: { baz: 'in here!' } } } _.path('foo.bar.baz') // 'in here!'
Returns undefined if no reference exists.
eg: _.path('foo.boo.goo.moo.yoo') // undefined
This can be useful for attempting to access object properties, when you're not sure if the entire object is defined.
Parameters:
provide
Syntax
Summary
Ensures the defined path is available base on dot namespace.
Parameters:
-
path
StringPath that should be available.
Returns:
throwUncatchable
Syntax
throwUncatchable
-
e
Summary
Throw an 'uncatchable' error.
The error is 'uncatchable' because it is thrown after the current call stack completes. This is generally a bad idea, though it can be useful for forcing errors to be thrown in promise callbacks.
Parameters:
-
e
Error