{"version":3,"file":"printTestCaseResult.cjs","names":["TEST_CASE_RESULT_PREFIX"],"sources":["../../src/helpers/printTestCaseResult.ts"],"sourcesContent":["import type { TestCaseResult } from '../types/testCaseResult.js';\nimport { TEST_CASE_RESULT_PREFIX } from '../types/testCaseResult.js';\n\n/**\n * Print a test case result in a format that can be read by the judge server.\n */\nexport function printTestCaseResult(result: TestCaseResult): void {\n  console.info(`${TEST_CASE_RESULT_PREFIX}${JSON.stringify(result)}`);\n}\n\nexport function encodeFileForTestCaseResult(\n  path: string,\n  data: Buffer\n): NonNullable<TestCaseResult['outputFiles']>[number] {\n  const utf8Text = data.toString('utf8');\n  const isBinary = utf8Text.includes('\\uFFFD');\n  return isBinary ? { path, encoding: 'base64', data: data.toString('base64') } : { path, data: utf8Text };\n}\n"],"mappings":"4DAMA,SAAgB,EAAoB,EAA8B,CAChE,QAAQ,KAAK,GAAGA,EAAAA,0BAA0B,KAAK,UAAU,CAAM,GAAG,CACpE,CAEA,SAAgB,EACd,EACA,EACoD,CACpD,IAAM,EAAW,EAAK,SAAS,MAAM,EAErC,OADiB,EAAS,SAAS,GACrB,EAAI,CAAE,OAAM,SAAU,SAAU,KAAM,EAAK,SAAS,QAAQ,CAAE,EAAI,CAAE,OAAM,KAAM,CAAS,CACzG"}