Skip to content

Commit

Permalink
Use ESM
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Apr 6, 2021
1 parent 6babab4 commit b73aa7a
Show file tree
Hide file tree
Showing 9 changed files with 295 additions and 306 deletions.
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
.DS_Store
*.log
.nyc_output/
coverage/
node_modules/
polarity.js
polarity.min.js
yarn.lock
yarn.lock
2 changes: 0 additions & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
coverage/
polarity.js
polarity.min.js
*.md
20 changes: 11 additions & 9 deletions build.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
'use strict'

var fs = require('fs')
var emotion = require('emoji-emotion')
var emojiToName = require('gemoji/emoji-to-name')
import fs from 'fs'
import {emojiEmotion} from 'emoji-emotion'
import {emojiToName} from 'gemoji'

var data = {}
var index = -1

while (++index < emotion.length) {
data[emotion[index].emoji] = emotion[index].polarity
data[':' + emojiToName[emotion[index].emoji] + ':'] = emotion[index].polarity
while (++index < emojiEmotion.length) {
data[emojiEmotion[index].emoji] = emojiEmotion[index].polarity
data[':' + emojiToName[emojiEmotion[index].emoji] + ':'] =
emojiEmotion[index].polarity
}

fs.writeFileSync('emoji.json', JSON.stringify(data, null, 2) + '\n')
fs.writeFileSync(
'emoji.js',
'export var emoji = ' + JSON.stringify(data, null, 2) + '\n'
)
238 changes: 238 additions & 0 deletions emoji.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,238 @@
export var emoji = {
'💯': 3,
':100:': 3,
'😠': -3,
':angry:': -3,
'😧': -3,
':anguished:': -3,
'😲': 2,
':astonished:': 2,
'🖤': 3,
':black_heart:': 3,
'💙': 3,
':blue_heart:': 3,
'😊': 2,
':blush:': 2,
'💔': -3,
':broken_heart:': -3,
'👏': 3,
':clap:': 3,
'🤡': 0,
':clown_face:': 0,
'😰': -2,
':cold_sweat:': -2,
'😖': -2,
':confounded:': -2,
'😕': -2,
':confused:': -2,
'🤠': 2,
':cowboy_hat_face:': 2,
'🤞': 2,
':crossed_fingers:': 2,
'😢': -2,
':cry:': -2,
'😿': -2,
':crying_cat_face:': -2,
'💘': 3,
':cupid:': 3,
'😞': -2,
':disappointed:': -2,
'😥': -1,
':disappointed_relieved:': -1,
'😵': -1,
':dizzy_face:': -1,
'🤤': 0,
':drooling_face:': 0,
'😑': 0,
':expressionless:': 0,
'🤕': -2,
':face_with_head_bandage:': -2,
'🤒': -1,
':face_with_thermometer:': -1,
'😨': -2,
':fearful:': -2,
'😳': -2,
':flushed:': -2,
'😦': -1,
':frowning:': -1,
'☹️': -2,
':frowning_face:': -2,
'🖕': -4,
':middle_finger:': -4,
'👻': -1,
':ghost:': -1,
'💝': 3,
':gift_heart:': 3,
'💚': 3,
':green_heart:': 3,
'😬': -2,
':grimacing:': -2,
'😁': 2,
':grin:': 2,
'😀': 2,
':grinning:': 2,
'🤝': 1,
':handshake:': 1,
'❤️': 3,
':heart:': 3,
'😍': 3,
':heart_eyes:': 3,
'😻': 3,
':heart_eyes_cat:': 3,
'💓': 3,
':heartbeat:': 3,
'💗': 3,
':heartpulse:': 3,
'🤗': 2,
':hugs:': 2,
'😯': -1,
':hushed:': -1,
'👿': -4,
':imp:': -4,
'😇': 3,
':innocent:': 3,
'😂': 3,
':joy:': 3,
'😹': 3,
':joy_cat:': 3,
'💋': 2,
':kiss:': 2,
'😗': 2,
':kissing:': 2,
'😽': 2,
':kissing_cat:': 2,
'😚': 2,
':kissing_closed_eyes:': 2,
'😘': 3,
':kissing_heart:': 3,
'😙': 2,
':kissing_smiling_eyes:': 2,
'😆': 1,
':laughing:': 1,
'👄': 2,
':lips:': 2,
'🤥': -2,
':lying_face:': -2,
'😷': -1,
':mask:': -1,
'🤑': 0,
':money_mouth_face:': 0,
'🤢': -2,
':nauseated_face:': -2,
'🤓': -1,
':nerd_face:': -1,
'😐': 0,
':neutral_face:': 0,
'😶': 0,
':no_mouth:': 0,
'👌': 2,
':ok_hand:': 2,
'😮': -2,
':open_mouth:': -2,
'😔': -1,
':pensive:': -1,
'😣': -2,
':persevere:': -2,
'😾': -4,
':pouting_cat:': -4,
'🙏': 1,
':pray:': 1,
'👊': -1,
':fist_oncoming:': -1,
'💜': 3,
':purple_heart:': 3,
'😡': -4,
':rage:': -4,
'🙌': 4,
':raised_hands:': 4,
'☺️': 2,
':relaxed:': 2,
'😌': 2,
':relieved:': 2,
'💞': 3,
':revolving_hearts:': 3,
'🤣': 4,
':rofl:': 4,
'🙄': -1,
':roll_eyes:': -1,
'😱': -3,
':scream:': -3,
'🙀': -3,
':scream_cat:': -3,
'💩': -3,
':hankey:': -3,
'💀': -2,
':skull:': -2,
'☠️': -2,
':skull_and_crossbones:': -2,
'😴': 0,
':sleeping:': 0,
'😪': 0,
':sleepy:': 0,
'🙁': -1,
':slightly_frowning_face:': -1,
'🙂': 1,
':slightly_smiling_face:': 1,
'😄': 2,
':smile:': 2,
'😸': 2,
':smile_cat:': 2,
'😃': 2,
':smiley:': 2,
'😺': 2,
':smiley_cat:': 2,
'😈': -3,
':smiling_imp:': -3,
'😏': 2,
':smirk:': 2,
'😼': 2,
':smirk_cat:': 2,
'🤧': -2,
':sneezing_face:': -2,
'😭': -3,
':sob:': -3,
'💖': 3,
':sparkling_heart:': 3,
'😛': 1,
':stuck_out_tongue:': 1,
'😝': 0,
':stuck_out_tongue_closed_eyes:': 0,
'😜': -1,
':stuck_out_tongue_winking_eye:': -1,
'😎': 1,
':sunglasses:': 1,
'😓': -1,
':sweat:': -1,
'😅': 2,
':sweat_smile:': 2,
'🤔': -1,
':thinking:': -1,
'👎': -2,
':-1:': -2,
'👍': 2,
':+1:': 2,
'😫': -2,
':tired_face:': -2,
'😤': 0,
':triumph:': 0,
'💕': 3,
':two_hearts:': 3,
'😒': -2,
':unamused:': -2,
'🙃': 0,
':upside_down_face:': 0,
'✌️': 2,
':v:': 2,
'😩': -2,
':weary:': -2,
'😉': 3,
':wink:': 3,
'😟': -3,
':worried:': -3,
'💛': 3,
':yellow_heart:': 3,
'😋': 3,
':yum:': 3,
'🤐': -1,
':zipper_mouth_face:': -1
}
Loading

0 comments on commit b73aa7a

Please sign in to comment.