Skip to content

Commit

Permalink
fix contract function return type
Browse files Browse the repository at this point in the history
  • Loading branch information
emarukyan committed Feb 6, 2019
1 parent aea00f1 commit b593d7c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ const predicate = (a) => a > 2
A contract specifies the obligations and guarantees of the behavior from a function or expression at runtime. This acts as a set of rules that are expected from the input and output of a function or expression, and errors are generally reported whenever a contract is violated.

```js
// Define our contract : int -> int
// Define our contract : int -> boolean
const contract = (input) => {
if (typeof input === 'number') return true
throw new Error('Contract violated: expected int -> int')
Expand Down

0 comments on commit b593d7c

Please sign in to comment.