diff --git a/src/expression/node/ConstantNode.js b/src/expression/node/ConstantNode.js index 65a6e353c..1b38743ed 100644 --- a/src/expression/node/ConstantNode.js +++ b/src/expression/node/ConstantNode.js @@ -103,18 +103,18 @@ function factory (type, config, load, typed) { var value = this._toString(options) switch (getType(this.value)) { - case 'number': - case 'BigNumber': - case 'Fraction': - return '' + value + '' + case 'number': + case 'BigNumber': + case 'Fraction': + return '' + value + '' case 'string': - return '' + value + '' + return '' + value + '' case 'boolean': - return '' + value + '' + return '' + value + '' case 'null': - return '' + value + '' + return '' + value + '' case 'undefined': - return '' + value + '' + return '' + value + '' default: return '' + value + '' diff --git a/src/expression/node/FunctionAssignmentNode.js b/src/expression/node/FunctionAssignmentNode.js index e027ec353..5e2a5b095 100644 --- a/src/expression/node/FunctionAssignmentNode.js +++ b/src/expression/node/FunctionAssignmentNode.js @@ -191,8 +191,8 @@ function factory (type, config, load, typed) { FunctionAssignmentNode.prototype.toHTML = function (options) { var parenthesis = (options && options.parenthesis) ? options.parenthesis : 'keep' var params = [] - for (var i = 0; i < this.params.length; i++) { - params.push('' + escape(this.params[i]) + '') + for (var i = 0; i < this.params.length; i++) { + params.push('' + escape(this.params[i]) + '') } var expr = this.expr.toHTML(options) if (needParenthesis(this, parenthesis)) { diff --git a/src/expression/node/IndexNode.js b/src/expression/node/IndexNode.js index 888a70f77..c0970d5ff 100644 --- a/src/expression/node/IndexNode.js +++ b/src/expression/node/IndexNode.js @@ -240,13 +240,13 @@ function factory (type, config, load, typed) { IndexNode.prototype.toHTML = function (options) { // format the parameters like "[1, 0:5]" var dimensions = [] - for (var i = 0; i < this.dimensions.length; i++) { - dimensions[i] = this.dimensions[i].toHTML() + for (var i = 0; i < this.dimensions.length; i++) { + dimensions[i] = this.dimensions[i].toHTML() } if (this.dotNotation) { - return '.' + '' + escape(this.getObjectProperty()) + '' + return '.' + '' + escape(this.getObjectProperty()) + '' } else { - return '[' + dimensions.join(',') + ']' + return '[' + dimensions.join(',') + ']' } } diff --git a/src/expression/node/OperatorNode.js b/src/expression/node/OperatorNode.js index 2060f3387..b2c422c19 100644 --- a/src/expression/node/OperatorNode.js +++ b/src/expression/node/OperatorNode.js @@ -477,11 +477,11 @@ function factory (type, config, load, typed) { rhs = '(' + rhs + ')' } - if (this.implicit && (this.getIdentifier() === 'OperatorNode:multiply') && (implicit == 'hide')) { - return lhs + '' + rhs - } + if (this.implicit && (this.getIdentifier() === 'OperatorNode:multiply') && (implicit == 'hide')) { + return lhs + '' + rhs + } - return lhs + '' + escape(this.op) + '' + rhs + return lhs + '' + escape(this.op) + '' + rhs } else if ((args.length > 2) && ((this.getIdentifier() === 'OperatorNode:add') || (this.getIdentifier() === 'OperatorNode:multiply'))) { var stringifiedArgs = args.map(function (arg, index) { arg = arg.toHTML(options) diff --git a/src/expression/node/SymbolNode.js b/src/expression/node/SymbolNode.js index d9da345fe..d6f11d737 100644 --- a/src/expression/node/SymbolNode.js +++ b/src/expression/node/SymbolNode.js @@ -136,17 +136,17 @@ function factory (type, config, load, typed, math) { var name = escape(this.name) if (name == 'true' || name == 'false') { - return '' + name + '' + return '' + name + '' } else if (name == 'i') { - return '' + name + '' + return '' + name + '' } else if (name == 'Infinity') { - return '' + name + '' + return '' + name + '' } else if (name == 'NaN') { - return '' + name + '' + return '' + name + '' } else if (name == 'null') { - return '' + name + '' + return '' + name + '' } else if (name == 'undefined') { - return '' + name + '' + return '' + name + '' } return '' + name + '' diff --git a/src/utils/array.js b/src/utils/array.js index 3c5f3a646..2d374af0d 100644 --- a/src/utils/array.js +++ b/src/utils/array.js @@ -460,8 +460,8 @@ export function join (array, separator) { /** * Assign a numeric identifier to every element of a sorted array - * @param {Array} a An array - * @return {Array} An array of objects containing the original value and its identifier + * @param {Array} a An array + * @return {Array} An array of objects containing the original value and its identifier */ export function identify (a) { if (!Array.isArray(a)) { @@ -477,7 +477,7 @@ export function identify (a) { b[0] = {value: a[0], identifier: 0} for (let i = 1; i < a.length; i++) { if (a[i] === a[i - 1]) { - count++ + count++ } else { count = 0 } @@ -488,8 +488,8 @@ export function identify (a) { /** * Remove the numeric identifier from the elements - * @param {array} a An array - * @return {array} An array of values without identifiers + * @param {array} a An array + * @return {array} An array of values without identifiers */ exports.generalize = function (a) { if (!Array.isArray(a)) { diff --git a/src/utils/string.js b/src/utils/string.js index dde23b894..0e90c95d9 100644 --- a/src/utils/string.js +++ b/src/utils/string.js @@ -155,10 +155,10 @@ exports.stringify = function (value) { exports.escape = function (value) { var text = String(value) text = text.replace(/&/g, '&') - .replace(/"/g, '"') - .replace(/'/g, ''') - .replace(//g, '>') + .replace(/"/g, '"') + .replace(/'/g, ''') + .replace(//g, '>') return text }