Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@tsmx/human-readable

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tsmx/human-readable - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

.github/workflows/git-build.yml

14

human-readable.js

@@ -47,3 +47,3 @@ var sizes = new Map();

yield* [...this.entries()].sort((a, b) => b[1].index - a[1].index);
}
};

@@ -56,3 +56,3 @@ const factorDecimal = 1000;

function countDecimals(value) {
return value % 1 ? value.toString().split(".")[1].length : 0;
return value % 1 ? value.toString().split('.')[1].length : 0;
}

@@ -90,3 +90,3 @@

let factor = iecMode ? factorIEC : factorDecimal;
for (let [key, value] of sizes) {
for (let [, value] of sizes) {
if (bytes >= Math.pow(factor, value.index)) {

@@ -105,3 +105,3 @@ resultValue = bytes / Math.pow(factor, value.index);

if (!(options && options.fullPrecision === true)) {
if (options && options.hasOwnProperty('fixedPrecision')) {
if (options && Object.prototype.hasOwnProperty.call(options, 'fixedPrecision')) {
let precision = parseInt(options.fixedPrecision);

@@ -135,3 +135,3 @@ if (!isNaN(precision)) {

return postProcessResult(val, unit, options);
}
};

@@ -143,6 +143,6 @@ module.exports.fromTo = function (value, fromSize, toSize, options) {

return postProcessResult(val, unit, options);
}
};
module.exports.availableSizes = function () {
return availableSizes;
}
};
{
"name": "@tsmx/human-readable",
"version": "1.0.4",
"version": "1.0.5",
"description": "Easily create human-readable strings from byte sizes, e.g. 17238 --> 17.24 kB. Supports decimal (MB,GB,..) and binary (MiB, GiB,..) units as well as user-defined conversion from/to other sizes.",

@@ -5,0 +5,0 @@ "main": "human-readable.js",

@@ -6,3 +6,3 @@ # [**@tsmx/human-readable**](https://github.com/tsmx/human-readable)

![node-current (scoped)](https://img.shields.io/node/v/@tsmx/human-readable)
[![Build Status](https://travis-ci.com/tsmx/human-readable.svg?branch=master)](https://travis-ci.org/tsmx/human-readable)
[![Build Status](https://img.shields.io/github/workflow/status/tsmx/human-readable/git-ci-build)](https://img.shields.io/github/workflow/status/tsmx/human-readable/git-ci-build)
[![Coverage Status](https://coveralls.io/repos/github/tsmx/human-readable/badge.svg?branch=master)](https://coveralls.io/github/tsmx/human-readable?branch=master)

@@ -9,0 +9,0 @@

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc