emoji-aware
Advanced tools
Comparing version 3.0.1 to 3.0.2
{ | ||
"name": "emoji-aware", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"description": "Emoji-aware unicode string utilities", | ||
@@ -20,3 +20,3 @@ "main": "emoji-aware.js", | ||
"lodash.flattendeep": "^4.4.0", | ||
"parsimmon": "^1.0.0" | ||
"parsimmon": "^1.6.2" | ||
}, | ||
@@ -27,9 +27,9 @@ "directories": { | ||
"devDependencies": { | ||
"ava": "^0.17.0", | ||
"benchmark": "^2.1.2", | ||
"cheerio": "^0.22.0", | ||
"ava": "^0.22.0", | ||
"benchmark": "^2.1.4", | ||
"cheerio": "^1.0.0-rc.2", | ||
"codecov.io": "^0.1.6", | ||
"emojilib": "^2.0.2", | ||
"nyc": "^9.0.1", | ||
"request": "^2.78.0" | ||
"emojilib": "^2.2.9", | ||
"nyc": "^11.2.1", | ||
"request": "^2.83.0" | ||
}, | ||
@@ -36,0 +36,0 @@ "repository": { |
@@ -8,3 +8,3 @@ 'use strict'; | ||
exports.OptionalVariationSelector = Parsimmon.regex(/[\uFE0E\uFE0F]{0,1}/) | ||
.desc('an optional variation selector (\\uFE0E or \\uFE0F)'); | ||
.desc('an optional variation selector (\\uFE0E or \\uFE0F)'); | ||
@@ -26,3 +26,3 @@ var KeycapEmoji = Parsimmon.seq( | ||
Parsimmon.regex(/(\uD83C[\uDFFB-\uDFFF]){0,1}/) | ||
.desc('an optional Fitzpatrick modifier'); | ||
.desc('an optional Fitzpatrick modifier'); | ||
@@ -60,2 +60,3 @@ var SimpleEmoji = Parsimmon.alt( | ||
SimpleEmoji, | ||
OptionalFitzpatrickModifier, | ||
OptionalVariationSelector | ||
@@ -62,0 +63,0 @@ ), |
@@ -35,4 +35,10 @@ [![travis]](http://travis-ci.org/beaugunderson/emoji-aware) | ||
### Example | ||
## API | ||
### `split` | ||
Split a string but keep emoji intact. | ||
#### Example | ||
```js | ||
@@ -51,1 +57,27 @@ var split = require('emoji-aware').split; | ||
![a screenshot of the output](http://i.imgur.com/Gdgsik5.png) | ||
### `onlyEmoji` | ||
Returns only the emoji contained in the string. | ||
#### Example | ||
```js | ||
var onlyEmoji = require('emoji-aware').onlyEmoji; | ||
onlyEmoji('testing😸'); | ||
// ['😸'] | ||
``` | ||
### `withoutEmoji` | ||
Returns only the non-emoji contained in the string. | ||
#### Example | ||
```js | ||
var withoutEmoji = require('emoji-aware').withoutEmoji; | ||
withoutEmoji('testing😸'); | ||
// ['t', 'e', 's', 't', 'i', 'n', 'g'] | ||
``` |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
107360
82
35
550
Updatedparsimmon@^1.6.2