new uCentral()
Classes
Methods
-
b(val){string}
-
Formats a given input value as uci boolean value.
Name Type Description val
* The value to format
Returns:
Type Description string Returns '1' if the given value is truish (not false
,null
,0
,0.0
or an empty string), or0
in all other cases. -
info(fmt, args)
-
Emit an informational message.
Name Type Description fmt
string The information message format string
args
* repeatable Optional format arguments
-
s(str){string}
-
Formats a given input value as single quoted string, honouring uci specific escaping semantics.
Name Type Description str
* The string to format
Returns:
Type Description string Returns an empty string if the given input value is null
or an empty string. Returns the escaped and quoted string in all other cases. -
tryinclude(path, scope)
-
Attempt to include a file, catching potential exceptions.
Try to include the given file path in a safe manner. The path is resolved relative to the path of the currently executed template and may only contain the character
A-Z
,a-z
,0-9
,_
,/
and-
as must contain a final.uc
file extension.Exception occuring while including the file are catched and a warning is emitted instead.
Name Type Description path
string Path of the file to include
scope
object The scope to pass to the include file
-
warn(fmt, args)
-
Emit a warning message.
Name Type Description fmt
string The warning message format string
args
* repeatable Optional format arguments