commit
message
[Logical] Cleaning up file
author
Ben Vogt <[email protected]>
date
2017-05-01 23:01:25
stats
1 file(s) changed,
12 insertions(+),
5 deletions(-)
files
src/Formulas/Logical.ts
1diff --git a/src/Formulas/Logical.ts b/src/Formulas/Logical.ts
2index 289121e..1e7b968 100644
3--- a/src/Formulas/Logical.ts
4+++ b/src/Formulas/Logical.ts
5@@ -10,8 +10,10 @@ import {
6 } from "../Errors";
7
8 /**
9- * Returns true if all of the provided arguments are logically true, and false if any of the provided arguments are logically false.
10- * @param values At least one expression or reference to a cell containing an expression that represents some logical value, i.e. TRUE or FALSE, or an expression that can be coerced to a logical value.
11+ * Returns true if all of the provided arguments are logically true, and false if any of the provided arguments are
12+ * logically false.
13+ * @param values At least one expression or reference to a cell containing an expression that represents some logical
14+ * value, i.e. TRUE or FALSE, or an expression that can be coerced to a logical value.
15 * @returns {boolean} if all values are logically true.
16 * @constructor
17 */
18@@ -20,7 +22,8 @@ var AND = function (...values) {
19 var result = true;
20 for (var i = 0; i < values.length; i++) {
21 if (typeof values[i] === "string") {
22- throw new ValueError("AND expects boolean values. But '" + values[i] + "' is a text and cannot be coerced to a boolean.")
23+ throw new ValueError("AND expects boolean values. But '" + values[i]
24+ + "' is a text and cannot be coerced to a boolean.")
25 } else if (values[i] instanceof Array) {
26 if (!AND.apply(this, values[i])) {
27 result = false;
28@@ -94,7 +97,8 @@ var NOT = function (...values) : boolean {
29 if (X === "") {
30 return true;
31 }
32- throw new ValueError("Function NOT parameter 1 expects boolean values. But '" + X + "' is a text and cannot be coerced to a boolean.")
33+ throw new ValueError("Function NOT parameter 1 expects boolean values. But '" + X
34+ + "' is a text and cannot be coerced to a boolean.")
35 }
36 if (typeof(X) === "number") {
37 return X === 0;
38@@ -108,9 +112,10 @@ var NOT = function (...values) : boolean {
39 };
40
41 /**
42- * Returns true if any of the provided arguments are logically true, and false if all of the provided arguments are logically false.
43- * TODO: Should this allow the acceptance of functions that return true or false?
44- * @param values An expression or reference to a cell containing an expression that represents some logical value, i.e. TRUE or FALSE, or an expression that can be coerced to a logical value.
45+ * Returns true if any of the provided arguments are logically true, and false if all of the provided arguments are
46+ * logically false.
47+ * @param values An expression or reference to a cell containing an expression that represents some logical value, i.e.
48+ * TRUE or FALSE, or an expression that can be coerced to a logical value.
49 * @returns {boolean}
50 * @constructor
51 */