emotesjs 0.0.10 → 0.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +6 -6
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -47,11 +47,11 @@ class EmotesJS {
47
47
  let rawEmotes = []
48
48
 
49
49
  if (ch.status === "fulfilled") {
50
- rawEmotes = rawEmotes.concat(ch.value.emote_set.emotes)
50
+ rawEmotes.push(...ch.value.emote_set.emotes)
51
51
  }
52
52
 
53
53
  if (global.status === "fulfilled") {
54
- rawEmotes = rawEmotes.concat(global.value.emotes)
54
+ rawEmotes.push(...global.value.emotes)
55
55
  }
56
56
 
57
57
  for (let emote of rawEmotes) {
@@ -72,8 +72,8 @@ class EmotesJS {
72
72
  this.isReady = true
73
73
  }
74
74
 
75
- static parse(text) {
76
- if (!text || !EmotesJS.isReady) {
75
+ parse(text) {
76
+ if (!text || !this.isReady) {
77
77
  return text
78
78
  }
79
79
  let words = text.split(' ')
@@ -82,12 +82,12 @@ class EmotesJS {
82
82
  for (let i = 0; i < words.length; i++) {
83
83
  let word = words[i]
84
84
 
85
- if (EmotesJS.requireColon && !word.startsWith(":")) {
85
+ if (this.requireColon && !word.startsWith(":")) {
86
86
  continue
87
87
  }
88
88
 
89
89
  let wordKey = word.replace(':', '')
90
- let emote = EmotesJS.cachedEmotes.get(wordKey)
90
+ let emote = this.cachedEmotes.get(wordKey)
91
91
 
92
92
  if (emote) {
93
93
  fullText += emote + ' '
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "emotesjs",
3
3
  "description": "",
4
- "version": "0.0.10",
4
+ "version": "0.0.12",
5
5
  "license": "MIT",
6
6
  "author": {
7
7
  "name": "darckfast"