Skip to content

Commit cc9db0e

Browse files
committed
Fix typos in examples
1 parent 5f58e54 commit cc9db0e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

examples/decode-constrained.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ test("decode constrained", () => {
2121
});
2222

2323
// `.decoder` of a codec usually accepts `unknown` – you can pass in anything.
24-
// This function constrains us constrain so we can only decode what the codec
24+
// This function constrains us so that we can only decode what the codec
2525
// has encoded.
2626
function decodeConstrained<Decoded, Encoded>(
2727
codec: Codec<Decoded, Encoded>,

examples/recursive.test.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ test("recursive data structure", () => {
2020
};
2121

2222
// This wouldn’t work to decode it, because we’re trying to use
23-
// `personDecoder` in the definition of `personDecoder` itself.
23+
// `personCodec` in the definition of `personCodec` itself.
2424
/*
2525
const personCodec = fields<Person>({
2626
name: string,
27-
friends: array(personDecoder2), // ReferenceError: Cannot access 'personDecoder2' before initialization
27+
friends: array(personCodec), // ReferenceError: Cannot access 'personCodec' before initialization
2828
});
2929
*/
3030

31-
// `recursive` lets us delay when `personDecoder` is referenced, solving the
31+
// `recursive` lets us delay when `personCodec` is referenced, solving the
3232
// issue.
3333
const personCodec: Codec<Person> = fields({
3434
name: string,

0 commit comments

Comments
 (0)