emotesjs 0.0.11 → 0.0.13

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 +10 -3
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -47,18 +47,18 @@ 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) {
58
58
  let name = emote.data.name
59
59
  let url = `https:${emote.data.host.url}`
60
60
 
61
- if (!this.allowedOrigins.includes(url)) {
61
+ if (!url.includes(this.allowedOrigins)) {
62
62
  continue
63
63
  }
64
64
 
@@ -74,8 +74,15 @@ class EmotesJS {
74
74
 
75
75
  parse(text) {
76
76
  if (!text || !this.isReady) {
77
+ console.log('emotes not ready')
77
78
  return text
78
79
  }
80
+
81
+ if (this.isReady && this.cachedEmotes.size === 0) {
82
+ console.log('no emotes loaded')
83
+ return text
84
+ }
85
+
79
86
  let words = text.split(' ')
80
87
 
81
88
  let fullText = ''
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "emotesjs",
3
3
  "description": "",
4
- "version": "0.0.11",
4
+ "version": "0.0.13",
5
5
  "license": "MIT",
6
6
  "author": {
7
7
  "name": "darckfast"