Skip to content

Commit 75a3683

Browse files
committed
Shortened array length checks ↞ [auto-sync from https://github.com/KudoAI/chatgpt.js]
1 parent f43668b commit 75a3683

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

starters/chrome/extension/lib/chatgpt.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ const chatgpt = {
371371
document.removeEventListener('keydown', handlers.dismiss.key) // prevent memory leaks
372372

373373
// Check for pending alerts in queue
374-
if (alertQueue.length > 0) {
374+
if (alertQueue.length) {
375375
const nextAlert = document.getElementById(alertQueue[0])
376376
setTimeout(() => {
377377
nextAlert.style.display = ''
@@ -769,7 +769,7 @@ const chatgpt = {
769769
}}
770770
if (!targetNames.includes(targetName.toLowerCase()))
771771
throw new Error(`Invalid targetName: ${targetName}. `
772-
+ (targetNames.length > 0 ? 'Valid values are: ' + JSON.stringify(targetNames)
772+
+ (targetNames.length ? 'Valid values are: ' + JSON.stringify(targetNames)
773773
: 'targetType ' + targetType.toLowerCase() + ' does not require additional options.'))
774774

775775
// Call target function using pre-validated name components
@@ -1535,7 +1535,7 @@ const chatgpt = {
15351535
elems = [...text.matchAll(reTags)]
15361536

15371537
// Process 1st element to render
1538-
if (elems.length > 0) {
1538+
if (elems.length) {
15391539
const elem = elems[0],
15401540
[tagContent, tagName, tagAttrs, tagText] = elem.slice(0, 4),
15411541
tagNode = document.createElement(tagName) ; tagNode.textContent = tagText

starters/chrome/extension/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"name": "ChatGPT Extension",
44
"short_name": "ChatGPT 🧩",
55
"description": "A Chromium extension template to start using chatgpt.js like a boss!",
6-
"version": "2025.10.15",
6+
"version": "2025.10.20",
77
"homepage_url": "https://github.com/KudoAI/chatgpt.js-chrome-starter",
88
"icons": { "16": "icons/icon16.png", "32": "icons/icon32.png", "64": "icons/icon64.png", "128": "icons/icon128.png" },
99
"permissions": ["activeTab", "storage"],

0 commit comments

Comments
 (0)