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 04a287a commit 20ec17b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion telefunc/node/server/runTelefunc/assertTelefunction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`,
)
}

0 comments on commit 20ec17b

Please sign in to comment.