Skip to content

Commit fa5ddf8

Browse files
chore(types): convert type literals to records (#1615)
1 parent b8db7ab commit fa5ddf8

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

packages/compiler-dom/src/decodeHtml.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export const decodeHtml: ParserOptions['decodeEntities'] = (
102102
}
103103

104104
// https://html.spec.whatwg.org/multipage/parsing.html#numeric-character-reference-end-state
105-
const CCR_REPLACEMENTS: { [key: number]: number | undefined } = {
105+
const CCR_REPLACEMENTS: Record<number, number | undefined> = {
106106
0x80: 0x20ac,
107107
0x82: 0x201a,
108108
0x83: 0x0192,

packages/runtime-core/src/component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ import {
5151
import { startMeasure, endMeasure } from './profiling'
5252
import { componentAdded } from './devtools'
5353

54-
export type Data = { [key: string]: unknown }
54+
export type Data = Record<string, unknown>
5555

5656
// Note: can't mark this whole interface internal because some public interfaces
5757
// extend it.

packages/runtime-core/src/componentProps.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ type InferPropType<T> = T extends null
8080
: T extends { type: null | true }
8181
? any // As TS issue https://github.com/Microsoft/TypeScript/issues/14829 // somehow `ObjectConstructor` when inferred from { (): T } becomes `any` // `BooleanConstructor` when inferred from PropConstructor(with PropMethod) becomes `Boolean`
8282
: T extends ObjectConstructor | { type: ObjectConstructor }
83-
? { [key: string]: any }
83+
? Record<string, any>
8484
: T extends BooleanConstructor | { type: BooleanConstructor }
8585
? boolean
8686
: T extends Prop<infer V> ? V : T

packages/runtime-core/src/devtools.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export interface AppRecord {
66
id: number
77
app: App
88
version: string
9-
types: { [key: string]: string | Symbol }
9+
types: Record<string, string | Symbol>
1010
}
1111

1212
enum DevtoolsHooks {

packages/runtime-core/src/vnode.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ export function setBlockTracking(value: number) {
214214
*/
215215
export function createBlock(
216216
type: VNodeTypes | ClassComponent,
217-
props?: { [key: string]: any } | null,
217+
props?: Record<string, any> | null,
218218
children?: any,
219219
patchFlag?: number,
220220
dynamicProps?: string[]

0 commit comments

Comments
 (0)