Skip to content

Commit

Permalink
fix: ReadOnly<T> has a typo in its documentation (#156) (#157)
Browse files Browse the repository at this point in the history
  • Loading branch information
cyli2014 authored Oct 25, 2020
1 parent ff848f2 commit df2502e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -975,7 +975,7 @@ import { $ReadOnly } from 'utility-types';

type Props = { name: string; age: number; visible: boolean };

// Expect: Readonly<{ name: string; age?: number | undefined; visible: boolean; }>
// Expect: Readonly<{ name: string; age: number; visible: boolean; }>
type ReadOnlyProps = $ReadOnly<Props>;
```

Expand Down
2 changes: 1 addition & 1 deletion src/utility-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export type $Values<T extends object> = T[keyof T];
* @example
* type Props = { name: string; age: number; visible: boolean };
*
* // Expect: Readonly<{ name: string; age?: number | undefined; visible: boolean; }>
* // Expect: Readonly<{ name: string; age: number; visible: boolean; }>
* type ReadOnlyProps = $ReadOnly<Props>;
*/
export type $ReadOnly<T extends object> = DeepReadonly<T>;
Expand Down

0 comments on commit df2502e

Please sign in to comment.