Skip to content

Commit

Permalink
Meta tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Dec 23, 2020
1 parent c7ea91a commit aaf85b3
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 9 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: CI
on:
- push
- pull_request
jobs:
test:
name: Node.js ${{ matrix.node-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version:
- 14
- 12
- 10
- 8
- 6
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm test
7 changes: 0 additions & 7 deletions .travis.yml

This file was deleted.

2 changes: 2 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ declare namespace prettyBytes {
@default false
@example
```
import prettyBytes = require('pretty-bytes');
Expand All @@ -38,6 +39,7 @@ declare namespace prettyBytes {
@default false
@example
```
import prettyBytes = require('pretty-bytes');
Expand Down
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,13 @@ module.exports = (number, options) => {
}

options = Object.assign({bits: false, binary: false}, options);

const UNITS = options.bits ?
(options.binary ? BIBIT_UNITS : BIT_UNITS) :
(options.binary ? BIBYTE_UNITS : BYTE_UNITS);

if (options.signed && number === 0) {
return ' 0 ' + UNITS[0];
return ` 0 ${UNITS[0]}`;
}

const isNegative = number < 0;
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# pretty-bytes [![Build Status](https://travis-ci.com/sindresorhus/pretty-bytes.svg?branch=master)](https://travis-ci.com/github/sindresorhus/pretty-bytes)
# pretty-bytes

> Convert bytes to a human readable string: `1337``1.34 kB`
Expand Down

0 comments on commit aaf85b3

Please sign in to comment.