spreadsheet
typeScript/javascript spreadsheet parser, with formulas.
git clone https://git.vogt.world/spreadsheet.git
Log | Files | README.md
← Commit log
commit
message
Minor refactoring
author
Ben Vogt <[email protected]>
date
2016-12-27 04:18:39
stats
2 file(s) changed, 10 insertions(+), 16 deletions(-)
files
ts/sheet.js
ts/sheet.ts
 1diff --git a/ts/sheet.js b/ts/sheet.js
 2index 6fcca3d..a3a912d 100644
 3--- a/ts/sheet.js
 4+++ b/ts/sheet.js
 5@@ -448,8 +448,8 @@ var mine = (function () {
 6             fn = fn.toUpperCase();
 7             args = args || [];
 8             if (instance.helper.SUPPORTED_FORMULAS.indexOf(fn) > -1) {
 9-                if (instance.formulas[fn]) {
10-                    return instance.formulas[fn].apply(this, args);
11+                if (Formula[fn]) {
12+                    return Formula[fn].apply(this, args);
13                 }
14             }
15             throw Error('NAME');
16@@ -459,8 +459,8 @@ var mine = (function () {
17             var str = args[0];
18             if (str) {
19                 str = str.toUpperCase();
20-                if (instance.formulas[str]) {
21-                    return ((typeof instance.formulas[str] === 'function') ? instance.formulas[str].apply(this, args) : instance.formulas[str]);
22+                if (Formula[str]) {
23+                    return ((typeof Formula[str] === 'function') ? Formula[str].apply(this, args) : Formula[str]);
24                 }
25             }
26             throw Error('NAME');
27@@ -544,9 +544,7 @@ var mine = (function () {
28     var init = function () {
29         instance = this;
30         parser = FormulaParser(instance);
31-        instance.formulas = Formula;
32         instance.matrix = new Matrix();
33-        instance.custom = {};
34         instance.matrix.scan();
35     };
36     return {
37diff --git a/ts/sheet.ts b/ts/sheet.ts
38index 668f1f7..ceb76e2 100644
39--- a/ts/sheet.ts
40+++ b/ts/sheet.ts
41@@ -570,8 +570,8 @@ var mine = (function () {
42       args = args || [];
43 
44       if (instance.helper.SUPPORTED_FORMULAS.indexOf(fn) > -1) {
45-        if (instance.formulas[fn]) {
46-          return instance.formulas[fn].apply(this, args);
47+        if (Formula[fn]) {
48+          return Formula[fn].apply(this, args);
49         }
50       }
51 
52@@ -584,8 +584,8 @@ var mine = (function () {
53 
54       if (str) {
55         str = str.toUpperCase();
56-        if (instance.formulas[str]) {
57-          return ((typeof instance.formulas[str] === 'function') ? instance.formulas[str].apply(this, args) : instance.formulas[str]);
58+        if (Formula[str]) {
59+          return ((typeof Formula[str] === 'function') ? Formula[str].apply(this, args) : Formula[str]);
60         }
61       }
62 
63@@ -689,14 +689,8 @@ var mine = (function () {
64 
65   var init = function () {
66     instance = this;
67-
68     parser = FormulaParser(instance);
69-
70-    instance.formulas = Formula;
71     instance.matrix = new Matrix();
72-
73-    instance.custom = {};
74-
75     instance.matrix.scan();
76   };
77