From 20ec17b31ce6795e23fee793901f4d2454cd85d4 Mon Sep 17 00:00:00 2001 From: Romuald Brillout Date: Fri, 31 Jan 2025 22:54:32 +0100 Subject: [PATCH] fix: colorize error message --- telefunc/node/server/runTelefunc/assertTelefunction.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/telefunc/node/server/runTelefunc/assertTelefunction.ts b/telefunc/node/server/runTelefunc/assertTelefunction.ts index dd36eda2..ccdea43d 100644 --- a/telefunc/node/server/runTelefunc/assertTelefunction.ts +++ b/telefunc/node/server/runTelefunc/assertTelefunction.ts @@ -2,11 +2,15 @@ export { assertTelefunction } import { assertUsage, isCallable } from '../../utils' import type { Telefunction } from '../types' +import pc from '@brillout/picocolors' function assertTelefunction( exportValue: unknown, exportName: string, telefuncFilePath: string, ): asserts exportValue is Telefunction { - assertUsage(isCallable(exportValue), `\`export { ${exportName} }\` of ${telefuncFilePath} should be a function`) + assertUsage( + isCallable(exportValue), + `${pc.code(`export { ${exportName} }`)} of ${pc.bold(telefuncFilePath)} should be a function`, + ) }