Skip to content

Commit 2dd0629

Browse files
committed
Shortened numeric comparisons
1 parent 579a334 commit 2dd0629

File tree

8 files changed

+24
-24
lines changed

8 files changed

+24
-24
lines changed

amazongpt/utils/bump/resources.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,13 @@
8888
fs.writeFileSync(userJSfilePath, userJScontent.replace(resURL, updatedURL), 'utf-8')
8989
bump.log.success(`${resName} bumped!\n`) ; urlsUpdatedCnt++
9090
}
91-
if (urlsUpdatedCnt > 0) {
91+
if (urlsUpdatedCnt) {
9292
console.log(`${ !bump.log.endedWithLineBreak ? '\n' : '' }Bumping userscript version...`)
9393
bump.bumpUserJSver(userJSfilePath)
9494
}
9595

9696
// Log final summary
97-
bump.log[urlsUpdatedCnt > 0 ? 'success' : 'info'](
98-
`\n${ urlsUpdatedCnt > 0 ? 'Success! ' : '' }${urlsUpdatedCnt} resource(s) bumped.`)
97+
bump.log[urlsUpdatedCnt ? 'success' : 'info'](
98+
`\n${ urlsUpdatedCnt ? 'Success! ' : '' }${urlsUpdatedCnt} resource(s) bumped.`)
9999

100100
})()

bravegpt/utils/bump/resources.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,13 @@
8888
fs.writeFileSync(userJSfilePath, userJScontent.replace(resURL, updatedURL), 'utf-8')
8989
bump.log.success(`${resName} bumped!\n`) ; urlsUpdatedCnt++
9090
}
91-
if (urlsUpdatedCnt > 0) {
91+
if (urlsUpdatedCnt) {
9292
console.log(`${ !bump.log.endedWithLineBreak ? '\n' : '' }Bumping userscript version...`)
9393
bump.bumpUserJSver(userJSfilePath)
9494
}
9595

9696
// Log final summary
97-
bump.log[urlsUpdatedCnt > 0 ? 'success' : 'info'](
98-
`\n${ urlsUpdatedCnt > 0 ? 'Success! ' : '' }${urlsUpdatedCnt} resource(s) bumped.`)
97+
bump.log[urlsUpdatedCnt ? 'success' : 'info'](
98+
`\n${ urlsUpdatedCnt ? 'Success! ' : '' }${urlsUpdatedCnt} resource(s) bumped.`)
9999

100100
})()

chatgpt-auto-continue/utils/bump/resources.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,13 @@
8888
fs.writeFileSync(userJSfilePath, userJScontent.replace(resURL, updatedURL), 'utf-8')
8989
bump.log.success(`${resName} bumped!\n`) ; urlsUpdatedCnt++
9090
}
91-
if (urlsUpdatedCnt > 0) {
91+
if (urlsUpdatedCnt) {
9292
console.log(`${ !bump.log.endedWithLineBreak ? '\n' : '' }Bumping userscript version...`)
9393
bump.bumpUserJSver(userJSfilePath)
9494
}
9595

9696
// Log final summary
97-
bump.log[urlsUpdatedCnt > 0 ? 'success' : 'info'](
98-
`\n${ urlsUpdatedCnt > 0 ? 'Success! ' : '' }${urlsUpdatedCnt} resource(s) bumped.`)
97+
bump.log[urlsUpdatedCnt ? 'success' : 'info'](
98+
`\n${ urlsUpdatedCnt ? 'Success! ' : '' }${urlsUpdatedCnt} resource(s) bumped.`)
9999

100100
})()

chatgpt-infinity/utils/bump/resources.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,13 @@
8888
fs.writeFileSync(userJSfilePath, userJScontent.replace(resURL, updatedURL), 'utf-8')
8989
bump.log.success(`${resName} bumped!\n`) ; urlsUpdatedCnt++
9090
}
91-
if (urlsUpdatedCnt > 0) {
91+
if (urlsUpdatedCnt) {
9292
console.log(`${ !bump.log.endedWithLineBreak ? '\n' : '' }Bumping userscript version...`)
9393
bump.bumpUserJSver(userJSfilePath)
9494
}
9595

9696
// Log final summary
97-
bump.log[urlsUpdatedCnt > 0 ? 'success' : 'info'](
98-
`\n${ urlsUpdatedCnt > 0 ? 'Success! ' : '' }${urlsUpdatedCnt} resource(s) bumped.`)
97+
bump.log[urlsUpdatedCnt ? 'success' : 'info'](
98+
`\n${ urlsUpdatedCnt ? 'Success! ' : '' }${urlsUpdatedCnt} resource(s) bumped.`)
9999

100100
})()

chatgpt-widescreen/utils/bump/resources.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,13 @@
8484
fs.writeFileSync(userJSfilePath, userJScontent.replace(resURL, updatedURL), 'utf-8')
8585
bump.log.success(`${resName} bumped!\n`) ; urlsUpdatedCnt++
8686
}
87-
if (urlsUpdatedCnt > 0) {
87+
if (urlsUpdatedCnt) {
8888
console.log(`${ !bump.log.endedWithLineBreak ? '\n' : '' }Bumping userscript version...`)
8989
bump.bumpUserJSver(userJSfilePath)
9090
}
9191

9292
// Log final summary
93-
bump.log[urlsUpdatedCnt > 0 ? 'success' : 'info'](
94-
`\n${ urlsUpdatedCnt > 0 ? 'Success! ' : '' }${urlsUpdatedCnt} resource(s) bumped.`)
93+
bump.log[urlsUpdatedCnt ? 'success' : 'info'](
94+
`\n${ urlsUpdatedCnt ? 'Success! ' : '' }${urlsUpdatedCnt} resource(s) bumped.`)
9595

9696
})()

duckduckgpt/utils/bump/resources.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,13 @@
8888
fs.writeFileSync(userJSfilePath, userJScontent.replace(resURL, updatedURL), 'utf-8')
8989
bump.log.success(`${resName} bumped!\n`) ; urlsUpdatedCnt++
9090
}
91-
if (urlsUpdatedCnt > 0) {
91+
if (urlsUpdatedCnt) {
9292
console.log(`${ !bump.log.endedWithLineBreak ? '\n' : '' }Bumping userscript version...`)
9393
bump.bumpUserJSver(userJSfilePath)
9494
}
9595

9696
// Log final summary
97-
bump.log[urlsUpdatedCnt > 0 ? 'success' : 'info'](
98-
`\n${ urlsUpdatedCnt > 0 ? 'Success! ' : '' }${urlsUpdatedCnt} resource(s) bumped.`)
97+
bump.log[urlsUpdatedCnt ? 'success' : 'info'](
98+
`\n${ urlsUpdatedCnt ? 'Success! ' : '' }${urlsUpdatedCnt} resource(s) bumped.`)
9999

100100
})()

googlegpt/utils/bump/resources.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,13 @@
8888
fs.writeFileSync(userJSfilePath, userJScontent.replace(resURL, updatedURL), 'utf-8')
8989
bump.log.success(`${resName} bumped!\n`) ; urlsUpdatedCnt++
9090
}
91-
if (urlsUpdatedCnt > 0) {
91+
if (urlsUpdatedCnt) {
9292
console.log(`${ !bump.log.endedWithLineBreak ? '\n' : '' }Bumping userscript version...`)
9393
bump.bumpUserJSver(userJSfilePath)
9494
}
9595

9696
// Log final summary
97-
bump.log[urlsUpdatedCnt > 0 ? 'success' : 'info'](
98-
`\n${ urlsUpdatedCnt > 0 ? 'Success! ' : '' }${urlsUpdatedCnt} resource(s) bumped.`)
97+
bump.log[urlsUpdatedCnt ? 'success' : 'info'](
98+
`\n${ urlsUpdatedCnt ? 'Success! ' : '' }${urlsUpdatedCnt} resource(s) bumped.`)
9999

100100
})()

utils/bump/resources.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
userJSfiles.forEach(userJSfilePath => {
5656
const userJScontent = fs.readFileSync(userJSfilePath, 'utf-8'),
5757
resURLs = [...userJScontent.matchAll(new RegExp(regEx.jsURL.source, 'gm'))].map(match => match[1])
58-
if (resURLs.length > 0) { urlMap[userJSfilePath] = resURLs ; resCnt += resURLs.length }
58+
if (resURLs?.length) { urlMap[userJSfilePath] = resURLs ; resCnt += resURLs.length }
5959
})
6060
bump.log.success(`${resCnt} potentially bumpable resource(s) found.`)
6161

@@ -119,8 +119,8 @@
119119
}
120120

121121
// Log final summary
122-
bump.log[urlsUpdatedCnt > 0 ? 'success' : 'info'](
123-
`\n${ urlsUpdatedCnt > 0 ? 'Success! ' : '' }${
122+
bump.log[urlsUpdatedCnt ? 'success' : 'info'](
123+
`\n${ urlsUpdatedCnt ? 'Success! ' : '' }${
124124
urlsUpdatedCnt} resource(s) bumped across ${filesUpdatedCnt} file(s).`
125125
)
126126

0 commit comments

Comments
 (0)