Skip to content

Commit 8e3aa0b

Browse files
committed
update README
1 parent 53a5082 commit 8e3aa0b

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { type Result, trys } from "trycat"
1616

1717
function readTextFileSync(path: string): Result<string, string> {
1818
return trys(() => {
19-
fs.readFileSync(path, "utf-8")
19+
return fs.readFileSync(path, "utf-8")
2020
}).mapErr((err) => {
2121
if (err instance of Error) {
2222
return err.message
@@ -61,7 +61,7 @@ type ApiError = "InternalError" | "NetworkError" | "ServerError" | "UnexpectedRe
6161
const WeatherSchema = z.object({ ... })
6262
type Weather = z.infer<typeof WeatherSchema>
6363

64-
function fetchWeather(): Result<Weather, ApiError> {
64+
function fetchWeather(): Promise<Result<Weather, ApiError>> {
6565
const res = await tryp(fetch("/api/weather"))
6666
if (res.isErr()) {
6767
return err("NetworkError")
@@ -86,7 +86,7 @@ function fetchWeather(): Result<Weather, ApiError> {
8686
return err(weather.error)
8787
}
8888

89-
return ok(json.value)
89+
return ok(weather.value)
9090
}
9191
```
9292

0 commit comments

Comments
 (0)