From a57715890965e3c563a99c4c01df8c3376566b3d Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Thu, 24 Oct 2024 06:24:09 +0000 Subject: [PATCH] [autofix.ci] apply automated fixes --- packages/runtime-core/__tests__/debug.spec.ts | 21 ++++++++-------- packages/runtime-core/src/debug.ts | 24 +++++++++++-------- 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/packages/runtime-core/__tests__/debug.spec.ts b/packages/runtime-core/__tests__/debug.spec.ts index bb98d0cc1..3a4c4b56d 100644 --- a/packages/runtime-core/__tests__/debug.spec.ts +++ b/packages/runtime-core/__tests__/debug.spec.ts @@ -1,10 +1,13 @@ -import {debug} from '../src/debug' +import { debug } from '../src/debug' import { - h, - render, + type ComponentInternalInstance, defineComponent, - ref, getCurrentInstance, ComponentInternalInstance, nodeOps, - serializeInner as inner + getCurrentInstance, + h, + serializeInner as inner, + nodeOps, + ref, + render, } from '@vue/runtime-test' describe('debug', () => { @@ -17,9 +20,7 @@ describe('debug', () => { debug({ name, }) - return () => ( - h('div', name.value) - ) + return () => h('div', name.value) }, mounted() { instance = getCurrentInstance()! @@ -48,9 +49,7 @@ describe('debug', () => { debug({ name, }) - return () => ( - h('div', name.value) - ) + return () => h('div', name.value) }, mounted() { instance = getCurrentInstance()! diff --git a/packages/runtime-core/src/debug.ts b/packages/runtime-core/src/debug.ts index 7e476ed51..8ce522694 100644 --- a/packages/runtime-core/src/debug.ts +++ b/packages/runtime-core/src/debug.ts @@ -1,5 +1,5 @@ -import {reactive} from '@vue/reactivity' -import {getCurrentInstance} from './component' +import { reactive } from '@vue/reactivity' +import { getCurrentInstance } from './component' /** * this debug function is a helper for watching states in the vue devtool (it runs only in dev mode) @@ -16,11 +16,15 @@ import {getCurrentInstance} from './component' * }) * @param states any states you want to see in the vue devtool */ -export const debug = __DEV__ ? (states: Record) => { - const instance = getCurrentInstance() - if (instance) { - instance.setupState = reactive(Object.assign({}, states, instance.setupState)) - } -} : (states: Record) => { - // empty -} +export const debug = __DEV__ + ? (states: Record) => { + const instance = getCurrentInstance() + if (instance) { + instance.setupState = reactive( + Object.assign({}, states, instance.setupState), + ) + } + } + : (states: Record) => { + // empty + }