Skip to content

Commit 36cbfa7

Browse files
author
RTLcoil
authored
Update docstring for normalize_expression (#461)
1 parent a80eeb1 commit 36cbfa7

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/utils/index.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,11 @@ function textStyle(layer) {
122122
}
123123

124124
/**
125-
* Normalize an offset value
126-
* @param {String} expression a decimal value which may have a 'p' or '%' postfix. E.g. '35%', '0.4p'
127-
* @return {Object|String} a normalized String of the input value if possible otherwise the value itself
125+
* Normalize an expression string, replace "nice names" with their coded values and spaces with "_"
126+
* e.g. `width > 0` => `w_lt_0`
127+
*
128+
* @param {String} expression An expression to be normalized
129+
* @return {Object|String} A normalized String of the input value if possible otherwise the value itself
128130
*/
129131
function normalize_expression(expression) {
130132
if (!isString(expression) || expression.length === 0 || expression.match(/^!.+!$/)) {

0 commit comments

Comments
 (0)