@gridsheet/react-core 0.12.2 → 0.12.4-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.js +5183 -11
- package/package.json +18 -3
- package/dist/components/Cell.d.ts +0 -8
- package/dist/components/Cell.d.ts.map +0 -1
- package/dist/components/Cell.js +0 -199
- package/dist/components/Cell.js.map +0 -1
- package/dist/components/ContextMenu.d.ts +0 -3
- package/dist/components/ContextMenu.d.ts.map +0 -1
- package/dist/components/ContextMenu.js +0 -207
- package/dist/components/ContextMenu.js.map +0 -1
- package/dist/components/Editor.d.ts +0 -3
- package/dist/components/Editor.d.ts.map +0 -1
- package/dist/components/Editor.js +0 -304
- package/dist/components/Editor.js.map +0 -1
- package/dist/components/Emitter.d.ts +0 -9
- package/dist/components/Emitter.d.ts.map +0 -1
- package/dist/components/Emitter.js +0 -26
- package/dist/components/Emitter.js.map +0 -1
- package/dist/components/GridSheet.d.ts +0 -4
- package/dist/components/GridSheet.d.ts.map +0 -1
- package/dist/components/GridSheet.js +0 -110
- package/dist/components/GridSheet.js.map +0 -1
- package/dist/components/HeaderLeftCell.d.ts +0 -7
- package/dist/components/HeaderLeftCell.d.ts.map +0 -1
- package/dist/components/HeaderLeftCell.js +0 -67
- package/dist/components/HeaderLeftCell.js.map +0 -1
- package/dist/components/HeaderTopCell.d.ts +0 -7
- package/dist/components/HeaderTopCell.d.ts.map +0 -1
- package/dist/components/HeaderTopCell.js +0 -68
- package/dist/components/HeaderTopCell.js.map +0 -1
- package/dist/components/Resizer.d.ts +0 -3
- package/dist/components/Resizer.d.ts.map +0 -1
- package/dist/components/Resizer.js +0 -83
- package/dist/components/Resizer.js.map +0 -1
- package/dist/components/SearchBox.d.ts +0 -3
- package/dist/components/SearchBox.d.ts.map +0 -1
- package/dist/components/SearchBox.js +0 -52
- package/dist/components/SearchBox.js.map +0 -1
- package/dist/components/StoreInitializer.d.ts +0 -4
- package/dist/components/StoreInitializer.d.ts.map +0 -1
- package/dist/components/StoreInitializer.js +0 -68
- package/dist/components/StoreInitializer.js.map +0 -1
- package/dist/components/Tabular.d.ts +0 -9
- package/dist/components/Tabular.d.ts.map +0 -1
- package/dist/components/Tabular.js +0 -84
- package/dist/components/Tabular.js.map +0 -1
- package/dist/constants.d.ts +0 -18
- package/dist/constants.d.ts.map +0 -1
- package/dist/constants.js +0 -21
- package/dist/constants.js.map +0 -1
- package/dist/formula/evaluator.d.ts +0 -91
- package/dist/formula/evaluator.d.ts.map +0 -1
- package/dist/formula/evaluator.js +0 -541
- package/dist/formula/evaluator.js.map +0 -1
- package/dist/formula/functions/__base.d.ts +0 -23
- package/dist/formula/functions/__base.d.ts.map +0 -1
- package/dist/formula/functions/__base.js +0 -16
- package/dist/formula/functions/__base.js.map +0 -1
- package/dist/formula/functions/__utils.d.ts +0 -6
- package/dist/formula/functions/__utils.d.ts.map +0 -1
- package/dist/formula/functions/__utils.js +0 -102
- package/dist/formula/functions/__utils.js.map +0 -1
- package/dist/formula/functions/abs.d.ts +0 -12
- package/dist/formula/functions/abs.d.ts.map +0 -1
- package/dist/formula/functions/abs.js +0 -21
- package/dist/formula/functions/abs.js.map +0 -1
- package/dist/formula/functions/abs.spec.d.ts +0 -2
- package/dist/formula/functions/abs.spec.d.ts.map +0 -1
- package/dist/formula/functions/abs.spec.js +0 -29
- package/dist/formula/functions/abs.spec.js.map +0 -1
- package/dist/formula/functions/acos.d.ts +0 -12
- package/dist/formula/functions/acos.d.ts.map +0 -1
- package/dist/formula/functions/acos.js +0 -29
- package/dist/formula/functions/acos.js.map +0 -1
- package/dist/formula/functions/add.d.ts +0 -13
- package/dist/formula/functions/add.d.ts.map +0 -1
- package/dist/formula/functions/add.js +0 -50
- package/dist/formula/functions/add.js.map +0 -1
- package/dist/formula/functions/and.d.ts +0 -19
- package/dist/formula/functions/and.d.ts.map +0 -1
- package/dist/formula/functions/and.js +0 -28
- package/dist/formula/functions/and.js.map +0 -1
- package/dist/formula/functions/asin.d.ts +0 -12
- package/dist/formula/functions/asin.d.ts.map +0 -1
- package/dist/formula/functions/asin.js +0 -29
- package/dist/formula/functions/asin.js.map +0 -1
- package/dist/formula/functions/atan.d.ts +0 -12
- package/dist/formula/functions/atan.d.ts.map +0 -1
- package/dist/formula/functions/atan.js +0 -26
- package/dist/formula/functions/atan.js.map +0 -1
- package/dist/formula/functions/atan2.d.ts +0 -12
- package/dist/formula/functions/atan2.d.ts.map +0 -1
- package/dist/formula/functions/atan2.js +0 -32
- package/dist/formula/functions/atan2.js.map +0 -1
- package/dist/formula/functions/average.d.ts +0 -19
- package/dist/formula/functions/average.d.ts.map +0 -1
- package/dist/formula/functions/average.js +0 -41
- package/dist/formula/functions/average.js.map +0 -1
- package/dist/formula/functions/col.d.ts +0 -14
- package/dist/formula/functions/col.d.ts.map +0 -1
- package/dist/formula/functions/col.js +0 -30
- package/dist/formula/functions/col.js.map +0 -1
- package/dist/formula/functions/concat.d.ts +0 -12
- package/dist/formula/functions/concat.d.ts.map +0 -1
- package/dist/formula/functions/concat.js +0 -27
- package/dist/formula/functions/concat.js.map +0 -1
- package/dist/formula/functions/concatenate.d.ts +0 -19
- package/dist/formula/functions/concatenate.d.ts.map +0 -1
- package/dist/formula/functions/concatenate.js +0 -25
- package/dist/formula/functions/concatenate.js.map +0 -1
- package/dist/formula/functions/cos.d.ts +0 -12
- package/dist/formula/functions/cos.d.ts.map +0 -1
- package/dist/formula/functions/cos.js +0 -26
- package/dist/formula/functions/cos.js.map +0 -1
- package/dist/formula/functions/count.d.ts +0 -19
- package/dist/formula/functions/count.d.ts.map +0 -1
- package/dist/formula/functions/count.js +0 -35
- package/dist/formula/functions/count.js.map +0 -1
- package/dist/formula/functions/counta.d.ts +0 -19
- package/dist/formula/functions/counta.d.ts.map +0 -1
- package/dist/formula/functions/counta.js +0 -35
- package/dist/formula/functions/counta.js.map +0 -1
- package/dist/formula/functions/countif.d.ts +0 -13
- package/dist/formula/functions/countif.d.ts.map +0 -1
- package/dist/formula/functions/countif.js +0 -30
- package/dist/formula/functions/countif.js.map +0 -1
- package/dist/formula/functions/divide.d.ts +0 -12
- package/dist/formula/functions/divide.d.ts.map +0 -1
- package/dist/formula/functions/divide.js +0 -33
- package/dist/formula/functions/divide.js.map +0 -1
- package/dist/formula/functions/eq.d.ts +0 -12
- package/dist/formula/functions/eq.d.ts.map +0 -1
- package/dist/formula/functions/eq.js +0 -25
- package/dist/formula/functions/eq.js.map +0 -1
- package/dist/formula/functions/exp.d.ts +0 -12
- package/dist/formula/functions/exp.d.ts.map +0 -1
- package/dist/formula/functions/exp.js +0 -28
- package/dist/formula/functions/exp.js.map +0 -1
- package/dist/formula/functions/gt.d.ts +0 -12
- package/dist/formula/functions/gt.d.ts.map +0 -1
- package/dist/formula/functions/gt.js +0 -27
- package/dist/formula/functions/gt.js.map +0 -1
- package/dist/formula/functions/gte.d.ts +0 -12
- package/dist/formula/functions/gte.d.ts.map +0 -1
- package/dist/formula/functions/gte.js +0 -27
- package/dist/formula/functions/gte.js.map +0 -1
- package/dist/formula/functions/hlookup.d.ts +0 -18
- package/dist/formula/functions/hlookup.d.ts.map +0 -1
- package/dist/formula/functions/hlookup.js +0 -74
- package/dist/formula/functions/hlookup.js.map +0 -1
- package/dist/formula/functions/if.d.ts +0 -17
- package/dist/formula/functions/if.d.ts.map +0 -1
- package/dist/formula/functions/if.js +0 -36
- package/dist/formula/functions/if.js.map +0 -1
- package/dist/formula/functions/iferror.d.ts +0 -20
- package/dist/formula/functions/iferror.d.ts.map +0 -1
- package/dist/formula/functions/iferror.js +0 -41
- package/dist/formula/functions/iferror.js.map +0 -1
- package/dist/formula/functions/iferror.spec.d.ts +0 -2
- package/dist/formula/functions/iferror.spec.d.ts.map +0 -1
- package/dist/formula/functions/iferror.spec.js +0 -61
- package/dist/formula/functions/iferror.spec.js.map +0 -1
- package/dist/formula/functions/len.d.ts +0 -12
- package/dist/formula/functions/len.d.ts.map +0 -1
- package/dist/formula/functions/len.js +0 -26
- package/dist/formula/functions/len.js.map +0 -1
- package/dist/formula/functions/lenb.d.ts +0 -12
- package/dist/formula/functions/lenb.d.ts.map +0 -1
- package/dist/formula/functions/lenb.js +0 -26
- package/dist/formula/functions/lenb.js.map +0 -1
- package/dist/formula/functions/ln.d.ts +0 -12
- package/dist/formula/functions/ln.d.ts.map +0 -1
- package/dist/formula/functions/ln.js +0 -29
- package/dist/formula/functions/ln.js.map +0 -1
- package/dist/formula/functions/log.d.ts +0 -12
- package/dist/formula/functions/log.d.ts.map +0 -1
- package/dist/formula/functions/log.js +0 -35
- package/dist/formula/functions/log.js.map +0 -1
- package/dist/formula/functions/log10.d.ts +0 -12
- package/dist/formula/functions/log10.d.ts.map +0 -1
- package/dist/formula/functions/log10.js +0 -29
- package/dist/formula/functions/log10.js.map +0 -1
- package/dist/formula/functions/lt.d.ts +0 -12
- package/dist/formula/functions/lt.d.ts.map +0 -1
- package/dist/formula/functions/lt.js +0 -27
- package/dist/formula/functions/lt.js.map +0 -1
- package/dist/formula/functions/lte.d.ts +0 -12
- package/dist/formula/functions/lte.d.ts.map +0 -1
- package/dist/formula/functions/lte.js +0 -27
- package/dist/formula/functions/lte.js.map +0 -1
- package/dist/formula/functions/max.d.ts +0 -19
- package/dist/formula/functions/max.d.ts.map +0 -1
- package/dist/formula/functions/max.js +0 -44
- package/dist/formula/functions/max.js.map +0 -1
- package/dist/formula/functions/min.d.ts +0 -19
- package/dist/formula/functions/min.d.ts.map +0 -1
- package/dist/formula/functions/min.js +0 -44
- package/dist/formula/functions/min.js.map +0 -1
- package/dist/formula/functions/minus.d.ts +0 -13
- package/dist/formula/functions/minus.d.ts.map +0 -1
- package/dist/formula/functions/minus.js +0 -50
- package/dist/formula/functions/minus.js.map +0 -1
- package/dist/formula/functions/mod.d.ts +0 -12
- package/dist/formula/functions/mod.d.ts.map +0 -1
- package/dist/formula/functions/mod.js +0 -31
- package/dist/formula/functions/mod.js.map +0 -1
- package/dist/formula/functions/mod.spec.d.ts +0 -2
- package/dist/formula/functions/mod.spec.d.ts.map +0 -1
- package/dist/formula/functions/mod.spec.js +0 -52
- package/dist/formula/functions/mod.spec.js.map +0 -1
- package/dist/formula/functions/multiply.d.ts +0 -12
- package/dist/formula/functions/multiply.d.ts.map +0 -1
- package/dist/formula/functions/multiply.js +0 -27
- package/dist/formula/functions/multiply.js.map +0 -1
- package/dist/formula/functions/ne.d.ts +0 -12
- package/dist/formula/functions/ne.d.ts.map +0 -1
- package/dist/formula/functions/ne.js +0 -25
- package/dist/formula/functions/ne.js.map +0 -1
- package/dist/formula/functions/not.d.ts +0 -12
- package/dist/formula/functions/not.d.ts.map +0 -1
- package/dist/formula/functions/not.js +0 -30
- package/dist/formula/functions/not.js.map +0 -1
- package/dist/formula/functions/now.d.ts +0 -9
- package/dist/formula/functions/now.d.ts.map +0 -1
- package/dist/formula/functions/now.js +0 -21
- package/dist/formula/functions/now.js.map +0 -1
- package/dist/formula/functions/or.d.ts +0 -19
- package/dist/formula/functions/or.d.ts.map +0 -1
- package/dist/formula/functions/or.js +0 -28
- package/dist/formula/functions/or.js.map +0 -1
- package/dist/formula/functions/pi.d.ts +0 -9
- package/dist/formula/functions/pi.d.ts.map +0 -1
- package/dist/formula/functions/pi.js +0 -19
- package/dist/formula/functions/pi.js.map +0 -1
- package/dist/formula/functions/power.d.ts +0 -12
- package/dist/formula/functions/power.d.ts.map +0 -1
- package/dist/formula/functions/power.js +0 -24
- package/dist/formula/functions/power.js.map +0 -1
- package/dist/formula/functions/product.d.ts +0 -19
- package/dist/formula/functions/product.d.ts.map +0 -1
- package/dist/formula/functions/product.js +0 -37
- package/dist/formula/functions/product.js.map +0 -1
- package/dist/formula/functions/radians.d.ts +0 -12
- package/dist/formula/functions/radians.d.ts.map +0 -1
- package/dist/formula/functions/radians.js +0 -26
- package/dist/formula/functions/radians.js.map +0 -1
- package/dist/formula/functions/rand.d.ts +0 -9
- package/dist/formula/functions/rand.d.ts.map +0 -1
- package/dist/formula/functions/rand.js +0 -19
- package/dist/formula/functions/rand.js.map +0 -1
- package/dist/formula/functions/round.d.ts +0 -17
- package/dist/formula/functions/round.d.ts.map +0 -1
- package/dist/formula/functions/round.js +0 -34
- package/dist/formula/functions/round.js.map +0 -1
- package/dist/formula/functions/rounddown.d.ts +0 -17
- package/dist/formula/functions/rounddown.d.ts.map +0 -1
- package/dist/formula/functions/rounddown.js +0 -34
- package/dist/formula/functions/rounddown.js.map +0 -1
- package/dist/formula/functions/roundup.d.ts +0 -17
- package/dist/formula/functions/roundup.d.ts.map +0 -1
- package/dist/formula/functions/roundup.js +0 -34
- package/dist/formula/functions/roundup.js.map +0 -1
- package/dist/formula/functions/row.d.ts +0 -14
- package/dist/formula/functions/row.d.ts.map +0 -1
- package/dist/formula/functions/row.js +0 -30
- package/dist/formula/functions/row.js.map +0 -1
- package/dist/formula/functions/sin.d.ts +0 -12
- package/dist/formula/functions/sin.d.ts.map +0 -1
- package/dist/formula/functions/sin.js +0 -26
- package/dist/formula/functions/sin.js.map +0 -1
- package/dist/formula/functions/sqrt.d.ts +0 -12
- package/dist/formula/functions/sqrt.d.ts.map +0 -1
- package/dist/formula/functions/sqrt.js +0 -29
- package/dist/formula/functions/sqrt.js.map +0 -1
- package/dist/formula/functions/sum.d.ts +0 -19
- package/dist/formula/functions/sum.d.ts.map +0 -1
- package/dist/formula/functions/sum.js +0 -44
- package/dist/formula/functions/sum.js.map +0 -1
- package/dist/formula/functions/sum.spec.d.ts +0 -2
- package/dist/formula/functions/sum.spec.d.ts.map +0 -1
- package/dist/formula/functions/sum.spec.js +0 -40
- package/dist/formula/functions/sum.spec.js.map +0 -1
- package/dist/formula/functions/sumif.d.ts +0 -18
- package/dist/formula/functions/sumif.d.ts.map +0 -1
- package/dist/formula/functions/sumif.js +0 -59
- package/dist/formula/functions/sumif.js.map +0 -1
- package/dist/formula/functions/tan.d.ts +0 -12
- package/dist/formula/functions/tan.d.ts.map +0 -1
- package/dist/formula/functions/tan.js +0 -26
- package/dist/formula/functions/tan.js.map +0 -1
- package/dist/formula/functions/uminus.d.ts +0 -12
- package/dist/formula/functions/uminus.d.ts.map +0 -1
- package/dist/formula/functions/uminus.js +0 -23
- package/dist/formula/functions/uminus.js.map +0 -1
- package/dist/formula/functions/vlookup.d.ts +0 -18
- package/dist/formula/functions/vlookup.d.ts.map +0 -1
- package/dist/formula/functions/vlookup.js +0 -74
- package/dist/formula/functions/vlookup.js.map +0 -1
- package/dist/formula/mapping.d.ts +0 -114
- package/dist/formula/mapping.d.ts.map +0 -1
- package/dist/formula/mapping.js +0 -114
- package/dist/formula/mapping.js.map +0 -1
- package/dist/formula/solver.d.ts +0 -12
- package/dist/formula/solver.d.ts.map +0 -1
- package/dist/formula/solver.js +0 -64
- package/dist/formula/solver.js.map +0 -1
- package/dist/index.d.ts +0 -12
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/lib/autofill.d.ts +0 -17
- package/dist/lib/autofill.d.ts.map +0 -1
- package/dist/lib/autofill.js +0 -389
- package/dist/lib/autofill.js.map +0 -1
- package/dist/lib/clipboard.d.ts +0 -3
- package/dist/lib/clipboard.d.ts.map +0 -1
- package/dist/lib/clipboard.js +0 -45
- package/dist/lib/clipboard.js.map +0 -1
- package/dist/lib/converters.d.ts +0 -10
- package/dist/lib/converters.d.ts.map +0 -1
- package/dist/lib/converters.js +0 -127
- package/dist/lib/converters.js.map +0 -1
- package/dist/lib/structs.d.ts +0 -60
- package/dist/lib/structs.d.ts.map +0 -1
- package/dist/lib/structs.js +0 -251
- package/dist/lib/structs.js.map +0 -1
- package/dist/lib/table.d.ts +0 -299
- package/dist/lib/table.d.ts.map +0 -1
- package/dist/lib/table.js +0 -989
- package/dist/lib/table.js.map +0 -1
- package/dist/lib/time.d.ts +0 -14
- package/dist/lib/time.d.ts.map +0 -1
- package/dist/lib/time.js +0 -60
- package/dist/lib/time.js.map +0 -1
- package/dist/lib/virtualization.d.ts +0 -30
- package/dist/lib/virtualization.d.ts.map +0 -1
- package/dist/lib/virtualization.js +0 -114
- package/dist/lib/virtualization.js.map +0 -1
- package/dist/parsers/core.d.ts +0 -36
- package/dist/parsers/core.d.ts.map +0 -1
- package/dist/parsers/core.js +0 -123
- package/dist/parsers/core.js.map +0 -1
- package/dist/renderers/checkbox.d.ts +0 -5
- package/dist/renderers/checkbox.d.ts.map +0 -1
- package/dist/renderers/checkbox.js +0 -10
- package/dist/renderers/checkbox.js.map +0 -1
- package/dist/renderers/core.d.ts +0 -48
- package/dist/renderers/core.d.ts.map +0 -1
- package/dist/renderers/core.js +0 -143
- package/dist/renderers/core.js.map +0 -1
- package/dist/renderers/thousand_separator.d.ts +0 -5
- package/dist/renderers/thousand_separator.d.ts.map +0 -1
- package/dist/renderers/thousand_separator.js +0 -14
- package/dist/renderers/thousand_separator.js.map +0 -1
- package/dist/store/actions.d.ts +0 -198
- package/dist/store/actions.d.ts.map +0 -1
- package/dist/store/actions.js +0 -519
- package/dist/store/actions.js.map +0 -1
- package/dist/store/helpers.d.ts +0 -28
- package/dist/store/helpers.d.ts.map +0 -1
- package/dist/store/helpers.js +0 -78
- package/dist/store/helpers.js.map +0 -1
- package/dist/store/index.d.ts +0 -11
- package/dist/store/index.d.ts.map +0 -1
- package/dist/store/index.js +0 -3
- package/dist/store/index.js.map +0 -1
- package/dist/styles/embedder.d.ts +0 -2
- package/dist/styles/embedder.d.ts.map +0 -1
- package/dist/styles/embedder.js +0 -16
- package/dist/styles/embedder.js.map +0 -1
- package/dist/styles/minified.d.ts +0 -3
- package/dist/styles/minified.d.ts.map +0 -1
- package/dist/styles/minified.js +0 -4
- package/dist/styles/minified.js.map +0 -1
- package/dist/types.d.ts +0 -213
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -2
- package/dist/types.js.map +0 -1
- package/dist/utils.d.ts +0 -2
- package/dist/utils.d.ts.map +0 -1
- package/dist/utils.js +0 -7
- package/dist/utils.js.map +0 -1
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { BaseFunction } from "./__base";
|
|
2
|
-
import { ensureBoolean } from "./__utils";
|
|
3
|
-
export class OrFunction extends BaseFunction {
|
|
4
|
-
constructor() {
|
|
5
|
-
super(...arguments);
|
|
6
|
-
this.example = "OR(A1=1, A2=2)";
|
|
7
|
-
this.helpText = [
|
|
8
|
-
"Returns TRUE if any argument is logically true.",
|
|
9
|
-
"Returns FALSE if all arguments are logically false.",
|
|
10
|
-
];
|
|
11
|
-
this.helpArgs = [
|
|
12
|
-
{ name: "expression1", description: "First logical expression." },
|
|
13
|
-
{
|
|
14
|
-
name: "expression2",
|
|
15
|
-
description: "Additional expressions",
|
|
16
|
-
optional: true,
|
|
17
|
-
iterable: true,
|
|
18
|
-
},
|
|
19
|
-
];
|
|
20
|
-
}
|
|
21
|
-
validate() {
|
|
22
|
-
this.bareArgs = this.bareArgs.map((arg) => ensureBoolean(arg));
|
|
23
|
-
}
|
|
24
|
-
main(...values) {
|
|
25
|
-
return values.reduce((a, b) => a || b);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=or.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"or.js","sourceRoot":"","sources":["../../../src/formula/functions/or.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C,MAAM,OAAO,UAAW,SAAQ,YAAY;IAA5C;;QACE,YAAO,GAAG,gBAAgB,CAAC;QAC3B,aAAQ,GAAG;YACT,iDAAiD;YACjD,qDAAqD;SACtD,CAAC;QACF,aAAQ,GAAG;YACT,EAAE,IAAI,EAAE,aAAa,EAAE,WAAW,EAAE,2BAA2B,EAAE;YACjE;gBACE,IAAI,EAAE,aAAa;gBACnB,WAAW,EAAE,wBAAwB;gBACrC,QAAQ,EAAE,IAAI;gBACd,QAAQ,EAAE,IAAI;aACf;SACF,CAAC;IASJ,CAAC;IAPW,QAAQ;QAChB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC;IACjE,CAAC;IAES,IAAI,CAAC,GAAG,MAAiB;QACjC,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IACzC,CAAC;CACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pi.d.ts","sourceRoot":"","sources":["../../../src/formula/functions/pi.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,qBAAa,UAAW,SAAQ,YAAY;IAC1C,OAAO,SAAU;IACjB,QAAQ,WAAgC;IACxC,QAAQ,UAAM;IAEd,SAAS,CAAC,QAAQ;IASlB,SAAS,CAAC,IAAI;CAGf"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { FormulaError } from "../evaluator";
|
|
2
|
-
import { BaseFunction } from "./__base";
|
|
3
|
-
export class PiFunction extends BaseFunction {
|
|
4
|
-
constructor() {
|
|
5
|
-
super(...arguments);
|
|
6
|
-
this.example = "PI()";
|
|
7
|
-
this.helpText = ["Returns the value of pi."];
|
|
8
|
-
this.helpArgs = [];
|
|
9
|
-
}
|
|
10
|
-
validate() {
|
|
11
|
-
if (this.bareArgs.length !== 0) {
|
|
12
|
-
throw new FormulaError("#N/A", "Number of arguments for PI is incorrect.");
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
main() {
|
|
16
|
-
return Math.PI;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=pi.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pi.js","sourceRoot":"","sources":["../../../src/formula/functions/pi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,MAAM,OAAO,UAAW,SAAQ,YAAY;IAA5C;;QACE,YAAO,GAAG,MAAM,CAAC;QACjB,aAAQ,GAAG,CAAC,0BAA0B,CAAC,CAAC;QACxC,aAAQ,GAAG,EAAE,CAAC;IAchB,CAAC;IAZW,QAAQ;QAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;YAC9B,MAAM,IAAI,YAAY,CACpB,MAAM,EACN,0CAA0C,CAC3C,CAAC;SACH;IACH,CAAC;IAES,IAAI;QACZ,OAAO,IAAI,CAAC,EAAE,CAAC;IACjB,CAAC;CACF"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { BaseFunction } from "./__base";
|
|
2
|
-
export declare class PowerFunction extends BaseFunction {
|
|
3
|
-
example: string;
|
|
4
|
-
helpText: string[];
|
|
5
|
-
helpArgs: {
|
|
6
|
-
name: string;
|
|
7
|
-
description: string;
|
|
8
|
-
}[];
|
|
9
|
-
protected validate(): void;
|
|
10
|
-
protected main(base: number, exponent: number): number;
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=power.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"power.d.ts","sourceRoot":"","sources":["../../../src/formula/functions/power.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAGxC,qBAAa,aAAc,SAAQ,YAAY;IAC7C,OAAO,SAAkB;IACzB,QAAQ,WAAmD;IAC3D,QAAQ;;;QAGN;IAEF,SAAS,CAAC,QAAQ;IAUlB,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;CAG9C"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { FormulaError } from "../evaluator";
|
|
2
|
-
import { BaseFunction } from "./__base";
|
|
3
|
-
import { ensureNumber } from "./__utils";
|
|
4
|
-
export class PowerFunction extends BaseFunction {
|
|
5
|
-
constructor() {
|
|
6
|
-
super(...arguments);
|
|
7
|
-
this.example = "POWER(4,0.5)";
|
|
8
|
-
this.helpText = ["Returns a number multiplied by an exponent."];
|
|
9
|
-
this.helpArgs = [
|
|
10
|
-
{ name: "base", description: "A number to be multiplied by an exponent." },
|
|
11
|
-
{ name: "exponent", description: "An exponent to power the base." },
|
|
12
|
-
];
|
|
13
|
-
}
|
|
14
|
-
validate() {
|
|
15
|
-
if (this.bareArgs.length !== 2) {
|
|
16
|
-
throw new FormulaError("#N/A", "Number of arguments for POWER is incorrect.");
|
|
17
|
-
}
|
|
18
|
-
this.bareArgs = this.bareArgs.map((arg) => ensureNumber(arg));
|
|
19
|
-
}
|
|
20
|
-
main(base, exponent) {
|
|
21
|
-
return Math.pow(base, exponent);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=power.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"power.js","sourceRoot":"","sources":["../../../src/formula/functions/power.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,MAAM,OAAO,aAAc,SAAQ,YAAY;IAA/C;;QACE,YAAO,GAAG,cAAc,CAAC;QACzB,aAAQ,GAAG,CAAC,6CAA6C,CAAC,CAAC;QAC3D,aAAQ,GAAG;YACT,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,2CAA2C,EAAE;YAC1E,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,gCAAgC,EAAE;SACpE,CAAC;IAeJ,CAAC;IAbW,QAAQ;QAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;YAC9B,MAAM,IAAI,YAAY,CACpB,MAAM,EACN,6CAA6C,CAC9C,CAAC;SACH;QACD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC;IAChE,CAAC;IAES,IAAI,CAAC,IAAY,EAAE,QAAgB;QAC3C,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAClC,CAAC;CACF"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { BaseFunction } from "./__base";
|
|
2
|
-
export declare class ProductFunction extends BaseFunction {
|
|
3
|
-
example: string;
|
|
4
|
-
helpText: string[];
|
|
5
|
-
helpArgs: ({
|
|
6
|
-
name: string;
|
|
7
|
-
description: string;
|
|
8
|
-
optional?: undefined;
|
|
9
|
-
iterable?: undefined;
|
|
10
|
-
} | {
|
|
11
|
-
name: string;
|
|
12
|
-
description: string;
|
|
13
|
-
optional: boolean;
|
|
14
|
-
iterable: boolean;
|
|
15
|
-
})[];
|
|
16
|
-
protected validate(): void;
|
|
17
|
-
protected main(...values: number[]): number;
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=product.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"product.d.ts","sourceRoot":"","sources":["../../../src/formula/functions/product.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAGxC,qBAAa,eAAgB,SAAQ,YAAY;IAC/C,OAAO,SAAsB;IAC7B,QAAQ,WAA4D;IACpE,QAAQ;;;;;;;;;;SAQN;IAEF,SAAS,CAAC,QAAQ;IAgBlB,SAAS,CAAC,IAAI,CAAC,GAAG,MAAM,EAAE,MAAM,EAAE;CAGnC"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { solveTable } from "../solver";
|
|
2
|
-
import { Table } from "../../lib/table";
|
|
3
|
-
import { BaseFunction } from "./__base";
|
|
4
|
-
import { ensureNumber } from "./__utils";
|
|
5
|
-
export class ProductFunction extends BaseFunction {
|
|
6
|
-
constructor() {
|
|
7
|
-
super(...arguments);
|
|
8
|
-
this.example = "PRODUCT(A2:A100)";
|
|
9
|
-
this.helpText = ["Returns the product of a series of numbers or cells."];
|
|
10
|
-
this.helpArgs = [
|
|
11
|
-
{ name: "value1", description: "First number or range." },
|
|
12
|
-
{
|
|
13
|
-
name: "value2",
|
|
14
|
-
description: "Additional numbers or ranges",
|
|
15
|
-
optional: true,
|
|
16
|
-
iterable: true,
|
|
17
|
-
},
|
|
18
|
-
];
|
|
19
|
-
}
|
|
20
|
-
validate() {
|
|
21
|
-
const spreaded = [];
|
|
22
|
-
this.bareArgs.forEach((arg) => {
|
|
23
|
-
if (arg instanceof Table) {
|
|
24
|
-
spreaded.push(...solveTable({ table: arg })
|
|
25
|
-
.reduce((a, b) => a.concat(b))
|
|
26
|
-
.filter((v) => typeof v === "number"));
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
spreaded.push(ensureNumber(arg));
|
|
30
|
-
});
|
|
31
|
-
this.bareArgs = spreaded;
|
|
32
|
-
}
|
|
33
|
-
main(...values) {
|
|
34
|
-
return values.reduce((a, b) => a * b);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
//# sourceMappingURL=product.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"product.js","sourceRoot":"","sources":["../../../src/formula/functions/product.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,MAAM,OAAO,eAAgB,SAAQ,YAAY;IAAjD;;QACE,YAAO,GAAG,kBAAkB,CAAC;QAC7B,aAAQ,GAAG,CAAC,sDAAsD,CAAC,CAAC;QACpE,aAAQ,GAAG;YACT,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,wBAAwB,EAAE;YACzD;gBACE,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,8BAA8B;gBAC3C,QAAQ,EAAE,IAAI;gBACd,QAAQ,EAAE,IAAI;aACf;SACF,CAAC;IAqBJ,CAAC;IAnBW,QAAQ;QAChB,MAAM,QAAQ,GAAa,EAAE,CAAC;QAC9B,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;YAC5B,IAAI,GAAG,YAAY,KAAK,EAAE;gBACxB,QAAQ,CAAC,IAAI,CACX,GAAG,UAAU,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC;qBAC1B,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;qBAC7B,MAAM,CAAC,CAAC,CAAM,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC,CAC7C,CAAC;gBACF,OAAO;aACR;YACD,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC;QACnC,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAES,IAAI,CAAC,GAAG,MAAgB;QAChC,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACxC,CAAC;CACF"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { BaseFunction } from "./__base";
|
|
2
|
-
export declare class RadiansFunction extends BaseFunction {
|
|
3
|
-
example: string;
|
|
4
|
-
helpText: string[];
|
|
5
|
-
helpArgs: {
|
|
6
|
-
name: string;
|
|
7
|
-
description: string;
|
|
8
|
-
}[];
|
|
9
|
-
protected validate(): void;
|
|
10
|
-
protected main(angle: number): number;
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=radians.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"radians.d.ts","sourceRoot":"","sources":["../../../src/formula/functions/radians.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAGxC,qBAAa,eAAgB,SAAQ,YAAY;IAC/C,OAAO,SAAkB;IACzB,QAAQ,WAAkD;IAC1D,QAAQ;;;QAKN;IAEF,SAAS,CAAC,QAAQ;IAUlB,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM;CAG7B"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { FormulaError } from "../evaluator";
|
|
2
|
-
import { BaseFunction } from "./__base";
|
|
3
|
-
import { ensureNumber } from "./__utils";
|
|
4
|
-
export class RadiansFunction extends BaseFunction {
|
|
5
|
-
constructor() {
|
|
6
|
-
super(...arguments);
|
|
7
|
-
this.example = "RADIANS(180)";
|
|
8
|
-
this.helpText = ["Converts an angle from degrees to radians."];
|
|
9
|
-
this.helpArgs = [
|
|
10
|
-
{
|
|
11
|
-
name: "angle",
|
|
12
|
-
description: "The angle to convert from degrees to radians.",
|
|
13
|
-
},
|
|
14
|
-
];
|
|
15
|
-
}
|
|
16
|
-
validate() {
|
|
17
|
-
if (this.bareArgs.length !== 1) {
|
|
18
|
-
throw new FormulaError("#N/A", "Number of arguments for RADIANS is incorrect.");
|
|
19
|
-
}
|
|
20
|
-
this.bareArgs = this.bareArgs.map((arg) => ensureNumber(arg));
|
|
21
|
-
}
|
|
22
|
-
main(angle) {
|
|
23
|
-
return (angle / 180) * Math.PI;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=radians.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"radians.js","sourceRoot":"","sources":["../../../src/formula/functions/radians.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,MAAM,OAAO,eAAgB,SAAQ,YAAY;IAAjD;;QACE,YAAO,GAAG,cAAc,CAAC;QACzB,aAAQ,GAAG,CAAC,4CAA4C,CAAC,CAAC;QAC1D,aAAQ,GAAG;YACT;gBACE,IAAI,EAAE,OAAO;gBACb,WAAW,EAAE,+CAA+C;aAC7D;SACF,CAAC;IAeJ,CAAC;IAbW,QAAQ;QAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;YAC9B,MAAM,IAAI,YAAY,CACpB,MAAM,EACN,+CAA+C,CAChD,CAAC;SACH;QACD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC;IAChE,CAAC;IAES,IAAI,CAAC,KAAa;QAC1B,OAAO,CAAC,KAAK,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;IACjC,CAAC;CACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rand.d.ts","sourceRoot":"","sources":["../../../src/formula/functions/rand.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,qBAAa,YAAa,SAAQ,YAAY;IAC5C,OAAO,SAAY;IACnB,QAAQ,WAAgD;IACxD,QAAQ,UAAM;IAEd,SAAS,CAAC,QAAQ;IASlB,SAAS,CAAC,IAAI;CAGf"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { FormulaError } from "../evaluator";
|
|
2
|
-
import { BaseFunction } from "./__base";
|
|
3
|
-
export class RandFunction extends BaseFunction {
|
|
4
|
-
constructor() {
|
|
5
|
-
super(...arguments);
|
|
6
|
-
this.example = "RAND()";
|
|
7
|
-
this.helpText = ["Returns a random number between 0 and 1."];
|
|
8
|
-
this.helpArgs = [];
|
|
9
|
-
}
|
|
10
|
-
validate() {
|
|
11
|
-
if (this.bareArgs.length !== 0) {
|
|
12
|
-
throw new FormulaError("#N/A", "Number of arguments for RAND is incorrect.");
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
main() {
|
|
16
|
-
return Math.random();
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=rand.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rand.js","sourceRoot":"","sources":["../../../src/formula/functions/rand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,MAAM,OAAO,YAAa,SAAQ,YAAY;IAA9C;;QACE,YAAO,GAAG,QAAQ,CAAC;QACnB,aAAQ,GAAG,CAAC,0CAA0C,CAAC,CAAC;QACxD,aAAQ,GAAG,EAAE,CAAC;IAchB,CAAC;IAZW,QAAQ;QAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;YAC9B,MAAM,IAAI,YAAY,CACpB,MAAM,EACN,4CAA4C,CAC7C,CAAC;SACH;IACH,CAAC;IAES,IAAI;QACZ,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC;IACvB,CAAC;CACF"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { BaseFunction } from "./__base";
|
|
2
|
-
export declare class RoundFunction extends BaseFunction {
|
|
3
|
-
example: string;
|
|
4
|
-
helpText: string[];
|
|
5
|
-
helpArgs: ({
|
|
6
|
-
name: string;
|
|
7
|
-
description: string;
|
|
8
|
-
optional?: undefined;
|
|
9
|
-
} | {
|
|
10
|
-
name: string;
|
|
11
|
-
description: string;
|
|
12
|
-
optional: boolean;
|
|
13
|
-
})[];
|
|
14
|
-
protected validate(): void;
|
|
15
|
-
protected main(value: number, digit?: number): number;
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=round.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"round.d.ts","sourceRoot":"","sources":["../../../src/formula/functions/round.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAGxC,qBAAa,aAAc,SAAQ,YAAY;IAC7C,OAAO,SAAoB;IAC3B,QAAQ,WAEN;IACF,QAAQ;;;;;;;;SAUN;IAEF,SAAS,CAAC,QAAQ;IAUlB,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,SAAI;CAIxC"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { FormulaError } from "../evaluator";
|
|
2
|
-
import { BaseFunction } from "./__base";
|
|
3
|
-
import { ensureNumber } from "./__utils";
|
|
4
|
-
export class RoundFunction extends BaseFunction {
|
|
5
|
-
constructor() {
|
|
6
|
-
super(...arguments);
|
|
7
|
-
this.example = "ROUND(99.44,1)";
|
|
8
|
-
this.helpText = [
|
|
9
|
-
"Round a number to the specified number of decimal places according to standard rules.",
|
|
10
|
-
];
|
|
11
|
-
this.helpArgs = [
|
|
12
|
-
{
|
|
13
|
-
name: "value",
|
|
14
|
-
description: "A number to be rounded.",
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
name: "digit",
|
|
18
|
-
description: "The number of decimal places after rounding.",
|
|
19
|
-
optional: true,
|
|
20
|
-
},
|
|
21
|
-
];
|
|
22
|
-
}
|
|
23
|
-
validate() {
|
|
24
|
-
if (this.bareArgs.length !== 1 && this.bareArgs.length !== 2) {
|
|
25
|
-
throw new FormulaError("#N/A", "Number of arguments for ROUND is incorrect.");
|
|
26
|
-
}
|
|
27
|
-
this.bareArgs = this.bareArgs.map((arg) => ensureNumber(arg));
|
|
28
|
-
}
|
|
29
|
-
main(value, digit = 0) {
|
|
30
|
-
const multiplier = Math.pow(10, digit);
|
|
31
|
-
return Math.round(value * multiplier) / multiplier;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
//# sourceMappingURL=round.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"round.js","sourceRoot":"","sources":["../../../src/formula/functions/round.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,MAAM,OAAO,aAAc,SAAQ,YAAY;IAA/C;;QACE,YAAO,GAAG,gBAAgB,CAAC;QAC3B,aAAQ,GAAG;YACT,uFAAuF;SACxF,CAAC;QACF,aAAQ,GAAG;YACT;gBACE,IAAI,EAAE,OAAO;gBACb,WAAW,EAAE,yBAAyB;aACvC;YACD;gBACE,IAAI,EAAE,OAAO;gBACb,WAAW,EAAE,8CAA8C;gBAC3D,QAAQ,EAAE,IAAI;aACf;SACF,CAAC;IAgBJ,CAAC;IAdW,QAAQ;QAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;YAC5D,MAAM,IAAI,YAAY,CACpB,MAAM,EACN,6CAA6C,CAC9C,CAAC;SACH;QACD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC;IAChE,CAAC;IAES,IAAI,CAAC,KAAa,EAAE,KAAK,GAAG,CAAC;QACrC,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;QACvC,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,UAAU,CAAC,GAAG,UAAU,CAAC;IACrD,CAAC;CACF"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { BaseFunction } from "./__base";
|
|
2
|
-
export declare class RounddownFunction extends BaseFunction {
|
|
3
|
-
example: string;
|
|
4
|
-
helpText: string[];
|
|
5
|
-
helpArgs: ({
|
|
6
|
-
name: string;
|
|
7
|
-
description: string;
|
|
8
|
-
optional?: undefined;
|
|
9
|
-
} | {
|
|
10
|
-
name: string;
|
|
11
|
-
description: string;
|
|
12
|
-
optional: boolean;
|
|
13
|
-
})[];
|
|
14
|
-
protected validate(): void;
|
|
15
|
-
protected main(value: number, digit?: number): number;
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=rounddown.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rounddown.d.ts","sourceRoot":"","sources":["../../../src/formula/functions/rounddown.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAGxC,qBAAa,iBAAkB,SAAQ,YAAY;IACjD,OAAO,SAAwB;IAC/B,QAAQ,WAEN;IACF,QAAQ;;;;;;;;SAUN;IAEF,SAAS,CAAC,QAAQ;IAUlB,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,SAAI;CAIxC"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { FormulaError } from "../evaluator";
|
|
2
|
-
import { BaseFunction } from "./__base";
|
|
3
|
-
import { ensureNumber } from "./__utils";
|
|
4
|
-
export class RounddownFunction extends BaseFunction {
|
|
5
|
-
constructor() {
|
|
6
|
-
super(...arguments);
|
|
7
|
-
this.example = "ROUNDDOWN(99.44,1)";
|
|
8
|
-
this.helpText = [
|
|
9
|
-
"Round down a number to the specified number of decimal places according to standard rules.",
|
|
10
|
-
];
|
|
11
|
-
this.helpArgs = [
|
|
12
|
-
{
|
|
13
|
-
name: "value",
|
|
14
|
-
description: "A number to be rounded down.",
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
name: "digit",
|
|
18
|
-
description: "The number of decimal places after rounding.",
|
|
19
|
-
optional: true,
|
|
20
|
-
},
|
|
21
|
-
];
|
|
22
|
-
}
|
|
23
|
-
validate() {
|
|
24
|
-
if (this.bareArgs.length !== 1 && this.bareArgs.length !== 2) {
|
|
25
|
-
throw new FormulaError("#N/A", "Number of arguments for ROUNDDOWN is incorrect.");
|
|
26
|
-
}
|
|
27
|
-
this.bareArgs = this.bareArgs.map((arg) => ensureNumber(arg));
|
|
28
|
-
}
|
|
29
|
-
main(value, digit = 0) {
|
|
30
|
-
const multiplier = Math.pow(10, digit);
|
|
31
|
-
return Math.floor(value * multiplier) / multiplier;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
//# sourceMappingURL=rounddown.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rounddown.js","sourceRoot":"","sources":["../../../src/formula/functions/rounddown.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,MAAM,OAAO,iBAAkB,SAAQ,YAAY;IAAnD;;QACE,YAAO,GAAG,oBAAoB,CAAC;QAC/B,aAAQ,GAAG;YACT,4FAA4F;SAC7F,CAAC;QACF,aAAQ,GAAG;YACT;gBACE,IAAI,EAAE,OAAO;gBACb,WAAW,EAAE,8BAA8B;aAC5C;YACD;gBACE,IAAI,EAAE,OAAO;gBACb,WAAW,EAAE,8CAA8C;gBAC3D,QAAQ,EAAE,IAAI;aACf;SACF,CAAC;IAgBJ,CAAC;IAdW,QAAQ;QAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;YAC5D,MAAM,IAAI,YAAY,CACpB,MAAM,EACN,iDAAiD,CAClD,CAAC;SACH;QACD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC;IAChE,CAAC;IAES,IAAI,CAAC,KAAa,EAAE,KAAK,GAAG,CAAC;QACrC,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;QACvC,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,UAAU,CAAC,GAAG,UAAU,CAAC;IACrD,CAAC;CACF"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { BaseFunction } from "./__base";
|
|
2
|
-
export declare class RoundupFunction extends BaseFunction {
|
|
3
|
-
example: string;
|
|
4
|
-
helpText: string[];
|
|
5
|
-
helpArgs: ({
|
|
6
|
-
name: string;
|
|
7
|
-
description: string;
|
|
8
|
-
optional?: undefined;
|
|
9
|
-
} | {
|
|
10
|
-
name: string;
|
|
11
|
-
description: string;
|
|
12
|
-
optional: boolean;
|
|
13
|
-
})[];
|
|
14
|
-
protected validate(): void;
|
|
15
|
-
protected main(value: number, digit?: number): number;
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=roundup.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"roundup.d.ts","sourceRoot":"","sources":["../../../src/formula/functions/roundup.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAGxC,qBAAa,eAAgB,SAAQ,YAAY;IAC/C,OAAO,SAAsB;IAC7B,QAAQ,WAEN;IACF,QAAQ;;;;;;;;SAUN;IAEF,SAAS,CAAC,QAAQ;IAUlB,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,SAAI;CAIxC"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { FormulaError } from "../evaluator";
|
|
2
|
-
import { BaseFunction } from "./__base";
|
|
3
|
-
import { ensureNumber } from "./__utils";
|
|
4
|
-
export class RoundupFunction extends BaseFunction {
|
|
5
|
-
constructor() {
|
|
6
|
-
super(...arguments);
|
|
7
|
-
this.example = "ROUNDUP(99.44,1)";
|
|
8
|
-
this.helpText = [
|
|
9
|
-
"Round up a number to the specified number of decimal places according to standard rules.",
|
|
10
|
-
];
|
|
11
|
-
this.helpArgs = [
|
|
12
|
-
{
|
|
13
|
-
name: "value",
|
|
14
|
-
description: "A number to be rounded up.",
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
name: "digit",
|
|
18
|
-
description: "The number of decimal places after rounding.",
|
|
19
|
-
optional: true,
|
|
20
|
-
},
|
|
21
|
-
];
|
|
22
|
-
}
|
|
23
|
-
validate() {
|
|
24
|
-
if (this.bareArgs.length !== 1 && this.bareArgs.length !== 2) {
|
|
25
|
-
throw new FormulaError("#N/A", "Number of arguments for ROUNDUP is incorrect.");
|
|
26
|
-
}
|
|
27
|
-
this.bareArgs = this.bareArgs.map((arg) => ensureNumber(arg));
|
|
28
|
-
}
|
|
29
|
-
main(value, digit = 0) {
|
|
30
|
-
const multiplier = Math.pow(10, digit);
|
|
31
|
-
return Math.ceil(value * multiplier) / multiplier;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
//# sourceMappingURL=roundup.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"roundup.js","sourceRoot":"","sources":["../../../src/formula/functions/roundup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,MAAM,OAAO,eAAgB,SAAQ,YAAY;IAAjD;;QACE,YAAO,GAAG,kBAAkB,CAAC;QAC7B,aAAQ,GAAG;YACT,0FAA0F;SAC3F,CAAC;QACF,aAAQ,GAAG;YACT;gBACE,IAAI,EAAE,OAAO;gBACb,WAAW,EAAE,4BAA4B;aAC1C;YACD;gBACE,IAAI,EAAE,OAAO;gBACb,WAAW,EAAE,8CAA8C;gBAC3D,QAAQ,EAAE,IAAI;aACf;SACF,CAAC;IAgBJ,CAAC;IAdW,QAAQ;QAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;YAC5D,MAAM,IAAI,YAAY,CACpB,MAAM,EACN,+CAA+C,CAChD,CAAC;SACH;QACD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC;IAChE,CAAC;IAES,IAAI,CAAC,KAAa,EAAE,KAAK,GAAG,CAAC;QACrC,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;QACvC,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,UAAU,CAAC,GAAG,UAAU,CAAC;IACpD,CAAC;CACF"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Table } from "../../lib/table";
|
|
2
|
-
import { BaseFunction } from "./__base";
|
|
3
|
-
export declare class RowFunction extends BaseFunction {
|
|
4
|
-
example: string;
|
|
5
|
-
helpText: string[];
|
|
6
|
-
helpArgs: {
|
|
7
|
-
name: string;
|
|
8
|
-
description: string;
|
|
9
|
-
option: boolean;
|
|
10
|
-
}[];
|
|
11
|
-
protected validate(): void;
|
|
12
|
-
protected main(trimmed: Table): number;
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=row.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"row.d.ts","sourceRoot":"","sources":["../../../src/formula/functions/row.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAExC,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,qBAAa,WAAY,SAAQ,YAAY;IAC3C,OAAO,SAAa;IACpB,QAAQ,WAAmD;IAC3D,QAAQ;;;;QAMN;IAEF,SAAS,CAAC,QAAQ;IAYlB,SAAS,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK;CAG9B"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { FormulaError } from "../evaluator";
|
|
2
|
-
import { BaseFunction } from "./__base";
|
|
3
|
-
export class RowFunction extends BaseFunction {
|
|
4
|
-
constructor() {
|
|
5
|
-
super(...arguments);
|
|
6
|
-
this.example = "ROW(A9)";
|
|
7
|
-
this.helpText = ["Returns the row number of a specified cell."];
|
|
8
|
-
this.helpArgs = [
|
|
9
|
-
{
|
|
10
|
-
name: "cell_reference",
|
|
11
|
-
description: "The cell whose row number will be returned.",
|
|
12
|
-
option: true,
|
|
13
|
-
},
|
|
14
|
-
];
|
|
15
|
-
}
|
|
16
|
-
validate() {
|
|
17
|
-
if (this.bareArgs.length === 0) {
|
|
18
|
-
this.bareArgs = [this.table];
|
|
19
|
-
}
|
|
20
|
-
else if (this.bareArgs.length === 1) {
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
throw new FormulaError("#N/A", "Number of arguments for ROW is incorrect.");
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
main(trimmed) {
|
|
27
|
-
return trimmed.top;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
//# sourceMappingURL=row.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"row.js","sourceRoot":"","sources":["../../../src/formula/functions/row.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,MAAM,OAAO,WAAY,SAAQ,YAAY;IAA7C;;QACE,YAAO,GAAG,SAAS,CAAC;QACpB,aAAQ,GAAG,CAAC,6CAA6C,CAAC,CAAC;QAC3D,aAAQ,GAAG;YACT;gBACE,IAAI,EAAE,gBAAgB;gBACtB,WAAW,EAAE,6CAA6C;gBAC1D,MAAM,EAAE,IAAI;aACb;SACF,CAAC;IAiBJ,CAAC;IAfW,QAAQ;QAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;YAC9B,IAAI,CAAC,QAAQ,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SAC9B;aAAM,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;SACtC;aAAM;YACL,MAAM,IAAI,YAAY,CACpB,MAAM,EACN,2CAA2C,CAC5C,CAAC;SACH;IACH,CAAC;IAES,IAAI,CAAC,OAAc;QAC3B,OAAO,OAAO,CAAC,GAAG,CAAC;IACrB,CAAC;CACF"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { BaseFunction } from "./__base";
|
|
2
|
-
export declare class SinFunction extends BaseFunction {
|
|
3
|
-
example: string;
|
|
4
|
-
helpText: string[];
|
|
5
|
-
helpArgs: {
|
|
6
|
-
name: string;
|
|
7
|
-
description: string;
|
|
8
|
-
}[];
|
|
9
|
-
protected validate(): void;
|
|
10
|
-
protected main(angle: number): number;
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=sin.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sin.d.ts","sourceRoot":"","sources":["../../../src/formula/functions/sin.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAGxC,qBAAa,WAAY,SAAQ,YAAY;IAC3C,OAAO,SAAiB;IACxB,QAAQ,WAA0D;IAClE,QAAQ;;;QAKN;IAEF,SAAS,CAAC,QAAQ;IAUlB,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM;CAG7B"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { FormulaError } from "../evaluator";
|
|
2
|
-
import { BaseFunction } from "./__base";
|
|
3
|
-
import { ensureNumber } from "./__utils";
|
|
4
|
-
export class SinFunction extends BaseFunction {
|
|
5
|
-
constructor() {
|
|
6
|
-
super(...arguments);
|
|
7
|
-
this.example = "SIN(PI()/2)";
|
|
8
|
-
this.helpText = ["Returns the sin of the angle specified in radians."];
|
|
9
|
-
this.helpArgs = [
|
|
10
|
-
{
|
|
11
|
-
name: "angle",
|
|
12
|
-
description: "An angle in radians, at which you want the sin.",
|
|
13
|
-
},
|
|
14
|
-
];
|
|
15
|
-
}
|
|
16
|
-
validate() {
|
|
17
|
-
if (this.bareArgs.length !== 1) {
|
|
18
|
-
throw new FormulaError("#N/A", "Number of arguments for SIN is incorrect.");
|
|
19
|
-
}
|
|
20
|
-
this.bareArgs = this.bareArgs.map((arg) => ensureNumber(arg));
|
|
21
|
-
}
|
|
22
|
-
main(angle) {
|
|
23
|
-
return Math.sin(angle);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=sin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sin.js","sourceRoot":"","sources":["../../../src/formula/functions/sin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,MAAM,OAAO,WAAY,SAAQ,YAAY;IAA7C;;QACE,YAAO,GAAG,aAAa,CAAC;QACxB,aAAQ,GAAG,CAAC,oDAAoD,CAAC,CAAC;QAClE,aAAQ,GAAG;YACT;gBACE,IAAI,EAAE,OAAO;gBACb,WAAW,EAAE,iDAAiD;aAC/D;SACF,CAAC;IAeJ,CAAC;IAbW,QAAQ;QAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;YAC9B,MAAM,IAAI,YAAY,CACpB,MAAM,EACN,2CAA2C,CAC5C,CAAC;SACH;QACD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC;IAChE,CAAC;IAES,IAAI,CAAC,KAAa;QAC1B,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACzB,CAAC;CACF"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { BaseFunction } from "./__base";
|
|
2
|
-
export declare class SqrtFunction extends BaseFunction {
|
|
3
|
-
example: string;
|
|
4
|
-
helpText: string[];
|
|
5
|
-
helpArgs: {
|
|
6
|
-
name: string;
|
|
7
|
-
description: string;
|
|
8
|
-
}[];
|
|
9
|
-
protected validate(): void;
|
|
10
|
-
protected main(value: number): number;
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=sqrt.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sqrt.d.ts","sourceRoot":"","sources":["../../../src/formula/functions/sqrt.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAGxC,qBAAa,YAAa,SAAQ,YAAY;IAC5C,OAAO,SAAa;IACpB,QAAQ,WAA8D;IACtE,QAAQ;;;QAMN;IAEF,SAAS,CAAC,QAAQ;IAalB,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM;CAG7B"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { FormulaError } from "../evaluator";
|
|
2
|
-
import { BaseFunction } from "./__base";
|
|
3
|
-
import { ensureNumber } from "./__utils";
|
|
4
|
-
export class SqrtFunction extends BaseFunction {
|
|
5
|
-
constructor() {
|
|
6
|
-
super(...arguments);
|
|
7
|
-
this.example = "SQRT(9)";
|
|
8
|
-
this.helpText = ["Returns the positive square root of a positive number."];
|
|
9
|
-
this.helpArgs = [
|
|
10
|
-
{
|
|
11
|
-
name: "value",
|
|
12
|
-
description: "A number for which the positive square root is to be found.",
|
|
13
|
-
},
|
|
14
|
-
];
|
|
15
|
-
}
|
|
16
|
-
validate() {
|
|
17
|
-
if (this.bareArgs.length !== 1) {
|
|
18
|
-
throw new FormulaError("#N/A", "Number of arguments for SQRT is incorrect.");
|
|
19
|
-
}
|
|
20
|
-
this.bareArgs = this.bareArgs.map((arg) => ensureNumber(arg));
|
|
21
|
-
if (this.bareArgs[0] < 0) {
|
|
22
|
-
throw new FormulaError("NUM!", "First argument must be positive.");
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
main(value) {
|
|
26
|
-
return Math.sqrt(value);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
//# sourceMappingURL=sqrt.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sqrt.js","sourceRoot":"","sources":["../../../src/formula/functions/sqrt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,MAAM,OAAO,YAAa,SAAQ,YAAY;IAA9C;;QACE,YAAO,GAAG,SAAS,CAAC;QACpB,aAAQ,GAAG,CAAC,wDAAwD,CAAC,CAAC;QACtE,aAAQ,GAAG;YACT;gBACE,IAAI,EAAE,OAAO;gBACb,WAAW,EACT,6DAA6D;aAChE;SACF,CAAC;IAkBJ,CAAC;IAhBW,QAAQ;QAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;YAC9B,MAAM,IAAI,YAAY,CACpB,MAAM,EACN,4CAA4C,CAC7C,CAAC;SACH;QACD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC;QAC9D,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE;YACxB,MAAM,IAAI,YAAY,CAAC,MAAM,EAAE,kCAAkC,CAAC,CAAC;SACpE;IACH,CAAC;IAES,IAAI,CAAC,KAAa;QAC1B,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC;CACF"}
|