]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
chore(types): convert type literals to records (#1615)
authorStanislav <62983943+stanislavstrelnikov@users.noreply.github.com>
Sun, 19 Jul 2020 02:56:28 +0000 (05:56 +0300)
committerGitHub <noreply@github.com>
Sun, 19 Jul 2020 02:56:28 +0000 (22:56 -0400)
packages/compiler-dom/src/decodeHtml.ts
packages/runtime-core/src/component.ts
packages/runtime-core/src/componentProps.ts
packages/runtime-core/src/devtools.ts
packages/runtime-core/src/vnode.ts

index 3d9823c63033dfc02f372cb09be086fde9bf1e35..b28592d95cee05430da32c702630ddd4703fe162 100644 (file)
@@ -102,7 +102,7 @@ export const decodeHtml: ParserOptions['decodeEntities'] = (
 }
 
 // https://html.spec.whatwg.org/multipage/parsing.html#numeric-character-reference-end-state
-const CCR_REPLACEMENTS: { [key: number]: number | undefined } = {
+const CCR_REPLACEMENTS: Record<number, number | undefined> = {
   0x80: 0x20ac,
   0x82: 0x201a,
   0x83: 0x0192,
index c621d0f161fcae52a10b9be7dc076f258c6e66c5..621d8ae6b472ef4521d474f3ee2a6dd718e379cc 100644 (file)
@@ -51,7 +51,7 @@ import {
 import { startMeasure, endMeasure } from './profiling'
 import { componentAdded } from './devtools'
 
-export type Data = { [key: string]: unknown }
+export type Data = Record<string, unknown>
 
 // Note: can't mark this whole interface internal because some public interfaces
 // extend it.
index e0814c74b2f562e71c1050fb73c2674e23adcf64..5e4c2c054113d5b5b7bc2e964dc9413707117bab 100644 (file)
@@ -80,7 +80,7 @@ type InferPropType<T> = T extends null
   : T extends { type: null | true }
     ? 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`
     : T extends ObjectConstructor | { type: ObjectConstructor }
-      ? { [key: string]: any }
+      ? Record<string, any>
       : T extends BooleanConstructor | { type: BooleanConstructor }
         ? boolean
         : T extends Prop<infer V> ? V : T
index 6e62ee76eabf72efbdf3b92006ef08fae24002a5..24fb23a31c9234689d6bf4300be233ce7fcbb42d 100644 (file)
@@ -6,7 +6,7 @@ export interface AppRecord {
   id: number
   app: App
   version: string
-  types: { [key: string]: string | Symbol }
+  types: Record<string, string | Symbol>
 }
 
 enum DevtoolsHooks {
index 30b5c240ad4fb7eb29179ce351769e3405f89ee3..f477933ab8362891a2d0da615732799ee9767694 100644 (file)
@@ -214,7 +214,7 @@ export function setBlockTracking(value: number) {
  */
 export function createBlock(
   type: VNodeTypes | ClassComponent,
-  props?: { [key: string]: any } | null,
+  props?: Record<string, any> | null,
   children?: any,
   patchFlag?: number,
   dynamicProps?: string[]