Table of contents
METHOD | RETURN | DESCRIPTION |
---|---|---|
encodeRQLComponent (str) | string
|
Method encodes a Resource Query Language (RQL) component by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character |
escape (str) | string
|
Efficiently escape a string for insertion into HTML (innerHTML or attributes), replacing &, <, >, “, ‘ characters |
forEach (obj, cb, thisObject) | undefined
|
forEach for object |
getPackageId (arg) | string
|
Finds out and returns a package APS ID by analyzing the input argument |
showMessage (message, type) | undefined
|
Show message in notification center |
timeout (callback, delay) | object
|
Calls the specified callback function after the specified delay measured in milliseconds |
toArray (arg) | array
|
Converts array-like objects / collections to a new array |
Method encodes a Resource Query Language (RQL) component by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character.
Return: string
ARGUMENT | TYPE | DESCRIPTION |
---|---|---|
str |
String
|
the string for encode |
Efficiently escape a string for insertion into HTML (innerHTML or attributes), replacing &, <, >, “, ‘ characters.
Return: string
ARGUMENT | TYPE | DESCRIPTION |
---|---|---|
str |
String
|
the string to escape |
forEach for object. Behavior is similar to the forEach method of the array. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach
Return: undefined
ARGUMENT | TYPE | DESCRIPTION |
---|---|---|
obj |
object
|
Object or array to listing |
cb |
function
|
Function to execute for each element. |
thisObject |
object
|
Optional. Value to use as this when executing callback. |
common.forEach({ a: 1, b: 2 }, function(value, name){
console.log(name + ": " + value); // first step: 'a: 1', second step: 'b: 2'
});
Finds out and returns a package APS ID by analyzing the input argument.
Return: string
ARGUMENT | TYPE | DESCRIPTION |
---|---|---|
arg |
undefined
|
A value can be a string (URI containing the “/aps/2/packages/” pattern) or an object (one of CommonJS module, View, or ViewPlugin). |
Show message in notification center.
Return: undefined
ARGUMENT | TYPE | DESCRIPTION |
---|---|---|
message |
String
|
The message text. |
type |
String
|
The message type. |
Calls the specified callback function after the specified delay measured in milliseconds.
Return: object
ARGUMENT | TYPE | DESCRIPTION |
---|---|---|
callback |
Function
|
Function to execute after the specified delay. |
delay |
Number
|
The number of milliseconds that the function call should be delayed. |
this.own(common.timeout(function() {
console.log("Delayed message");
}, 1000));
Converts array-like objects / collections to a new array.
Return: array
ARGUMENT | TYPE | DESCRIPTION |
---|---|---|
arg |
array
|
Arguments list |