emoji-aware
Advanced tools
Comparing version 3.0.3 to 3.0.4
{ | ||
"name": "emoji-aware", | ||
"version": "3.0.3", | ||
"version": "3.0.4", | ||
"description": "Emoji-aware unicode string utilities", | ||
@@ -20,3 +20,3 @@ "main": "emoji-aware.js", | ||
"lodash.flattendeep": "^4.4.0", | ||
"parsimmon": "^1.6.2" | ||
"parsimmon": "^1.7.1" | ||
}, | ||
@@ -27,9 +27,9 @@ "directories": { | ||
"devDependencies": { | ||
"ava": "^0.22.0", | ||
"ava": "^0.25.0", | ||
"benchmark": "^2.1.4", | ||
"cheerio": "^1.0.0-rc.2", | ||
"codecov.io": "^0.1.6", | ||
"emojilib": "^2.2.9", | ||
"nyc": "^11.2.1", | ||
"request": "^2.83.0" | ||
"emojilib": "^2.2.12", | ||
"nyc": "^11.6.0", | ||
"request": "^2.85.0" | ||
}, | ||
@@ -36,0 +36,0 @@ "repository": { |
@@ -7,20 +7,50 @@ 'use strict'; | ||
var OptionalVariationSelector = | ||
exports.OptionalVariationSelector = Parsimmon.regex(/[\uFE0E\uFE0F]{0,1}/) | ||
.desc('an optional variation selector (\\uFE0E or \\uFE0F)'); | ||
exports.OptionalVariationSelector = Parsimmon.regex(/[\ufe0e\ufe0f]{0,1}/) | ||
.desc('an optional variation selector (\\ufe0e or \\ufe0f)'); | ||
var RequiredVariationSelector = | ||
exports.RequiredVariationSelector = Parsimmon.regex(/[\ufe0e\ufe0f]/) | ||
.desc('an required variation selector (\\ufe0e or \\ufe0f)'); | ||
var KeycapEmoji = Parsimmon.seq( | ||
Parsimmon.regex(/[0-9#*]/), | ||
OptionalVariationSelector, | ||
Parsimmon.string('\u20E3') | ||
Parsimmon.string('\u20e3') | ||
).desc('a keycap emoji'); | ||
var FlagEmoji = Parsimmon.regex(/\uD83C[\uDDE6-\uDDFF]/) | ||
var FlagEmoji = Parsimmon.regex(/\ud83c[\udde6-\uddff]/) | ||
.times(2) | ||
.desc('a flag emoji'); | ||
var ZeroWidthJoiner = Parsimmon.string('\u200D') | ||
.desc('zero-width joiner (\\u200D)'); | ||
var GreatBritainEmoji = Parsimmon.seq( | ||
Parsimmon.string( | ||
'\ud83c\udff4' + // black waving flag | ||
'\udb40\udc67' + // tag G | ||
'\udb40\udc62' // tag B | ||
), | ||
Parsimmon.alt( | ||
Parsimmon.string( | ||
'\udb40\udc77' + // tag W | ||
'\udb40\udc6c' + // tag L | ||
'\udb40\udc73' // tag S | ||
), | ||
Parsimmon.string( | ||
'\udb40\udc73' + // tag S | ||
'\udb40\udc63' + // tag C | ||
'\udb40\udc74' // tag T | ||
), | ||
Parsimmon.string( | ||
'\udb40\udc65' + // tag E | ||
'\udb40\udc6e' + // tag N | ||
'\udb40\udc67' //tag G | ||
) | ||
), | ||
Parsimmon.string('\udb40\udc7f') // cancel tag | ||
); | ||
var ZeroWidthJoiner = Parsimmon.string('\u200d') | ||
.desc('zero-width joiner (\\u200d)'); | ||
var OptionalFitzpatrickModifier = | ||
Parsimmon.regex(/(\uD83C[\uDFFB-\uDFFF]){0,1}/) | ||
Parsimmon.regex(/(\ud83c[\udffb-\udfff]){0,1}/) | ||
.desc('an optional Fitzpatrick modifier'); | ||
@@ -30,16 +60,26 @@ | ||
// Simple Unicode emoji | ||
Parsimmon.regex(/[\u203C-\u3299]/), | ||
Parsimmon.regex(/[\u2702-\u27B0]/), | ||
Parsimmon.regex(/[\u203c-\u2bff]/), | ||
Parsimmon.regex(/[\u2702-\u27b0]/), | ||
// Enclosed CJK Letters and Months | ||
Parsimmon.regex(/[\u3200-\u32ff]/), | ||
// Emoji flags | ||
FlagEmoji, | ||
GreatBritainEmoji, | ||
// Surrogate pairs | ||
Parsimmon.regex(/\uD83C[\uDC04-\uDFFF]/), | ||
Parsimmon.regex(/\uD83D[\uDC00-\uDFFF]/), | ||
Parsimmon.regex(/\uD83E[\uDC00-\uDFFF]/), | ||
// Single characters (trademark, copyright) that become emoji with a | ||
// variation selector (TODO: make the variation selector required here?) | ||
Parsimmon.string('\u00A9'), | ||
Parsimmon.string('\u00AE') | ||
Parsimmon.regex(/\ud83c[\udc04-\udfff]/), | ||
Parsimmon.regex(/\ud83d[\udc00-\udfff]/), | ||
Parsimmon.regex(/\ud83e[\udc00-\udfff]/) | ||
); | ||
var VariationSelectorEmoji = Parsimmon.seq( | ||
// Single characters that become emoji only with a variation selector | ||
Parsimmon.alt( | ||
Parsimmon.string('\u00a9'), // trademark | ||
Parsimmon.string('\u00ae'), // copyright | ||
Parsimmon.string('\u3030'), // 〰 | ||
Parsimmon.string('\u303d') // 〽 | ||
), | ||
RequiredVariationSelector | ||
); | ||
var ZeroWidthJoinerEmoji = Parsimmon.seq( | ||
@@ -57,2 +97,3 @@ SimpleEmoji, | ||
Parsimmon.alt( | ||
VariationSelectorEmoji, | ||
ZeroWidthJoinerEmoji, | ||
@@ -59,0 +100,0 @@ Parsimmon.seq( |
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
114400
46
796
Updatedparsimmon@^1.7.1