INNER CODE UNIT · TypeScript

ffishModuleOptions

gbtami/pychess-variants · client/main.ts:264

function ffishModuleOptions(printErr?: (text: string) => void) {
    // Keep the generated WASM binary in lockstep with the cache-busted JS bundle.
    const script = document.querySelector<HTMLScriptElement>('script[src*="/static/pychess-variants.js"]');
    const version = script ? new URL(script.src, window.location.href).search : '';

    return {
        ...(printErr ? { printErr } : {}),
        locateFile: (path: string, prefix: string) =>
            path.endsWith('.wasm') ? `/static/${path}${version}` : prefix + path,
    };
}

function start() {
    const placeholder = document.getElementById('placeholder');
    if (placeholder && el) {
        const dataView = el.getAttribute('data-view') ?? '';
        // Check if we need to show username selection dialog
        if (model.oauthUsernameSelection && model.oauthUsernameSelection.oauth_id) {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…