Socket
Socket
Sign inDemoInstall

pretty-bytes

Package Overview
Dependencies
0
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 5.1.0 to 5.2.0

index.d.ts

1

index.js

@@ -56,2 +56,3 @@ 'use strict';

const exponent = Math.min(Math.floor(Math.log10(number) / 3), UNITS.length - 1);
// eslint-disable-next-line unicorn/prefer-exponentiation-operator
number = Number((number / Math.pow(1000, exponent)).toPrecision(3));

@@ -58,0 +59,0 @@ const numberString = toLocaleString(number, options.locale);

12

package.json
{
"name": "pretty-bytes",
"version": "5.1.0",
"version": "5.2.0",
"description": "Convert bytes to a human readable string: 1337 → 1.34 kB",

@@ -16,6 +16,7 @@ "license": "MIT",

"scripts": {
"test": "xo && NODE_ICU_DATA=node_modules/full-icu ava"
"test": "xo && NODE_ICU_DATA=node_modules/full-icu ava && tsd"
},
"files": [
"index.js"
"index.js",
"index.d.ts"
],

@@ -39,6 +40,7 @@ "keywords": [

"devDependencies": {
"ava": "*",
"ava": "^1.4.1",
"full-icu": "^1.2.1",
"xo": "*"
"tsd": "^0.7.2",
"xo": "^0.24.0"
}
}

@@ -41,5 +41,5 @@ # pretty-bytes [![Build Status](https://travis-ci.org/sindresorhus/pretty-bytes.svg?branch=master)](https://travis-ci.org/sindresorhus/pretty-bytes)

### prettyBytes(input, [options])
### prettyBytes(number, [options])
#### input
#### number

@@ -52,3 +52,3 @@ Type: `number`

Type: `Object`
Type: `object`

@@ -55,0 +55,0 @@ ##### signed

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc