mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
lint: Require semicolons
This commit is contained in:
@ -89,9 +89,9 @@ export function getSortableDelay() {
|
||||
export async function bufferToBase64(buffer) {
|
||||
// use a FileReader to generate a base64 data URI:
|
||||
const base64url = await new Promise(resolve => {
|
||||
const reader = new FileReader()
|
||||
reader.onload = () => resolve(reader.result)
|
||||
reader.readAsDataURL(new Blob([buffer]))
|
||||
const reader = new FileReader();
|
||||
reader.onload = () => resolve(reader.result);
|
||||
reader.readAsDataURL(new Blob([buffer]));
|
||||
});
|
||||
// remove the `data:...;base64,` part from the start
|
||||
return base64url.slice(base64url.indexOf(',') + 1);
|
||||
@ -439,7 +439,7 @@ export async function initScrollHeight(element) {
|
||||
const curScrollHeight = Number($(element).prop('scrollHeight'));
|
||||
const diff = curScrollHeight - curHeight;
|
||||
|
||||
if (diff < 3) { return } //happens when the div isn't loaded yet
|
||||
if (diff < 3) { return; } //happens when the div isn't loaded yet
|
||||
|
||||
const newHeight = curHeight + diff + 3; //the +3 here is to account for padding/line-height on text inputs
|
||||
//console.log(`init height to ${newHeight}`);
|
||||
@ -703,7 +703,7 @@ export function getCharaFilename(chid) {
|
||||
const fileName = context.characters[chid ?? context.characterId].avatar;
|
||||
|
||||
if (fileName) {
|
||||
return fileName.replace(/\.[^/.]+$/, '')
|
||||
return fileName.replace(/\.[^/.]+$/, '');
|
||||
}
|
||||
}
|
||||
|
||||
@ -812,7 +812,7 @@ export function extractDataFromPng(data, identifier = 'chara') {
|
||||
|
||||
//check if png header is valid
|
||||
if (!data || data[0] !== 0x89 || data[1] !== 0x50 || data[2] !== 0x4E || data[3] !== 0x47 || data[4] !== 0x0D || data[5] !== 0x0A || data[6] !== 0x1A || data[7] !== 0x0A) {
|
||||
console.log('PNG header invalid')
|
||||
console.log('PNG header invalid');
|
||||
return null;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user