[chore] ESLint and JSDoc
This commit is contained in:
parent
f4ba1f68ef
commit
4c9d52422b
|
@ -402,7 +402,7 @@ async function downloadAICCCharacter(id) {
|
||||||
return {
|
return {
|
||||||
buffer: buffer,
|
buffer: buffer,
|
||||||
fileName: fileName,
|
fileName: fileName,
|
||||||
fileType: contentType
|
fileType: contentType,
|
||||||
};
|
};
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error downloading character:', error);
|
console.error('Error downloading character:', error);
|
||||||
|
@ -410,8 +410,13 @@ async function downloadAICCCharacter(id) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parses an aicharactercards URL to extract the path.
|
||||||
|
* @param {string} url URL to parse
|
||||||
|
* @returns {string | null} AICC path
|
||||||
|
*/
|
||||||
function parseAICC(url) {
|
function parseAICC(url) {
|
||||||
const pattern = /^https?:\/\/aicharactercards\.com\/character-cards\/([^\/]+)\/([^\/]+)\/?$|([^\/]+)\/([^\/]+)$/;
|
const pattern = /^https?:\/\/aicharactercards\.com\/character-cards\/([^/]+)\/([^/]+)\/?$|([^/]+)\/([^/]+)$/;
|
||||||
const match = url.match(pattern);
|
const match = url.match(pattern);
|
||||||
if (match) {
|
if (match) {
|
||||||
// Match group 1 & 2 for full URL, 3 & 4 for relative path
|
// Match group 1 & 2 for full URL, 3 & 4 for relative path
|
||||||
|
|
|
@ -299,7 +299,7 @@ async function migrateUserData() {
|
||||||
fs.cpSync(
|
fs.cpSync(
|
||||||
migration.old,
|
migration.old,
|
||||||
path.join(backupDirectory, path.basename(migration.old)),
|
path.join(backupDirectory, path.basename(migration.old)),
|
||||||
{ recursive: true, force: true }
|
{ recursive: true, force: true },
|
||||||
);
|
);
|
||||||
fs.rmSync(migration.old, { recursive: true, force: true });
|
fs.rmSync(migration.old, { recursive: true, force: true });
|
||||||
} else {
|
} else {
|
||||||
|
@ -309,7 +309,7 @@ async function migrateUserData() {
|
||||||
fs.cpSync(
|
fs.cpSync(
|
||||||
migration.old,
|
migration.old,
|
||||||
path.join(backupDirectory, path.basename(migration.old)),
|
path.join(backupDirectory, path.basename(migration.old)),
|
||||||
{ recursive: true, force: true }
|
{ recursive: true, force: true },
|
||||||
);
|
);
|
||||||
fs.rmSync(migration.old, { recursive: true, force: true });
|
fs.rmSync(migration.old, { recursive: true, force: true });
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue