Skip to content

Commit

Permalink
style: format code with Prettier and StandardJS
Browse files Browse the repository at this point in the history
This commit fixes the style issues introduced in 3932f3e according to the output
from Prettier and StandardJS.

Details: None
  • Loading branch information
deepsource-autofix[bot] authored Feb 14, 2025
1 parent 3932f3e commit ebb2482
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
20 changes: 10 additions & 10 deletions src/utils/aidFn.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const getImgsUrl = (html) => {
export const customizeTimer = {
intervalTimer: null,
timeoutTimer: null,
setTimeout(cb, interval) {
setTimeout (cb, interval) {
const { now } = Date
const stime = now()
let etime = stime
Expand All @@ -78,10 +78,10 @@ export const customizeTimer = {
this.timeoutTimer = requestAnimationFrame(loop)
return this.timeoutTimer
},
clearTimeout() {
clearTimeout () {
cancelAnimationFrame(this.timeoutTimer)
},
setInterval(cb, interval) {
setInterval (cb, interval) {
const { now } = Date
let stime = now()
let etime = stime
Expand All @@ -97,9 +97,9 @@ export const customizeTimer = {
this.intervalTimer = requestAnimationFrame(loop)
return this.intervalTimer
},
clearInterval() {
clearInterval () {
cancelAnimationFrame(this.intervalTimer)
},
}
}

export const isDecimal = (value) => {
Expand Down Expand Up @@ -188,7 +188,7 @@ export const formatRomanNumeral = (num) => {
{ value: 9, numeral: 'IX' },
{ value: 5, numeral: 'V' },
{ value: 4, numeral: 'IV' },
{ value: 1, numeral: 'I' },
{ value: 1, numeral: 'I' }
]
let result = ''
for (const { value, numeral } of romanMap) {
Expand Down Expand Up @@ -336,13 +336,13 @@ export const oneApiChat = (chatList, token, signal) =>
signal,
headers: {
Authorization: token,
'Content-Type': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model: 'gpt-3.5-turbo',
messages: chatList,
stream: true,
}),
stream: true
})
})

export const getCurrentDate = () => {
Expand Down Expand Up @@ -370,7 +370,7 @@ export const saveHtmlToPng = async (eleHtml, successFun, errorFun) => {
try {
const ele = eleHtml ?? document.getElementById('image-wrapper')
const canvas = await html2canvas(ele, {
useCORS: true,
useCORS: true
})
const imgUrl = canvas.toDataURL('image/png')
const tempLink = document.createElement('a')
Expand Down
8 changes: 4 additions & 4 deletions src/utils/publicFn/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const getKeyName = (pathName = '/404') => {
title: 'Not Found',
tabKey: '/404',
element: <Exception404 />,
i18nKey: 'Not Found',
i18nKey: 'Not Found'
}
}

Expand Down Expand Up @@ -67,7 +67,7 @@ export const formatTime = (date, format) => {
dd: padZero(date.getDate()),
HH: padZero(date.getHours()),
mm: padZero(date.getMinutes()),
ss: padZero(date.getSeconds()),
ss: padZero(date.getSeconds())
}

return format.replace(/yyyy|MM|dd|HH|mm|ss/g, (match) => map[match])
Expand Down Expand Up @@ -126,7 +126,7 @@ export const groupBy = (arr, groupFn) =>
arr.reduce(
(grouped, obj) => ({
...grouped,
[groupFn(obj)]: [...(grouped[groupFn(obj)] || []), obj],
[groupFn(obj)]: [...(grouped[groupFn(obj)] || []), obj]
}),
{}
)
Expand Down Expand Up @@ -175,7 +175,7 @@ export const openInNewTab = (url) => {
}

export const range = (start, end, step = 1) => {
let output = []
const output = []
if (typeof end === 'undefined') {
end = start
start = 0
Expand Down

0 comments on commit ebb2482

Please sign in to comment.