kopia lustrzana https://github.com/badgen/badgen
Dependencies are good, eat it
rodzic
f0294bfbcf
commit
e2a18184da
|
@ -2,12 +2,13 @@
|
|||
|
||||
[![npm-version][npm-badge]][npm-link]
|
||||
[![install size][pp-badge]][pp-link]
|
||||
[![Coverage Status][cr-badge]](cr-link)
|
||||
[![Coverage Status][cr-badge]][cr-link]
|
||||
|
||||
Fast, handcraft, pure JavaScript badge generator.
|
||||
|
||||
- ⚡️ Fast (see [benchmarks](#benchmarks))
|
||||
- 🌀 Zero dependency (compare with 11 deps for [gh-badges][gh-badges-link] which being used on [shields.io][shields-io])
|
||||
- 🌀 1 dependency ([unicode-astral-regex][uar-link])
|
||||
- ⚡️ Fast by design (see [benchmarks](#benchmarks))
|
||||
- 👯 Pure JavaScript, running in node & browser
|
||||
|
||||
## Usage
|
||||
|
||||
|
@ -63,5 +64,6 @@ https://badgen.now.sh/
|
|||
[pp-link]: https://packagephobia.now.sh/result?p=badgen
|
||||
[cr-badge]: https://coveralls.io/repos/github/amio/badgen/badge.svg?branch=master
|
||||
[cr-link]: https://coveralls.io/github/amio/badgen?branch=master
|
||||
[uar-link]: https://www.npmjs.com/package/unicode-astral-regex
|
||||
[shields-io]: https://shields.io
|
||||
[gh-badges-link]: https://www.npmjs.com/package/gh-badges
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
const widthsVerdana11 = require('./widths-verdana-11.json')
|
||||
const astralRegex = require('./unicode-astral-regex.js')
|
||||
const astralRegex = require('unicode-astral-regex')
|
||||
|
||||
function calcWidth (charWidthTable) {
|
||||
const SCALE = 10 // Prevent results like 60.599999999999994
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
// Borrowed from:
|
||||
// https://github.com/lodash/lodash/blob/master/lodash.js
|
||||
// https://github.com/mathiasbynens/regenerate
|
||||
// https://mathiasbynens.be/notes/javascript-unicode
|
||||
// https://github.com/sallar/unicode-astral-regex
|
||||
module.exports = /\ud83c[\udffb-\udfff](?=\ud83c[\udffb-\udfff])|(?:[^\ud800-\udfff][\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0]?|[\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0]|\ud83c[\udffb-\udfff])?)*/g
|
|
@ -4974,6 +4974,11 @@
|
|||
"integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=",
|
||||
"dev": true
|
||||
},
|
||||
"unicode-astral-regex": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/unicode-astral-regex/-/unicode-astral-regex-1.0.1.tgz",
|
||||
"integrity": "sha512-UP6cmDeiWi8bMDmkyXLRsDuVPTvPjh8Wsz+pHu1VkGgTBl4pUceYAdHXY0cdc6Q3+Z2q7QMzi/0E7L/S/yOvFw=="
|
||||
},
|
||||
"unicode-length": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/unicode-length/-/unicode-length-1.0.3.tgz",
|
||||
|
|
|
@ -19,5 +19,8 @@
|
|||
"serve-marked": "0.2.0",
|
||||
"standard": "^11.0.1",
|
||||
"tap": "^12.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"unicode-astral-regex": "^1.0.1"
|
||||
}
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue