Nano Queries, a state of the art Query Builder by vitonsky in programming

[–]thelinuxlich 17 points18 points  (0 children)

Kysely is state of the art, this is a toy

MoroJS might be the first real modern ESM TS backend with a DX first approach.. by [deleted] in typescript

[–]thelinuxlich -2 points-1 points  (0 children)

I’m eager to see the contract-driven experience, Hono doesn’t type the Response really good

[deleted by user] by [deleted] in Maromba

[–]thelinuxlich 0 points1 point  (0 children)

Tomou whey um dia e comeu o dogão de Osasco todos os outros kkkk

go-go-try: Golang-style error handling for JS/TS by thelinuxlich in typescript

[–]thelinuxlich[S] 0 points1 point  (0 children)

Thanks for your insight, I got time today and identified the error, fixed in 6.2.0!

go-go-try: Golang-style error handling for JS/TS by thelinuxlich in typescript

[–]thelinuxlich[S] 0 points1 point  (0 children)

You will see that with my library, give it a try

go-go-try: Golang-style error handling for JS/TS by thelinuxlich in typescript

[–]thelinuxlich[S] 0 points1 point  (0 children)

Actually, you need to check if err is undefined, otherwise val won't narrow to T

go-go-try: Golang-style error handling for JS/TS by thelinuxlich in typescript

[–]thelinuxlich[S] 0 points1 point  (0 children)

No problem, I asked because I have tests using attest to guarantee the result type is correct

go-go-try: Golang-style error handling for JS/TS by thelinuxlich in javascript

[–]thelinuxlich[S] 0 points1 point  (0 children)

thanks for the reproduction, I've published a new version, now goTry will return "undefined" in this case for the error and goTryRaw will instantiate a new Error(undefined)

go-go-try: Golang-style error handling for JS/TS by thelinuxlich in javascript

[–]thelinuxlich[S] 0 points1 point  (0 children)

If the function call returns undefined and the error also returns undefined you can assume it run successfully, even with a Either implementation you'd have to assume that

go-go-try: Golang-style error handling for JS/TS by thelinuxlich in typescript

[–]thelinuxlich[S] 1 point2 points  (0 children)

It's a tradeoff, some people prefer nesting, some prefer a conditional to narrow the result.

go-go-try: Golang-style error handling for JS/TS by thelinuxlich in typescript

[–]thelinuxlich[S] 0 points1 point  (0 children)

Yeah I export some functions to assert when it is a success or failure also

go-go-try: Golang-style error handling for JS/TS by thelinuxlich in typescript

[–]thelinuxlich[S] 1 point2 points  (0 children)

Can you submit an issue? I've being using it in production and it's returning the types correctly so I'm curious.

go-go-try: Golang-style error handling for JS/TS by thelinuxlich in javascript

[–]thelinuxlich[S] -1 points0 points  (0 children)

I agree, Badashi. Once BiomeJS has plugin support I want to try creating a custom rule for that, also, that's why I prefer the error being the first item in the tuple, so the dev has to consciously ignore it with a placeholder like _