Global

Methods

module:refactor.addToArrayByNode @(node, code)

Source:

Add an element to an array definition.

Parameters:
Name Type Description
node object

The ast node of the array definition.

code string

The code to append to the array.

module:refactor.removeFromArrayByNode @(node, eleNode)

Source:

Remove an element from an array definition.

Parameters:
Name Type Description
node object

The ast node of the array definition.

eleNode object

The ast node to be removed.

nearestCharAfter(char, str)

Source:

Similar with nearestCharBefore, but find the char after the given index. If not found, return -1

Parameters:
Name Type Description
char string

Which char to find

str string

The string to to search.

nearestCharBefore(char, str)

Source:

Find the nearest char index before given index. skip white space strings If not found, return -1 eg: nearestCharBefore(',', '1, 2, 3', 4) => 1

Parameters:
Name Type Description
char string

Which char to find

str string

The string to to search.