From 6b6d81ce894517268391db63b3d6538e971c8126 Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Wed, 22 Sep 2021 16:41:30 +0700 Subject: [PATCH] Code style fixes --- readme.md | 6 +++--- source/get.d.ts | 2 +- source/mutable.d.ts | 4 ++-- source/partial-deep.d.ts | 2 +- source/promisable.d.ts | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/readme.md b/readme.md index 311e6b675..b2199d3ce 100644 --- a/readme.md +++ b/readme.md @@ -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`). @@ -680,7 +680,7 @@ There are many advanced types most users don't know about. type AnimalShortInfo = Omit; function renderAnimalHoverInfo (animals: AnimalShortInfo[]): HTMLElement { - const container = document.createElement('div'); + const container = document.createElement('div'); // Internal implementation. return container; } diff --git a/source/get.d.ts b/source/get.d.ts index 0131b727b..58d888db0 100644 --- a/source/get.d.ts +++ b/source/get.d.ts @@ -49,7 +49,7 @@ type ConsistsOnlyOf = ? true : LongString extends `${Substring}${infer Tail}` ? ConsistsOnlyOf - : 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. diff --git a/source/mutable.d.ts b/source/mutable.d.ts index 852dece56..d0db3c36f 100644 --- a/source/mutable.d.ts +++ b/source/mutable.d.ts @@ -35,6 +35,6 @@ export type Mutable = Simplify< // Pick just the keys that are not mutable from the base type. Except & - // 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]: Pick[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]: Pick[KeyType]} >; diff --git a/source/partial-deep.d.ts b/source/partial-deep.d.ts index 572b77cab..2059454e1 100644 --- a/source/partial-deep.d.ts +++ b/source/partial-deep.d.ts @@ -47,7 +47,7 @@ export type PartialDeep = 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 extends Map, PartialDeep> {} diff --git a/source/promisable.d.ts b/source/promisable.d.ts index e26395931..0acaaf230 100644 --- a/source/promisable.d.ts +++ b/source/promisable.d.ts @@ -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): Promise { - const entry = await getLogEntry(); - console.log(entry); + const entry = await getLogEntry(); + console.log(entry); } logger(() => 'foo');