@extra-string/to-baseline
v1.1.3
Published
Convert string to baseline characters, limited support.
Downloads
22
Maintainers
Readme
Convert string to baseline characters, limited support.
Only the following characters can be baselined:
⁰¹²³⁴⁵⁶⁷⁸⁹⁺⁻⁼⁽⁾₀₁₂₃₄₅₆₇₈₉₊₋₌₍₎ₔᵝᵞᵟᶿᶥᵠᵡᵦᵧᵨᵩᵪ
ᴬᴮᴰᴱᴳᴴᴵᴶᴷᴸᴹᴺᴼᴾᴿᵀᵁⱽᵂᶦᶫᶰᶸᵃᵇᶜᵈᵉᶠᵍʰⁱʲᵏˡᵐⁿᵒᵖʳˢᵗᵘᵛʷˣʸᶻₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓ
const toBaseLine = require('@extra-string/to-baseline');
// toBaseLine(<string>, [superseparator], [subseparator])
toBaseLine('ax²+bx+c');
// 'ax2+bx+c'
toBaseLine('H₂SO₄ beaker');
// 'H2SO4 beaker'
toBaseLine('6.626 x 10⁻³⁴', ['^']);
// '6.626 x 10^-34'
toBaseLine('1010₂', null, [' (base-', ')']);
// '1010 (base-2)'