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

Commit 4965d4b

Browse files
committed
Merge branch 'master' of github.com:fknop/angular-pipes
2 parents 68c16ea + 181dd8b commit 4965d4b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Read the [contributing guidelines](./CONTRIBUTING.md)
1919

2020
## Pipes
2121

22-
You can find the documentations in the [`docs`](./docs) folder.
22+
You can find the documentations in the [`docs`](./docs) folder or on [`GitBook`](https://fknop.gitbooks.io/angular-pipes/).
2323

2424
### Collections (array)
2525

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)