piemot
piemot
Explore posts from servers
SIASapphire - Imagine a framework
Created by piemot on 1/25/2023 in #sapphire-support
Typing the Err generic of Result to be empty
Sorry if this is a basic Typescript question! Is it possible to type a function's output so that I can return Result.err() without any parameters? f.e.
function myFunction(): Result<true, ???> {
if (condition)
return Result.ok(true)
else
return Result.err()
}
function myFunction(): Result<true, ???> {
if (condition)
return Result.ok(true)
else
return Result.err()
}
5 replies