Socket
Socket
Sign inDemoInstall

@react-pdf/unicode-properties

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@react-pdf/unicode-properties

Provides fast access to unicode character properties


Version published
Maintainers
1
Created
Source

@react-pdf/unicode-properties

Provides fast access to unicode character properties. Uses unicode-trie to compress the properties for all code points into just 12KB.

Acknowledges

This project is a fork of unicode-properties by @devongovett and continued under the scope of this project since it has react-pdf specific features. Any recongnition should go to him and the original project mantainers.

Fork changes

Updated at a7df933c4fe5ddca2cb9829a5634e6fe9f1ac529

  • Trie data parsed as JSON in order to run it both on node and browser easily
  • Written in ES6

Usage

npm install unicode-properties
var unicode = require('unicode-properties');

unicode.getCategory('2'.charCodeAt()) //=> 'Nd'
unicode.getNumericValue('2'.charCodeAt()) //=> 2

API

getCategory(codePoint)

Returns the unicode general category for the given code point.

getScript(codePoint)

Returns the script for the given code point.

getCombiningClass(codePoint)

Returns the canonical combining class for the given code point.

getEastAsianWidth(codePoint)

Returns the East Asian width for the given code point.

getNumericValue(codePoint)

Returns the numeric value for the given code point, or null if there is no numeric value for that code point.

isAlphabetic(codePoint)

Returns whether the code point is an alphabetic character.

isDigit(codePoint)

Returns whether the code point is a digit.

isPunctuation(codePoint)

Returns whether the code point is a punctuation character.

isLowerCase(codePoint)

Returns whether the code point is lower case.

isUpperCase(codePoint)

Returns whether the code point is upper case.

isTitleCase(codePoint)

Returns whether the code point is title case.

isWhiteSpace(codePoint)

Returns whether the code point is whitespace: specifically, whether the category is one of Zs, Zl, or Zp.

isBaseForm(codePoint)

Returns whether the code point is a base form. A code point of base form does not graphically combine with preceding characters.

isMark(codePoint)

Returns whether the code point is a mark character (e.g. accent).

License

MIT

FAQs

Package last updated on 31 May 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc