Socket
Socket
Sign inDemoInstall

badgen

Package Overview
Dependencies
Maintainers
1
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

badgen - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

.travis.yml

11

lib/calc-text-width.js

@@ -13,5 +13,10 @@ // Generate on https://codesandbox.io/s/lr4ynm652m

} else {
return Array.from(text).reduce((total, curr) => {
return total + (widthTable[curr.charCodeAt()] || widthTable[64]) // "@"
}, 0)
let total = 0
let i = text.length
let charCode = 0
while (i--) {
charCode = text[i].charCodeAt()
total += widthTable[charCode < 127 ? charCode : 64] // "@" for overflows
}
return total
}

@@ -18,0 +23,0 @@ }

{
"name": "badgen",
"version": "0.2.1",
"version": "0.2.2",
"description": "Hand-crafted badge generator.",

@@ -5,0 +5,0 @@ "author": "Amio <amio.cn@gmail.com>",

@@ -5,4 +5,4 @@ # badgen [![npm-version][npm-badge]][npm-link] [![install size][pp-badge]][pp-link]

- 🌀 No dependeny.
- ⚡️ 200K+ ops on average. (see [benchamrks](#Benchmarks))
- 🌀 Zero dependeny
- ⚡️ Fast (see [benchamrks](#benchmarks))

@@ -34,5 +34,5 @@ ## Usage

```bash
generate by short params x 420,831 ops/sec ±1.03% (87 runs sampled)
generate by long params x 167,862 ops/sec ±1.21% (90 runs sampled)
generate by full params x 245,303 ops/sec ±1.48% (92 runs sampled)
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)
```

@@ -42,3 +42,3 @@

ISC @ Amio
![ISC](https://badgen.now.sh/badge/license/ISC/blue)

@@ -45,0 +45,0 @@ [npm-badge]: https://img.shields.io/npm/v/badgen.svg

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