f7
f7 is a spreadsheet formula execution library
git clone https://git.vogt.world/f7.git
Log | Files | README.md | LICENSE.md
← All files
name: src/main/js/models/nodes/FormulaNode.ts
-rw-r--r--
565
 1import { Node } from "./Node";
 2import { NodeType } from "./NodeType";
 3
 4/**
 5 * A formula node is a named formula with 0 or more arguments that are other nodes.
 6 */
 7export class FormulaNode extends Object implements Node {
 8  readonly type: NodeType = NodeType.Formula;
 9  readonly name: string;
10  readonly values: Array<Node>;
11
12  constructor(name: string, values?: Array<Node>) {
13    super();
14    this.name = name;
15    this.values = values ? values : [];
16  }
17
18  toString() {
19    return `${this.name}(${this.values.map((value) => value.toString()).join(", ")})`;
20  }
21}