From 2f2ab1eeb00cc2058feadc4af42486a3620c34b7 Mon Sep 17 00:00:00 2001 From: thetek Date: Mon, 1 Apr 2024 17:02:38 +0200 Subject: [PATCH] feat: colorize checker output --- src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index 6c84586..9cd4bfa 100644 --- a/src/index.ts +++ b/src/index.ts @@ -195,9 +195,9 @@ for (const msg of SAMPLES) { const validationResult = validator(msg); if (validationResult.success) { - console.log(`msg ${msg.id}: OK`); + console.log(`msg ${msg.id}: \x1b[32mOK\x1b[0m`); } else { - console.log(`msg ${msg.id}: ERROR`); + console.log(`msg ${msg.id}: \x1b[31mERROR\x1b[0m`); for (const error of validationResult.errors) { console.log(` - ${error.path}, expected ${error.expected}, found value ${error.value}`); }