Polyform.Validators.UrlEncoded
- Package
- purescript-polyform-validators
- Repository
- lambdaterms/purescript-polyform-validators
#boolean Source
boolean :: forall m. Monad m => FieldValueValidator m Boolean
Encodes default browser behavior which sets checkbox
value to "on"
when checked and skips it completely when it is not.
We consider also "off" value because we want to be more consistent when
building API comunication layer - if you have any objections please fill
an issue with description.
#optional Source
optional :: forall m a. Monad m => FieldValueValidator m a -> FieldValueValidator m (Maybe a)
#query Source
query :: forall e m. Monad m => Options -> Validator m e String Decoded
This module provides validators for urlencoded values.
In general it follows "browsers standard" for encoding
so it should be useful in the context of request validation.
On the other hand if you want to build backend form
validation solution on top of this it is probably
better to take a look at Polyform.Validator.Reporter
.
Re-exports from Polyform.Validators.UrlEncoded.Parser
#Options Source
type Options = { replacePlus :: Boolean }
Browsers serialize space as +
character
which is incorrect according to the RFC 3986
but it is spread behavior accross tested engines.
I've written about this issue extensively: https://github.com/owickstrom/hyper/pull/62
If we want to be able to optionally distinct this +
on the server side we have to convert it to %2b
before
decoding phase (as it is done in all investigated
libraries - please check first post in the above thread).
Re-exports from Polyform.Validators.UrlEncoded.Types
#_urlValueParsing Source
_urlValueParsing :: SProxy "urlValueParsing"
#_urlDecoding Source
_urlDecoding :: SProxy "urlDecoding"