From ebb24823498c8f12503c51ea65b68fe054d9d76c Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Fri, 14 Feb 2025 02:57:00 +0000 Subject: [PATCH] style: format code with Prettier and StandardJS This commit fixes the style issues introduced in 3932f3e according to the output from Prettier and StandardJS. Details: None --- src/utils/aidFn.js | 20 ++++++++++---------- src/utils/publicFn/index.jsx | 8 ++++---- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/utils/aidFn.js b/src/utils/aidFn.js index bb605e10..7ef30cec 100644 --- a/src/utils/aidFn.js +++ b/src/utils/aidFn.js @@ -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 @@ -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 @@ -97,9 +97,9 @@ export const customizeTimer = { this.intervalTimer = requestAnimationFrame(loop) return this.intervalTimer }, - clearInterval() { + clearInterval () { cancelAnimationFrame(this.intervalTimer) - }, + } } export const isDecimal = (value) => { @@ -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) { @@ -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 = () => { @@ -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') diff --git a/src/utils/publicFn/index.jsx b/src/utils/publicFn/index.jsx index 55efdba3..9b755e25 100644 --- a/src/utils/publicFn/index.jsx +++ b/src/utils/publicFn/index.jsx @@ -20,7 +20,7 @@ export const getKeyName = (pathName = '/404') => { title: 'Not Found', tabKey: '/404', element: , - i18nKey: 'Not Found', + i18nKey: 'Not Found' } } @@ -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]) @@ -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] }), {} ) @@ -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