Skip to content

Commit b272e81

Browse files
committed
fix(typos): fix typos in chapters 13 to 15
1 parent 72ce7b2 commit b272e81

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

book-content/chapters/13-modules-scripts-declaration-files.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -383,12 +383,12 @@ declare module "duration-utils" {
383383

384384
We use `export` to define what is being exported from the module.
385385

386-
Like before, we are not including any implementation code in the `.d.ts` file– it's just the types that are being declared.
386+
Like before, we are not including any implementation code in the `.d.ts` file – it's just the types that are being declared.
387387

388388
Once the `duration-utils.d.ts` file is created, the module can be imported and used as usual:
389389

390390
```typescript
391-
import { formatDuration, parseTrackData } from "music-utils";
391+
import { formatDuration, parseTrackData } from "duration-utils";
392392

393393
const formattedTime = formatDuration(309);
394394
```
@@ -468,7 +468,7 @@ const numbers = [1, 2, 3];
468468
numbers.map((n) => n * 2);
469469
```
470470

471-
Let's step back for a minute. How does TypeScript know that `.map` exists on an array? How does it know that `.map` exists, but `.transform` doesn't? Where is this defined
471+
Let's step back for a minute. How does TypeScript know that `.map` exists on an array? How does it know that `.map` exists, but `.transform` doesn't? Where is this defined?
472472

473473
As it turns out, TypeScript ships with a bunch of declaration files that describe the JavaScript environment. We can do a 'go to definition' on `.map` to see where that is:
474474

book-content/chapters/14-configuring-typescript.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -909,7 +909,7 @@ The common settings can be moved to `tsconfig.base.json`:
909909
}
910910
```
911911

912-
Then, the `client/tsconfig.json` would extend the base configuration wit the `extends` option that points to the `tsconfig.base.json` file:
912+
Then, the `client/tsconfig.json` would extend the base configuration with the `extends` option that points to the `tsconfig.base.json` file:
913913

914914
```tsx
915915
// client/tsconfig.json

book-content/chapters/15-designing-your-types.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ TypeScript shows an error that tells us that `ResourceStatus` requires two type
232232

233233
In some cases, you may want to provide default types for generic type parameters. Like with functions, you can use the `=` to assign a default value.
234234

235-
By setting `TMetadata`'s default value to an empty, we can essentially make `TMetadata` optional:
235+
By setting `TMetadata`'s default value to an empty object, we can essentially make `TMetadata` optional:
236236

237237
```tsx
238238
type ResourceStatus<TContent, TMetadata = {}> =
@@ -549,7 +549,7 @@ Conditional types turn TypeScript's type system into a full programming language
549549

550550
## Mapped Types
551551

552-
Mapped types in TypeScript allow you to create a new object type based on an existing type by iterating over its keys and values. This can be let you be extremely expressive when creating new object types.
552+
Mapped types in TypeScript allow you to create a new object type based on an existing type by iterating over its keys and values. This can let you be extremely expressive when creating new object types.
553553

554554
Consider this `Album` interface:
555555

0 commit comments

Comments
 (0)