Global

Members

JSON

JSON parser.
License:
  • Public-Domain
See:

seedRandom

Adds a new Math.seedRandom() method, used as a workaround for a bug in Math.random() with After Effects on Mac OS
Author:
  • David Bau
License:
  • MIT

Methods

def(val, defaultVal){object}

D:/RxLab/src/RxOT/DuAEF/Duik/Duik_API/DuAEF_Duik_api.jsxinc, line 352
Assigns a default value to a var if it's undefined.
Name Type Description
val object The variable to set
defaultVal object The default value
Returns:
Type Description
object The var
Example
foo = def( foo, 12 ); // if foo was undefined, it is now 12, else it's unchanged.

isZero(x){Boolean}

D:/RxLab/src/RxOT/DuAEF/Duik/Duik_API/DuAEF_Duik_api.jsxinc, line 23373
Checks if the value is 0; works with arrays.
Name Type Description
x Number | Array.<Number> The value(s)
Returns:
Type Description
Boolean true if all values are 0.

jstype(exp){string}

D:/RxLab/src/RxOT/DuAEF/Duik/Duik_API/DuAEF_Duik_api.jsxinc, line 363
Improved typeof which returns the type of object instead of 'object'
Name Type Description
exp any The expression to check.
Returns:
Type Description
string The type always in lower case.

tr(str, context, args){string}

D:/RxLab/src/RxOT/DuAEF/Duik/Duik_API/DuAEF_Duik_api.jsxinc, line 2474
Translate a given string based on the current language
see DuTranslator for more details about the translation framework.
Name Type Description
str string The text to be translated
context int | string Can be an integer or a string which is related to contextId or context in a translation file
args Array.<string> Args to format into the translated string, default is []
For example, when calling tr("Welcome {#}", -1, "Paul"), the output will be "Welcome Paul"
If too many args are given, they're ignored
If not enough args are given, "{#}" is replaced with "?"
Returns:
Type Description
string The translated text or the original string if nothing is set or available