Skip to content

Commit 766f57e

Browse files
authored
Add useful toString()s for CalculationValues (#421)
See #419
1 parent a9fe912 commit 766f57e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/src/value/calculations.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,10 @@ export class CalculationOperation implements ValueObject {
126126
hashCode(): number {
127127
return hash(this.operator) ^ hash(this.left) ^ hash(this.right);
128128
}
129+
130+
toString(): string {
131+
return `${this.left} ${this.operator} ${this.right}`;
132+
}
129133
}
130134

131135
export class CalculationInterpolation implements ValueObject {
@@ -140,4 +144,8 @@ export class CalculationInterpolation implements ValueObject {
140144
hashCode(): number {
141145
return hash(this.value);
142146
}
147+
148+
toString(): string {
149+
return `#{${this.value}}`;
150+
}
143151
}

0 commit comments

Comments
 (0)