Skip to content

Commit 5cce24c

Browse files
committed
Replaced array.from() w/ shorter spread syntax
1 parent 822ca44 commit 5cce24c

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

amazongpt/greasemonkey/amazongpt.user.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// @description Add AI chat & product/category summaries to Amazon shopping, powered by the latest LLMs like GPT-4o!
44
// @author KudoAI
55
// @namespace https://kudoai.com
6-
// @version 2025.4.20.6
6+
// @version 2025.4.20.7
77
// @license MIT
88
// @icon https://cdn.jsdelivr.net/gh/KudoAI/amazongpt@0fddfc7/assets/images/icons/amazongpt/black-gold-teal/icon48.png
99
// @icon64 https://cdn.jsdelivr.net/gh/KudoAI/amazongpt@0fddfc7/assets/images/icons/amazongpt/black-gold-teal/icon64.png
@@ -310,7 +310,7 @@
310310
log[logType] = function() {
311311
if (logType == 'debug' && !config.debugMode) return
312312

313-
const args = Array.from(arguments).map(arg => typeof arg == 'object' ? JSON.stringify(arg) : arg)
313+
const args = [...arguments].map(arg => typeof arg == 'object' ? JSON.stringify(arg) : arg)
314314
const msgType = args.some(arg => /\.{3}$/.test(arg)) ? 'working'
315315
: args.some(arg => /\bsuccess\b|!$/i.test(arg)) ? 'success'
316316
: args.some(arg => /\b(?:error|fail)\b/i.test(arg)) || logType == 'error' ? 'warning' : 'info'
@@ -3250,7 +3250,7 @@
32503250

32513251
// Init block's language data
32523252
const codeBlock = downloadBtn.closest('code'), blockLang = {},
3253-
hljsClass = Array.from(codeBlock.classList).find(cls => cls.startsWith('language-'))
3253+
hljsClass = [...codeBlock.classList].find(cls => cls.startsWith('language-'))
32543254
if (hljsClass) {
32553255
blockLang.hljsSlug = hljsClass.replace('language-', '')
32563256
for (const [langName, langEntry] of Object.entries(this.langData))

bravegpt/greasemonkey/bravegpt.user.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@
148148
// @description:zu Yengeza izimpendulo ze-AI ku-Brave Search (inikwa amandla yi-GPT-4o!)
149149
// @author KudoAI
150150
// @namespace https://kudoai.com
151-
// @version 2025.4.20.6
151+
// @version 2025.4.20.7
152152
// @license MIT
153153
// @icon https://assets.bravegpt.com/images/icons/bravegpt/icon48.png?v=df624b0
154154
// @icon64 https://assets.bravegpt.com/images/icons/bravegpt/icon64.png?v=df624b0
@@ -470,7 +470,7 @@
470470
log[logType] = function() {
471471
if (logType == 'debug' && !config.debugMode) return
472472

473-
const args = Array.from(arguments).map(arg => typeof arg == 'object' ? JSON.stringify(arg) : arg)
473+
const args = [...arguments].map(arg => typeof arg == 'object' ? JSON.stringify(arg) : arg)
474474
const msgType = args.some(arg => /\.{3}$/.test(arg)) ? 'working'
475475
: args.some(arg => /\bsuccess\b|!$/i.test(arg)) ? 'success'
476476
: args.some(arg => /\b(?:error|fail)\b/i.test(arg)) || logType == 'error' ? 'warning' : 'info'
@@ -4012,7 +4012,7 @@
40124012

40134013
// Init block's language data
40144014
const codeBlock = downloadBtn.closest('code'), blockLang = {},
4015-
hljsClass = Array.from(codeBlock.classList).find(cls => cls.startsWith('language-'))
4015+
hljsClass = [...codeBlock.classList].find(cls => cls.startsWith('language-'))
40164016
if (hljsClass) {
40174017
blockLang.hljsSlug = hljsClass.replace('language-', '')
40184018
for (const [langName, langEntry] of Object.entries(this.langData))

duckduckgpt/greasemonkey/duckduckgpt.user.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@
148148
// @description:zu Yengeza izimpendulo ze-AI ku-DuckDuckGo (inikwa amandla yi-GPT-4o!)
149149
// @author KudoAI
150150
// @namespace https://kudoai.com
151-
// @version 2025.4.20.5
151+
// @version 2025.4.20.6
152152
// @license MIT
153153
// @icon https://assets.ddgpt.com/images/icons/duckduckgpt/icon48.png?v=06af076
154154
// @icon64 https://assets.ddgpt.com/images/icons/duckduckgpt/icon64.png?v=06af076
@@ -462,7 +462,7 @@
462462
log[logType] = function() {
463463
if (logType == 'debug' && !config.debugMode) return
464464

465-
const args = Array.from(arguments).map(arg => typeof arg == 'object' ? JSON.stringify(arg) : arg)
465+
const args = [...arguments].map(arg => typeof arg == 'object' ? JSON.stringify(arg) : arg)
466466
const msgType = args.some(arg => /\.{3}$/.test(arg)) ? 'working'
467467
: args.some(arg => /\bsuccess\b|!$/i.test(arg)) ? 'success'
468468
: args.some(arg => /\b(?:error|fail)\b/i.test(arg)) || logType == 'error' ? 'warning' : 'info'
@@ -4005,7 +4005,7 @@
40054005

40064006
// Init block's language data
40074007
const codeBlock = downloadBtn.closest('code'), blockLang = {},
4008-
hljsClass = Array.from(codeBlock.classList).find(cls => cls.startsWith('language-'))
4008+
hljsClass = [...codeBlock.classList].find(cls => cls.startsWith('language-'))
40094009
if (hljsClass) {
40104010
blockLang.hljsSlug = hljsClass.replace('language-', '')
40114011
for (const [langName, langEntry] of Object.entries(this.langData))

googlegpt/greasemonkey/googlegpt.user.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@
149149
// @description:zu Yengeza izimpendulo ze-AI ku-Google Search (inikwa amandla yi-Google Gemma + GPT-4o!)
150150
// @author KudoAI
151151
// @namespace https://kudoai.com
152-
// @version 2025.4.20.6
152+
// @version 2025.4.20.7
153153
// @license MIT
154154
// @icon https://assets.googlegpt.io/images/icons/googlegpt/black/icon48.png?v=59409b2
155155
// @icon64 https://assets.googlegpt.io/images/icons/googlegpt/black/icon64.png?v=59409b2
@@ -653,7 +653,7 @@
653653
log[logType] = function() {
654654
if (logType == 'debug' && !config.debugMode) return
655655

656-
const args = Array.from(arguments).map(arg => typeof arg == 'object' ? JSON.stringify(arg) : arg)
656+
const args = [...arguments].map(arg => typeof arg == 'object' ? JSON.stringify(arg) : arg)
657657
const msgType = args.some(arg => /\.{3}$/.test(arg)) ? 'working'
658658
: args.some(arg => /\bsuccess\b|!$/i.test(arg)) ? 'success'
659659
: args.some(arg => /\b(?:error|fail)\b/i.test(arg)) || logType == 'error' ? 'warning' : 'info'
@@ -4194,7 +4194,7 @@
41944194

41954195
// Init block's language data
41964196
const codeBlock = downloadBtn.closest('code'), blockLang = {},
4197-
hljsClass = Array.from(codeBlock.classList).find(cls => cls.startsWith('language-'))
4197+
hljsClass = [...codeBlock.classList].find(cls => cls.startsWith('language-'))
41984198
if (hljsClass) {
41994199
blockLang.hljsSlug = hljsClass.replace('language-', '')
42004200
for (const [langName, langEntry] of Object.entries(this.langData))

0 commit comments

Comments
 (0)