@@ -6,7 +6,7 @@ var raw = require('emoticon')
6
6
7
7
module . exports = modifier ( mergeEmoticons )
8
8
9
- var EMOTICON_NODE = 'EmoticonNode'
9
+ var emoticonNode = 'EmoticonNode'
10
10
11
11
// Magic numbers.
12
12
//
@@ -17,7 +17,7 @@ var EMOTICON_NODE = 'EmoticonNode'
17
17
// `Punctuation` (a tear), `Punctuation` (another tear), `Punctuation` (a nose),
18
18
// and `Punctuation` (a frowning mouth), we can safely break when the modifier
19
19
// has walked 5 characters.
20
- var MAX_EMOTICON_LENGTH = 5
20
+ var maxEmoticonLength = 5
21
21
22
22
// Unpack.
23
23
var emoticons = [ ]
@@ -43,7 +43,7 @@ function mergeEmoticons(child, index, parent) {
43
43
value = ''
44
44
45
45
while ( node ) {
46
- if ( value . length >= MAX_EMOTICON_LENGTH ) {
46
+ if ( value . length >= maxEmoticonLength ) {
47
47
return
48
48
}
49
49
@@ -54,11 +54,11 @@ function mergeEmoticons(child, index, parent) {
54
54
// The second test, if the last character of the current node is
55
55
// superfluous but improves performance by 30%.
56
56
if (
57
- node . type !== EMOTICON_NODE &&
57
+ node . type !== emoticonNode &&
58
58
end . indexOf ( subvalue . charAt ( subvalue . length - 1 ) ) !== - 1 &&
59
59
emoticons . indexOf ( value ) !== - 1
60
60
) {
61
- emoticon = { type : EMOTICON_NODE , value : value }
61
+ emoticon = { type : emoticonNode , value : value }
62
62
63
63
if ( child . position && node . position ) {
64
64
emoticon . position = {
0 commit comments