K
Kysely•15mo ago
thelinuxlich

How do I cast the type of a eb.fn('...') ?

I tried with eb.fn<string>("CONCAT", [....]) but it didn't worked
Solution:
If it doesn't work for some reason, you can use
eb.fn('now', []).$castTo<Date>()
eb.fn('now', []).$castTo<Date>()
...
Jump to solution
3 Replies
koskimas
koskimas•15mo ago
That should work I think 🤔 Works here https://kyse.link/?p=s&i=t6D3BH87tCkm2j44jVT5 Can you modify that to make it not work?
Solution
koskimas
koskimas•15mo ago
If it doesn't work for some reason, you can use
eb.fn('now', []).$castTo<Date>()
eb.fn('now', []).$castTo<Date>()
thelinuxlich
thelinuxlichOP•15mo ago
in my case it's inside a case()...but I'm baffled it works on the playground but not on my side https://kyse.link/?p=s&i=t6D3BH87tCkm2j44jVT5 and now it works on my side too, after I cleared a field and autocompleted it...TS shenanigans
Want results from more Discord servers?
Add your server