yelda-webchat 1.1.20 → 1.1.21
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.
- package/dist/js/yeldaWebchatInjector.js +1 -1
- package/dist/js/yeldaWebchatInjector.js.gz +0 -0
- package/dist/js/yeldaWebchatInjector.js.map +1 -1
- package/dist/js/yeldaWebchatInjector.min.js +1 -1
- package/dist/js/yeldaWebchatInjector.min.js.gz +0 -0
- package/dist/js/yeldaWebchatInjector.min.js.map +1 -1
- package/package.json +1 -1
- package/src/js/yeldaWebchatInjector.js +12 -4
package/package.json
CHANGED
|
@@ -95,11 +95,19 @@ class YeldaChat {
|
|
|
95
95
|
if (argsStr !== '') {
|
|
96
96
|
let argBuffer = ''
|
|
97
97
|
let parenCount = 0
|
|
98
|
+
const openingBrackets = ['(', '[', '{']
|
|
99
|
+
const closingBrackets = [')', ']', '}']
|
|
100
|
+
let isQuotesOpened = false
|
|
101
|
+
|
|
98
102
|
for (const element of argsStr) {
|
|
99
|
-
|
|
100
|
-
|
|
103
|
+
if (element === `'`) {
|
|
104
|
+
isQuotesOpened = !isQuotesOpened
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
if (openingBrackets.includes(element)) parenCount++
|
|
108
|
+
else if(closingBrackets.includes(element)) parenCount--
|
|
101
109
|
|
|
102
|
-
if (element === ',' && parenCount === 0) {
|
|
110
|
+
if (element === ',' && parenCount === 0 && !isQuotesOpened) {
|
|
103
111
|
args.push(argBuffer.trim())
|
|
104
112
|
argBuffer = ''
|
|
105
113
|
} else {
|
|
@@ -117,7 +125,7 @@ class YeldaChat {
|
|
|
117
125
|
else if (arg === 'null') return null
|
|
118
126
|
else if (arg.startsWith('[') && arg.endsWith(']')) {
|
|
119
127
|
try {
|
|
120
|
-
return JSON.parse(arg)
|
|
128
|
+
return JSON.parse(JSON.stringify(arg))
|
|
121
129
|
} catch(err) {
|
|
122
130
|
return ''
|
|
123
131
|
}
|