Skip to content
This repository was archived by the owner on Feb 23, 2023. It is now read-only.

Commit 181dd8b

Browse files
DavidBanksNZfknop
authored andcommitted
Make angular-pipes work with strict null checks enabled (#53)
* Make angular-pipes work with strictNullChecks * Make angular-pipes work with strictNullChecks
1 parent 33ed455 commit 181dd8b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/math/bytes.pipe.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,16 @@ export class BytesPipe implements PipeTransform {
3131

3232
let bytes = input;
3333
let unit = from;
34-
while (unit != 'B') {
34+
while (unit !== 'B') {
3535
bytes *= 1024;
36-
unit = BytesPipe.formats[unit].prev;
36+
unit = BytesPipe.formats[unit].prev!;
3737
}
3838

3939
for (const key in BytesPipe.formats) {
4040
const format = BytesPipe.formats[key];
4141
if (bytes < format.max) {
4242

43-
const prev = BytesPipe.formats[format.prev];
43+
const prev = format.prev ? BytesPipe.formats[format.prev] : undefined;
4444

4545
const result = prev ?
4646
toDecimal(bytes / prev.max, decimal) :

0 commit comments

Comments
 (0)