Code quality checks

This commit is contained in:
2025-10-06 03:03:38 +02:00
parent 5cc10dec0c
commit ef50cc9918
17 changed files with 62 additions and 88 deletions

View File

@@ -186,9 +186,9 @@ function fillTemplate(pattern: string): string {
function applyParenthesizationRandomization(formula: string): string {
if (Math.random() < 0.2) {
const operators = formula.match(/[\+\-\*\/\&\|\^]/g)
const operators = formula.match(/[+\-*/&|^]/g)
if (operators && operators.length > 0) {
const parts = formula.split(/([+\-*\/&|^])/)
const parts = formula.split(/([+\-*/&|^])/)
if (parts.length >= 3) {
const idx = Math.floor(Math.random() * (parts.length - 2) / 2) * 2
parts[idx] = `(${parts[idx]})`

View File

@@ -28,16 +28,16 @@ export function createTileStateFromCurrent(formula: string): TileState {
export function loadTileParams(tile: TileState): void {
Object.entries(tile.engineParams).forEach(([key, value]) => {
engineSettings.setKey(key as any, value)
engineSettings.setKey(key as keyof ReturnType<typeof getDefaultEngineValues>, value)
})
Object.entries(tile.effectParams).forEach(([key, value]) => {
effectSettings.setKey(key as any, value as any)
effectSettings.setKey(key as never, value as never)
})
if (tile.lfoConfigs) {
Object.entries(tile.lfoConfigs).forEach(([key, value]) => {
lfoSettings.setKey(key as any, value)
lfoSettings.setKey(key as keyof LFOSettings, value)
})
}
}

View File

@@ -21,7 +21,7 @@ export function generateWaveformData(formula: string, width: number, sampleRate:
}
return waveform
} catch (error) {
} catch {
return Array(width * 2).fill(0)
}
}