restyler-0.2.0.0
Safe HaskellNone
LanguageHaskell2010

Restyler.Config.ExpectedKeys

Synopsis

Documentation

validateObjectKeys :: [String] -> HashMap Text v -> Parser () Source #

Validate there are no unexpected keys in an Object

This is provided for convenience in the most common use-case. For a more flexible interface, see validateExpectedKeyBy.

validateExpectedKeyBy Source #

Arguments

:: String

The label to show as Unknown <label> ...

-> (a -> String)

A function to project each valid value as a comparable key

-> [a]

The input list of valid items

-> String

The input key

-> Either String a 

Validate that a key is present in a list of (projected) items

Returns the item found when validation passes.