Module

Yoga.Fastify.Route.ParseHeaders

Package
purescript-yoga-fastify
Repository
rowtype-yoga/purescript-yoga-fastify

#ParseHeaders Source

class ParseHeaders :: Row Type -> Constraintclass ParseHeaders (headers :: Row Type)  where

Parse a record of headers from an Object, accumulating all errors

Returns Either (NonEmptyArray HeaderError) (Record headers) to collect all parsing errors

Examples: parseHeaders (Proxy :: Proxy (auth :: String)) obj -- Left (NEA.singleton (MissingHeader "auth")) if missing -- Right { auth: "Bearer token" } if present

Members

Instances

#ParseHeadersRL Source

class ParseHeadersRL :: RowList Type -> Row Type -> Constraintclass ParseHeadersRL (rl :: RowList Type) (headers :: Row Type) | rl -> headers where

Helper class using RowList to accumulate errors

Members

Instances