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

Commit

Permalink
Merge c4556c3 into b2f5d37
Browse files Browse the repository at this point in the history
  • Loading branch information
samvloeberghs committed Apr 3, 2019
2 parents b2f5d37 + c4556c3 commit 7079017
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/math/bytes.pipe.ts
Expand Up @@ -44,12 +44,14 @@ export class BytesPipe implements PipeTransform {
}

for (const key in BytesPipe.formats) {
const format = BytesPipe.formats[key];
if (bytes < format.max) {
if (BytesPipe.formats.hasOwnProperty(key)) {
const format = BytesPipe.formats[key];
if (bytes < format.max) {

const result = toDecimal(BytesPipe.calculateResult(format, bytes), decimal);
const result = toDecimal(BytesPipe.calculateResult(format, bytes), decimal);

return BytesPipe.formatResult(result, key);
return BytesPipe.formatResult(result, key);
}
}
}
}
Expand All @@ -62,4 +64,4 @@ export class BytesPipe implements PipeTransform {
const prev = format.prev ? BytesPipe.formats[format.prev] : undefined;
return prev ? bytes / prev.max : bytes;
}
}
}

0 comments on commit 7079017

Please sign in to comment.