INNER CODE UNIT · TypeScript

emitResult

x-cmd/x-cmd · mod/ajv/lib/ajv.ts:318

function emitResult(
    file: string,
    result: string,
    text: string,
    detail?: Record<string, unknown>,
): void {
    bumpStats(result, detectFormat(file));
    if (!SHOW_ALL && SUCCESS_RESULTS.has(result)) return;
    const safeText = text
        .replace(/\\/g, "\\\\")
        .replace(/\t/g, " ")
        .replace(/\r?\n/g, "\\n");
    const json = detail ? "\t" + JSON.stringify(detail) : "";
    console.log(`${file}\t${result}\t${safeText}${json}`);
}

// Recursively expand a directory into its .yml / .yaml / .json leaf
// files.  Hidden entries (names starting with '.') are skipped so we

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…