Package Exports
- @spare/regex-charset
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@spare/regex-charset) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@spare/regex-charset
A function returning string length, s.t. skipping ansi (escape) codes, correcting length of astral symbols.
Features
- ES2015 syntax
Install
$ npm install @spare/regex-charsetUsage
import { lange } from '@spare/regex-charset'
const list = [
'tolstoy',
'\u001b[3;4;31mhatsu\u001b[0m',
'\u{1F3C3}2\u{1F525}7',
]
for (let tx of list) {
console.log(`[${tx}] [length] (${tx.length}) [lange] (${lange(tx)})`)
}Meta
Copyright (c) 2019-present, Haoyang (Vincent) Wang