The types say functions provided for the cast option must return string.
|
export type Cast<T> = (value: T, context: CastingContext) => string |
But the docs show that you can return an object with a value key as well as some other options.
I will plan to submit a fix for this.