diff --git a/README.md b/README.md index 72b5a16..17a8a48 100644 --- a/README.md +++ b/README.md @@ -42,9 +42,9 @@ https://badgen.now.sh/ `npm run bench` on my iMac5K(Late 2014), 3.5G i5, with Node.js 10.5.0: ```bash -generate by short params x 543,857 ops/sec ±0.98% (90 runs sampled) -generate by long params x 512,747 ops/sec ±0.66% (91 runs sampled) -generate by full params x 461,409 ops/sec ±0.78% (90 runs sampled) +generate by short params x 717,411 ops/sec ±0.79% (89 runs sampled) +generate by long params x 692,485 ops/sec ±0.87% (93 runs sampled) +generate by full params x 613,054 ops/sec ±0.97% (92 runs sampled) ``` ## License diff --git a/lib/index.js b/lib/index.js index 542e572..a523cdb 100644 --- a/lib/index.js +++ b/lib/index.js @@ -6,17 +6,15 @@ module.exports = function ({subject, status, color}) { const sbTextWidth = calcWidth(subject) const sbRectWidth = sbTextWidth + 10 - const sbTextCenter = sbRectWidth / 2 const stTextWidth = calcWidth(status) - const stRectWidth = stTextWidth + 12 - const stTextCenter = sbRectWidth + stRectWidth / 2 - 1 + const stRectWidth = stTextWidth + 13 + const stTextStart = sbTextWidth + 16 const width = sbRectWidth + stRectWidth return ` - + @@ -25,12 +23,12 @@ module.exports = function ({subject, status, color}) { - - ${subject} - ${subject} - ${status} - ${status} - + + ${subject} + ${subject} + ${status} + ${status} + ` }