New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

grapheme-breaker-u10-0

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grapheme-breaker-u10-0 - npm Package Compare versions

Comparing version 0.0.1-security to 0.4.0

src/classes.json

44

package.json
{
"name": "grapheme-breaker-u10-0",
"version": "0.0.1-security",
"description": "security holding package",
"repository": "npm/security-holder"
"version": "0.4.0",
"description": "An implementation of the Unicode grapheme cluster breaking algorithm (UAX #29)",
"main": "src/GraphemeBreaker",
"directories": {
"test": "test"
},
"dependencies": {
"unicode-trie": "^0.3.1"
},
"devDependencies": {
"chai": "^4.2.0",
"coffeescript": "^2.4.1",
"mocha": "^6.1.4",
"request": "^2.88.0"
},
"scripts": {
"test": "mocha ./test/GraphemeBreaker.coffee",
"build": "coffee -c src/"
},
"repository": {
"type": "git",
"url": "git://github.com/yumetodo/grapheme-breaker-u10-0"
},
"keywords": [
"unicode",
"text",
"break",
"segment",
"character",
"grapheme cluster"
],
"author": "Devon Govett <devongovett@gmail.com>",
"contributors": [
"vaskevich <oleg@osv.im> (https://osv.im)",
"yumetodo <yume-wikijp@live.jp> (https://yumetodo.hateblo.jp/)"
],
"license": "MIT",
"bugs": {
"url": "https://github.com/yumetodo/grapheme-breaker-u10-0/issues"
},
"homepage": "https://github.com/yumetodo/grapheme-breaker-u10-0"
}

@@ -1,9 +0,66 @@

# Security holding package
# grapheme-breaker-u10-0
This package name is not currently in use, but was formerly occupied
by another package. To avoid malicious use, npm is hanging on to the
package name, but loosely, and we'll probably give it to you if you
want it.
[![Build Status](https://travis-ci.org/yumetodo/grapheme-breaker-u10-0.svg?branch=master)](https://travis-ci.org/yumetodo/grapheme-breaker-u10-0) [![Greenkeeper badge](https://badges.greenkeeper.io/yumetodo/grapheme-breaker-u10-0.svg)](https://greenkeeper.io/)
You may adopt this package by contacting support@npmjs.com and
requesting the name.
This is a fork of `grapheme-breaker`. Support Unicode 10.0 and emoji v5 by @vaskevich.
Please watch below before using this package.
[grapheme-breaker#4](https://github.com/foliojs/grapheme-breaker/pull/4)
Original package is no longer maintained as far as I know. So, I republish this package.
## Overveiw
A JavaScript implementation of the Unicode grapheme cluster breaking algorithm ([UAX #29](http://www.unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries))
> It is important to recognize that what the user thinks of as a “character”—a basic unit of a writing system for a
> language—may not be just a single Unicode code point. Instead, that basic unit may be made up of multiple Unicode
> code points. To avoid ambiguity with the computer use of the term character, this is called a user-perceived character.
> For example, “G” + acute-accent is a user-perceived character: users think of it as a single character, yet is actually
> represented by two Unicode code points. These user-perceived characters are approximated by what is called a grapheme cluster,
> which can be determined programmatically.
## Installation
You can install via npm
npm install grapheme-breaker-u10-0
## Example
```javascript
var GraphemeBreaker = require('grapheme-breaker-u10-0');
// break a string into an array of grapheme clusters
GraphemeBreaker.break('Z͑ͫ̓ͪ̂ͫ̽͏̴̙̤̞͉͚̯̞̠͍A̴̵̜̰͔ͫ͗͢L̠ͨͧͩ͘G̴̻͈͍͔̹̑͗̎̅͛́Ǫ̵̹̻̝̳͂̌̌͘!͖̬̰̙̗̿̋ͥͥ̂ͣ̐́́͜͞') // => ['Z͑ͫ̓ͪ̂ͫ̽͏̴̙̤̞͉͚̯̞̠͍', 'A̴̵̜̰͔ͫ͗͢', 'L̠ͨͧͩ͘', 'G̴̻͈͍͔̹̑͗̎̅͛́', 'Ǫ̵̹̻̝̳͂̌̌͘', '!͖̬̰̙̗̿̋ͥͥ̂ͣ̐́́͜͞']
// or just count the number of grapheme clusters in a string
GraphemeBreaker.countBreaks('Z͑ͫ̓ͪ̂ͫ̽͏̴̙̤̞͉͚̯̞̠͍A̴̵̜̰͔ͫ͗͢L̠ͨͧͩ͘G̴̻͈͍͔̹̑͗̎̅͛́Ǫ̵̹̻̝̳͂̌̌͘!͖̬̰̙̗̿̋ͥͥ̂ͣ̐́́͜͞') // => 6
// use nextBreak and previousBreak to get break points starting
// from anywhere in the string
GraphemeBreaker.nextBreak('😜🇺🇸👍', 3) // => 6
GraphemeBreaker.previousBreak('😜🇺🇸👍', 3) // => 2
```
## Development Notes
In order to use the library, you shouldn't need to know this, but if you're interested in
contributing or fixing bugs, these things might be of interest.
* The `src/classes.coffee` file is automatically generated from `GraphemeBreakProperty.txt` in the Unicode
database by `src/generate_data.coffee`. It should be rare that you need to run this, but
you may if, for instance, you want to change the Unicode version.
* You can run the tests using `npm test`. They are written using `mocha`, and generated from
`GraphemeBreakTest.txt` and `emoji-test.txt` from the Unicode database, which is included in the
repository for performance reasons while running them.
## License
MIT
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