Skip to content

Commit

Permalink
Add a null provider
Browse files Browse the repository at this point in the history
  • Loading branch information
mfussenegger committed Dec 9, 2018
1 parent a9a6b45 commit 560f0b4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ a field within the JSON object.

- uuid1
- uuid4
- null
- randomInt(lower, upper)
- randomDouble(lower, upper)
- array(expr [, ...])
Expand Down
1 change: 1 addition & 0 deletions src/Fake.hs
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ eval (StringLiteral x) = pure $ String x
eval (DoubleLiteral x) = pure $ Number x
eval (FunctionCall "uuid4" []) = String . UUID.toText <$> withStdGen random
eval (FunctionCall "uuid1" []) = String . UUID.toText <$> uuid1
eval (FunctionCall "null" []) = pure Null
eval (FunctionCall "randomInt" [lower, upper]) = randomInt lower upper
eval (FunctionCall "randomDouble" [lower, upper]) = randomDouble lower upper
eval (FunctionCall "array" args) = Array . V.fromList <$> mapM eval args
Expand Down

0 comments on commit 560f0b4

Please sign in to comment.