Skip to content

Commit 5bb6c9b

Browse files
committed
Renamed getSRIhash(url) to generateSRIhash(resURL) for better clarity
1 parent 5ab142e commit 5bb6c9b

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@
7777
return latestCommitHash
7878
}
7979

80-
async function getSRIhash(url, algorithm = 'sha256') {
80+
async function generateSRIhash(resURL, algorithm = 'sha256') {
8181
const sriHash = ssri.fromData(
82-
Buffer.from(await (await fetchData(url)).arrayBuffer()), { algorithms: [algorithm] }).toString()
82+
Buffer.from(await (await fetchData(resURL)).arrayBuffer()), { algorithms: [algorithm] }).toString()
8383
log.hash(`${sriHash}\n`)
8484
return sriHash
8585
}
@@ -148,7 +148,7 @@
148148

149149
// Generate/compare/update SRI hash
150150
console.log(`${ !log.endedWithLineBreak ? '\n' : '' }Generating SHA-256 hash for ${resName}...`)
151-
const newSRIhash = await getSRIhash(updatedURL)
151+
const newSRIhash = await generateSRIhash(updatedURL)
152152
if (rePatterns.sriHash.exec(resURL)?.[0] == newSRIhash) { // SRI hash didn't change
153153
console.log(`${resName} already up-to-date!`) ; log.endedWithLineBreak = false
154154
continue // ...so skip resource

chatgpt-infinity/utils/bump/resources.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@
7777
return latestCommitHash
7878
}
7979

80-
async function getSRIhash(url, algorithm = 'sha256') {
80+
async function generateSRIhash(resURL, algorithm = 'sha256') {
8181
const sriHash = ssri.fromData(
82-
Buffer.from(await (await fetchData(url)).arrayBuffer()), { algorithms: [algorithm] }).toString()
82+
Buffer.from(await (await fetchData(resURL)).arrayBuffer()), { algorithms: [algorithm] }).toString()
8383
log.hash(`${sriHash}\n`)
8484
return sriHash
8585
}
@@ -148,7 +148,7 @@
148148

149149
// Generate/compare/update SRI hash
150150
console.log(`${ !log.endedWithLineBreak ? '\n' : '' }Generating SHA-256 hash for ${resName}...`)
151-
const newSRIhash = await getSRIhash(updatedURL)
151+
const newSRIhash = await generateSRIhash(updatedURL)
152152
if (rePatterns.sriHash.exec(resURL)?.[0] == newSRIhash) { // SRI hash didn't change
153153
console.log(`${resName} already up-to-date!`) ; log.endedWithLineBreak = false
154154
continue // ...so skip resource

chatgpt-widescreen/utils/bump/resources.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@
7373
return latestCommitHash
7474
}
7575

76-
async function getSRIhash(url, algorithm = 'sha256') {
76+
async function generateSRIhash(resURL, algorithm = 'sha256') {
7777
const sriHash = ssri.fromData(
78-
Buffer.from(await (await fetchData(url)).arrayBuffer()), { algorithms: [algorithm] }).toString()
78+
Buffer.from(await (await fetchData(resURL)).arrayBuffer()), { algorithms: [algorithm] }).toString()
7979
log.hash(`${sriHash}\n`)
8080
return sriHash
8181
}
@@ -144,7 +144,7 @@
144144

145145
// Generate/compare/update SRI hash
146146
console.log(`${ !log.endedWithLineBreak ? '\n' : '' }Generating SHA-256 hash for ${resName}...`)
147-
const newSRIhash = await getSRIhash(updatedURL)
147+
const newSRIhash = await generateSRIhash(updatedURL)
148148
if (rePatterns.sriHash.exec(resURL)?.[0] == newSRIhash) { // SRI hash didn't change
149149
console.log(`${resName} already up-to-date!`) ; log.endedWithLineBreak = false
150150
continue // ...so skip resource

utils/bump/resources.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@
9393
return latestCommitHash
9494
}
9595

96-
async function getSRIhash(url, algorithm = 'sha256') {
96+
async function generateSRIhash(resURL, algorithm = 'sha256') {
9797
const sriHash = ssri.fromData(
98-
Buffer.from(await (await fetchData(url)).arrayBuffer()), { algorithms: [algorithm] }).toString()
98+
Buffer.from(await (await fetchData(resURL)).arrayBuffer()), { algorithms: [algorithm] }).toString()
9999
log.hash(`${sriHash}\n`)
100100
return sriHash
101101
}
@@ -186,7 +186,7 @@
186186

187187
// Generate/compare/update SRI hash
188188
console.log(`${ !log.endedWithLineBreak ? '\n' : '' }Generating SHA-256 hash for ${resName}...`)
189-
const newSRIhash = await getSRIhash(updatedURL)
189+
const newSRIhash = await generateSRIhash(updatedURL)
190190
if (rePatterns.sriHash.exec(resURL)?.[0] == newSRIhash) { // SRI hash didn't change
191191
console.log(`${resName} already up-to-date!`) ; log.endedWithLineBreak = false
192192
continue // ...so skip resource

0 commit comments

Comments
 (0)