Skip to content

Commit 352ca80

Browse files
authored
Update README.md
1 parent 4ad6ba4 commit 352ca80

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@ You'll learn about how programming language compilers parse source code, extract
1313
Write a function that takes an rtype interface description as a string and returns an object that can be used for runtime type checking.
1414

1515
```js
16-
parseSignature(signature: String) => {
16+
interface TypeChecker {
1717
checkInputs: Predicate,
1818
checkOutput: Predicate,
1919
checkError: Predicate
2020
}
21+
22+
parseSignature(signature: String) => TypeChecker
2123
```
2224

2325
The target function will get wrapped by a utility such as [rfx](https://github.com/ericelliott/rfx). When the wrapper function gets called, it will pass inputs to `checkInputs()`. If it returns true, only then does the original function get called. When the function returns, its output will be similarly checked by `checkOutput()` before it gets returned to the original caller. If the function throws, the error will also be checked, by `checkError()`.

0 commit comments

Comments
 (0)