@tsmx/human-readable
Advanced tools
Comparing version 1.0.9 to 2.0.0
@@ -5,3 +5,4 @@ { | ||
"commonjs": true, | ||
"es6": true | ||
"es6": true, | ||
"jest": true | ||
}, | ||
@@ -8,0 +9,0 @@ "extends": "eslint:recommended", |
@@ -14,3 +14,3 @@ declare module "@tsmx/human-readable"; | ||
export function calcFromTo( | ||
export function fromTo( | ||
bytes: number, | ||
@@ -17,0 +17,0 @@ fromSize: HRSizeType, |
{ | ||
"name": "@tsmx/human-readable", | ||
"version": "1.0.9", | ||
"version": "2.0.0", | ||
"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.", | ||
@@ -35,3 +35,4 @@ "main": "human-readable.js", | ||
"devDependencies": { | ||
"jest": "^27.2.0", | ||
"eslint": "^8.41.0", | ||
"jest": "^29.5.0", | ||
"tsd": "^0.21.0" | ||
@@ -38,0 +39,0 @@ }, |
@@ -65,3 +65,3 @@ describe('human-readable conversion test suite for decimal and IEC units', () => { | ||
const hr = require('../human-readable'); | ||
sizes = hr.availableSizes(); | ||
const sizes = hr.availableSizes(); | ||
expect(Array.isArray(sizes)).toBeTruthy(); | ||
@@ -68,0 +68,0 @@ expect(sizes.length).toBe(6); |
import { expectType } from 'tsd'; | ||
import { availableSizes, fromBytes, calcFromTo, HROptionsType } from '../human-readable'; | ||
import { availableSizes, fromBytes, fromTo, HROptionsType } from '../human-readable'; | ||
@@ -13,2 +13,2 @@ const testOptions: HROptionsType = { | ||
expectType<string>(calcFromTo(1024, 'KBYTE', 'MBYTE', undefined)); | ||
expectType<string>(fromTo(1024, 'KBYTE', 'MBYTE', undefined)); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19535
316
3