Skip to content

Commit

Permalink
Code style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Sep 22, 2021
1 parent fc4af4a commit 6b6d81c
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions readme.md
Expand Up @@ -129,8 +129,8 @@ Click the type names for complete docs.
### Template literal types

- [`CamelCase`](source/camel-case.d.ts) – Convert a string literal to camel-case (`fooBar`).
- [`CamelCasedProperties`](source/camel-cased-properties.d.ts) – Convert object properties to camel-case (`fooBar`).
- [`CamelCasedPropertiesDeep`](source/camel-cased-properties-deep.d.ts) – Convert object properties to camel-case recursively (`fooBar`).
- [`CamelCasedProperties`](source/camel-cased-properties.d.ts) – Convert object properties to camel-case (`fooBar`).
- [`CamelCasedPropertiesDeep`](source/camel-cased-properties-deep.d.ts) – Convert object properties to camel-case recursively (`fooBar`).
- [`KebabCase`](source/kebab-case.d.ts) – Convert a string literal to kebab-case (`foo-bar`).
- [`KebabCasedProperties`](source/kebab-cased-properties.d.ts) – Convert a object properties to kebab-case recursively (`foo-bar`).
- [`KebabCasedPropertiesDeep`](source/kebab-cased-properties-deep.d.ts) – Convert object properties to kebab-case (`foo-bar`).
Expand Down Expand Up @@ -680,7 +680,7 @@ There are many advanced types most users don't know about.
type AnimalShortInfo = Omit<Animal, 'images' | 'paragraphs'>;

function renderAnimalHoverInfo (animals: AnimalShortInfo[]): HTMLElement {
const container = document.createElement('div');
const container = document.createElement('div');
// Internal implementation.
return container;
}
Expand Down
2 changes: 1 addition & 1 deletion source/get.d.ts
Expand Up @@ -49,7 +49,7 @@ type ConsistsOnlyOf<LongString extends string, Substring extends string> =
? true
: LongString extends `${Substring}${infer Tail}`
? ConsistsOnlyOf<Tail, Substring>
: false;
: false;

/**
Convert a type which may have number keys to one with string keys, making it possible to index using strings retrieved from template types.
Expand Down
4 changes: 2 additions & 2 deletions source/mutable.d.ts
Expand Up @@ -35,6 +35,6 @@ export type Mutable<BaseType, Keys extends keyof BaseType = keyof BaseType> =
Simplify<
// Pick just the keys that are not mutable from the base type.
Except<BaseType, Keys> &
// Pick the keys that should be mutable from the base type and make them mutable by removing the `readonly` modifier from the key.
{-readonly [KeyType in keyof Pick<BaseType, Keys>]: Pick<BaseType, Keys>[KeyType]}
// Pick the keys that should be mutable from the base type and make them mutable by removing the `readonly` modifier from the key.
{-readonly [KeyType in keyof Pick<BaseType, Keys>]: Pick<BaseType, Keys>[KeyType]}
>;
2 changes: 1 addition & 1 deletion source/partial-deep.d.ts
Expand Up @@ -47,7 +47,7 @@ export type PartialDeep<T> = T extends Primitive
: unknown;

/**
Same as `PartialDeep`, but accepts only `Map`s and as inputs. Internal helper for `PartialDeep`.
Same as `PartialDeep`, but accepts only `Map`s and as inputs. Internal helper for `PartialDeep`.
*/
interface PartialMapDeep<KeyType, ValueType> extends Map<PartialDeep<KeyType>, PartialDeep<ValueType>> {}

Expand Down
4 changes: 2 additions & 2 deletions source/promisable.d.ts
Expand Up @@ -12,8 +12,8 @@ Please upvote [this issue](https://github.com/microsoft/TypeScript/issues/31394)
import {Promisable} from 'type-fest';
async function logger(getLogEntry: () => Promisable<string>): Promise<void> {
const entry = await getLogEntry();
console.log(entry);
const entry = await getLogEntry();
console.log(entry);
}
logger(() => 'foo');
Expand Down

0 comments on commit 6b6d81c

Please sign in to comment.