hardhat-contract-sizer
Advanced tools
Comparing version 2.5.1 to 2.6.1
{ | ||
"name": "hardhat-contract-sizer", | ||
"version": "2.5.1", | ||
"version": "2.6.1", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "description": "Output Solidity contract sizes with Hardhat", |
@@ -13,3 +13,3 @@ const fs = require('fs'); | ||
const formatSize = function (size) { | ||
return (size / 1000).toFixed(3); | ||
return (size / 1024).toFixed(3); | ||
}; | ||
@@ -74,3 +74,3 @@ | ||
const table = new Table({ | ||
head: [chalk.bold('Contract Name'), chalk.bold('Size (KB)'), chalk.bold('Change (KB)')], | ||
head: [chalk.bold('Contract Name'), chalk.bold('Size (KiB)'), chalk.bold('Change (KiB)')], | ||
style: { head: [], border: [], 'padding-left': 2, 'padding-right': 2 }, | ||
@@ -111,11 +111,10 @@ chars: { | ||
let diff = ''; | ||
let diff; | ||
if (item.size < item.previousSize) { | ||
diff = chalk.green(`-${ formatSize(item.previousSize - item.size) }`); | ||
} else if (item.size > item.previousSize) { | ||
diff = chalk.red(`+${ formatSize(item.size - item.previousSize) }`); | ||
} else { | ||
diff = ''; | ||
if (item.previousSize) { | ||
if (item.size < item.previousSize) { | ||
diff = chalk.green(`-${ formatSize(item.previousSize - item.size) }`); | ||
} else if (item.size > item.previousSize) { | ||
diff = chalk.red(`+${ formatSize(item.size - item.previousSize) }`); | ||
} | ||
} | ||
@@ -122,0 +121,0 @@ |
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
9317