is there a mustNotBe
currently I am using this as a workaround but I'd rather not implement the (was actual) part myself
I would like maybe a mustNotBe or maybe a problem variant that doesn't overwrite the was stuff in the error string
Thanks for any help 🙂
9 Replies
Hmm, I think the best way to make it composable would be to try and find a way to fit into
must be ___
. In a lot of cases, it wasn't the first thing I thought of but I found a reasonable way to make it work for various messages.
In this case, maybe something like ctx.mustBe("a string not ending in .project")
or similarThats what I thought as well but "a string" isnt a nice message for like showing form errors for example sicne most people wouldn't know what a string is
"non-project suffixed"
And error summaries in ark already so good that they can be show verbatim on a form so I'd rather not implement custom formatters just for this case
Yeah, the problem is the way it composes though that's why generally it's valuable to use
must be ___
Because if some errors are must not be
it adds a ton of complexity to the logic for union messages
So you might be stuck between a rock and hard place in terms of a creative solution for the positive version or having to respecify actualGot it, thanks for the insights
Sorry I don't have a better answer! Hopefully you find something acceptable
Yeah I think interpolating actual isnt that bad, just kinda annoying
not ending in .project
or ending in something other than .project
I don't know lol maybe there's something good out there