new Utils()
Various utilities used across the library.
- Source:
- module/utils.js, line 3
Methods
-
<static> assert(_condition, _msg)
-
Test for a condition to be met, if not an exception is thrown.
Parameters:
Name Type Description _condition
boolean Condition to assert
_msg
string Error message
- Source:
- module/utils.js, line 65
-
<static> buildArrayType() → {object}
-
Generates a new array type, handles platform specifics (bag-O-hacks)
- Source:
- module/utils.js, line 179
Returns:
Independent array type.
- Type
- object
-
<static> chain(_first, _fun) → {mixed}
-
Chains to filtering functions together
Parameters:
Name Type Description _first
function original function
_fun
function function to call on the original function result
- Source:
- module/utils.js, line 115
Returns:
value returned by the last function call
- Type
- mixed
-
<static> cleanUrl(_url) → {string}
-
Cleans trailing slashes from an url
Parameters:
Name Type Description _url
string Url to clean
- Source:
- module/utils.js, line 100
Returns:
Resulting url
- Type
- string
-
<static> extendOverriden(_target, _other)
-
Extend an object using
Utils.override
instead of just replacing the functions.Parameters:
Name Type Description _target
object Object to be extended
_other
object Source object
- Source:
- module/utils.js, line 157
-
<static> format(_str, _args) → {string}
-
Formats a string
Parameters:
Name Type Description _str
string String to format
_args
array String arguments
- Source:
- module/utils.js, line 48
Returns:
Formated string
- Type
- string
-
<static> joinUrl(_head, _tail) → {string}
-
Simple url joining, returns null if _head or _tail is null.
Parameters:
Name Type Description _head
string Url prefix
_tail
string Url suffix
- Source:
- module/utils.js, line 85
Returns:
Resulting url
- Type
- string
-
<static> override(_super, _fun) → {mixed}
-
Override a property value, making overriden function available as this.$super
Parameters:
Name Type Description _super
function Original value
_fun
mixed New property value
- Source:
- module/utils.js, line 133
Returns:
Value returned by new function
- Type
- mixed