test code interceptor
This commit is contained in:
@ -1,8 +1,13 @@
|
||||
import type { Editor } from './main';
|
||||
import type { File } from './AppSettings';
|
||||
|
||||
function codeInterceptor(code: string) {
|
||||
return code.replace(/->/g, "&&")
|
||||
function codeInterceptor(code: string): string {
|
||||
return code
|
||||
.replace(/->/g, "&&")
|
||||
.replace(/t\[(\d+),(\d+)\]/g, 'mod($1,$2)')
|
||||
.replace(/b\[(\d+),(\d+)\]/g, '[$1,$2].includes(beat)')
|
||||
.replace(/eb\[(\d+),(\d+)\]/g, '[$1,$2].includes(ebeat)')
|
||||
.replace(/m\[(\d+),(\d+)\]/g, '[$1,$2].includes(bar)');
|
||||
}
|
||||
|
||||
const delay = (ms: number) => new Promise((_, reject) => setTimeout(() => reject(new Error('Operation took too long')), ms));
|
||||
|
||||
Reference in New Issue
Block a user