We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b593d7c commit 62bc8a5Copy full SHA for 62bc8a5
readme.md
@@ -346,13 +346,13 @@ A contract specifies the obligations and guarantees of the behavior from a funct
346
// Define our contract : int -> boolean
347
const contract = (input) => {
348
if (typeof input === 'number') return true
349
- throw new Error('Contract violated: expected int -> int')
+ throw new Error('Contract violated: expected int -> boolean')
350
}
351
352
const addOne = (num) => contract(num) && num + 1
353
354
addOne(2) // 3
355
-addOne('some string') // Contract violated: expected int -> int
+addOne('some string') // Contract violated: expected int -> boolean
356
```
357
358
## Category
0 commit comments