Skip to content

Commit c8eba5a

Browse files
perf: use Set.has instead of Array.includes (#140)
1 parent 977ee3c commit c8eba5a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/devtools-kit/src/core/component/state/constants.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export const vueBuiltins = [
1+
export const vueBuiltins = new Set([
22
'nextTick',
33
'defineComponent',
44
'defineAsyncComponent',
@@ -50,7 +50,7 @@ export const vueBuiltins = [
5050
'resolveDirective',
5151
'withDirectives',
5252
'withModifiers',
53-
]
53+
])
5454

5555
export const symbolRE = /^\[native Symbol Symbol\((.*)\)\]$/
5656
export const rawTypeRE = /^\[object (\w+)]$/

packages/devtools-kit/src/core/component/state/process.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ function getStateTypeAndName(info: ReturnType<typeof getSetupStateType>) {
131131
function processSetupState(instance: VueAppInstance) {
132132
const raw = instance.devtoolsRawSetupState || {}
133133
return Object.keys(instance.setupState)
134-
.filter(key => !vueBuiltins.includes(key) && key.split(/(?=[A-Z])/)[0] !== 'use')
134+
.filter(key => !vueBuiltins.has(key) && key.split(/(?=[A-Z])/)[0] !== 'use')
135135
.map((key) => {
136136
const value = returnError(() => toRaw(instance.setupState[key])) as unknown as {
137137
render: Function

0 commit comments

Comments
 (0)