Skip to content

Commit

Permalink
fix: colorize error message
Browse files Browse the repository at this point in the history
  • Loading branch information
brillout committed Jan 31, 2025
1 parent e8c7d33 commit 6af7993
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion telefunc/node/server/runTelefunc/assertTelefunction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ 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`)
}

0 comments on commit 6af7993

Please sign in to comment.