JSPM

@japont/unicode-range

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 65877
  • Score
    100M100P100Q180887F
  • License MIT

Unicode-range parser/builder.

Package Exports

  • @japont/unicode-range

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 (@japont/unicode-range) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@japont/unicode-range

NPM-Badge CircleCI-Badge Codecov-Badge

Unicode-range parser/builder.

Install

npm i @japont/unicode-range
# - OR -
yarn add @japont/unicode-range

Usage

import { UnicodeRange } from '@japont/unicode-range';

// Parse ( e.g. U+30-39 -> [30, 31, ..., 39] )
const HiraganaUnicodeRangeList = ['U+3041-3096', 'U+3099-309F'];
const HiraganaCodePointList = UnicodeRange.parse(HiraganaUnicodeRangeList);
const Hiragana = HiraganaCodePointList.map(cp => String.fromCodePoint(cp)));
console.log(Hiragana);

// Stringify ( e.g. [30, 31, ..., 39] -> U+30-39 )
const Digit = '0123456789';
const DigitCodePointList = Digit.split('').map(c => c.codePointAt(0));
const DigitUnicodeRangeList = UnicodeRange.stringify(DigitCodePointList);
console.log(NumericUnicodeRangeList);

Contribute

PRs accepted.

License

MIT (c) 3846masa