(other: Volume)
| 23 | } |
| 24 | |
| 25 | equals(other: Volume): boolean { |
| 26 | if (this.unit === other.unit) { |
| 27 | return this.amount === other.amount; |
| 28 | } else if (this.unit === 'L' && other.unit === 'mL') { |
| 29 | return this.amount * 1000 === other.amount; |
| 30 | } else { |
| 31 | return this.amount === other.amount * 1000; |
| 32 | } |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | function createVolume(amount: number, unit: 'L' | 'mL' = 'L') { |
no outgoing calls
no test coverage detected