/
eup
/
khsm
Обзор
Документация
Войти
/
eup
/
khsm
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
verify_test.mjs
41 строка
1 KB
eup
Create: build_random_html_test.mjs, build_test.mjs, inspect_questions.mjs, verify_html_test.mjs, verify_test.mjs, Тест_КХСМ_рандом.html
07 июн 2026, 12:06
Верифицирован
07 июн 2026, 12:06
d2942e3
Код
Авторство
О чём код?
import fs from "node:fs/promises"; import { FileBlob, SpreadsheetFile } from "@oai/artifact-tool"; const outputPath = "C:/Users/egoru/Documents/Codex/2026-05-02/files-mentioned-by-the-user-xlsx/outputs/Тест_КХСМ_15_вопросов.xlsx"; const workbook = await SpreadsheetFile.importXlsx(await FileBlob.load(outputPath)); const testPreview = await workbook.inspect({ kind: "table", range: "Тест!A1:G19", include: "values", tableMaxRows: 19, tableMaxCols: 7, }); console.log(testPreview.ndjson); const keyPreview = await workbook.inspect({ kind: "table", range: "Ответы!A1:D17", include: "values", tableMaxRows: 17, tableMaxCols: 4, }); console.log(keyPreview.ndjson); const errors = await workbook.inspect({ kind: "match", searchTerm: "#REF!|#DIV/0!|#VALUE!|#NAME\\?|#N/A", options: { useRegex: true, maxResults: 50 }, summary: "formula error scan", }); console.log(errors.ndjson); await fs.mkdir("outputs/previews", { recursive: true }); for (const sheetName of ["Тест", "Ответы"]) { const image = await workbook.render({ sheetName, scale: 1 }); const bytes = Buffer.from(await image.arrayBuffer()); await fs.writeFile(`outputs/previews/${sheetName}.png`, bytes); console.log(`${sheetName} preview bytes: ${bytes.length}`); } console.log("verified");