functions

bim. Namespace

functions

Description:
  • General static functions which can be called with bim.functions

Source:
Properties:
Name Type Description
isHTML function

Function to check whether the given string parameter is a tag of HTML or not. See bim.functions.isHTML for more details.

parse function

Function to parse to JSON. See bim.functions.parse for more details.

text function

Function to randomly generate alphabetical string with given parameter number. See bim.functions.text for more details.

unique function

Function to remove duplicated values from an Array. See bim.functions.unique for more details.

Methods

(static) isHTML(html) → {boolean}

Description:
  • Function to check whether the given string parameter is a valid tag of HTML or not.

Source:
Examples
if (bim.functions.isHTML(${1:html})) ..;
let bimHtml = "<p>Hello Bim~</p>";

if (bim.functions.isHTML(bimHtml)) {
 bim.app.element("#bimElement").append(bimHtml);
}
Parameters:
Name Type Description
html string

Required. String to verify that it is a valid HTML tag.

Returns:

true | false

Type
boolean

(static) parse(j, callback) → {*}

Description:
  • Function that firstly parses the given parameter to JSON, secondly calls the callback function and returns the result.

Source:
Example
bim.functions.parse(${1:parameter}, ${2:callback})
Parameters:
Name Type Description
j *

Object expected to be parsed into JSON

callback function

function

Returns:

callback({boolean}, {parsedObject})

Type
*

(static) text(nopt) → {string}

Description:
  • Randomly generates alphabetical string with given parameter number

Source:
Example
bim.functions.text(${1:number})
Parameters:
Name Type Attributes Default Description
n number <optional>
16

length of the text

Returns:

randomlly generated text string

Type
string

(static) unique(arr) → {Array}

Description:
  • Function that returns new Array duplicated values removed.

Source:
Parameters:
Name Type Description
arr Array

Array

Returns:

New Array duplicated valued removed

Type
Array