kopia lustrzana https://github.com/badgen/badgen
perf: Remove dependency and improve performance (#11)
rodzic
9b41a3b570
commit
80a2f3b38a
|
@ -1,5 +1,4 @@
|
|||
const widthsVerdana11 = require('./widths-verdana-11.json')
|
||||
const astralRegex = require('unicode-astral-regex')
|
||||
|
||||
const SCALE = 10 // Prevent results like 60.599999999999994
|
||||
|
||||
|
@ -8,7 +7,7 @@ const calcWidth = (charWidthTable) => {
|
|||
widthTable[64] = widthTable[64] + 6 // Slightly increase width of "@" by 0.6px
|
||||
|
||||
return (text, astral) => {
|
||||
if (astral) text = text.match(astralRegex) || []
|
||||
if (astral) text = [...text]
|
||||
|
||||
let total = 0
|
||||
let code = 0
|
||||
|
|
Plik diff jest za duży
Load Diff
|
@ -20,7 +20,5 @@
|
|||
"standard": "^11.0.1",
|
||||
"tap": "^12.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"unicode-astral-regex": "^1.0.1"
|
||||
}
|
||||
"dependencies": {}
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue