Skip to content

Commit 2d7cf78

Browse files
committed
fix: remove globalProperties
`globalProperties` is not supported AFAIK and was removed from the original PR except in the `mergeGlobalProperties` utils. With the various parameters correctly typed, the code was throwing a compilation error as TS can spot that `globalProperties` is not a key of `GlobalMountOptions`.
1 parent 66d4d44 commit 2d7cf78

File tree

1 file changed

+18
-14
lines changed

1 file changed

+18
-14
lines changed

src/utils.ts

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,24 @@ const pascalCase = flow(camelCase, upperFirst)
1010
export { kebabCase, pascalCase }
1111

1212
export function mergeGlobalProperties(
13-
configGlobal = {},
14-
mountGlobal = {}
13+
configGlobal: GlobalMountOptions = {},
14+
mountGlobal: GlobalMountOptions = {}
1515
): GlobalMountOptions {
16-
return mergeWith({}, configGlobal, mountGlobal, (objValue, srcValue, key) => {
17-
switch (key) {
18-
case 'mocks':
19-
case 'provide':
20-
case 'components':
21-
case 'directives':
22-
case 'globalProperties':
23-
return { ...objValue, ...srcValue }
24-
case 'plugins':
25-
case 'mixins':
26-
return [...(objValue || []), ...(srcValue || [])].filter(Boolean)
16+
return mergeWith(
17+
{},
18+
configGlobal,
19+
mountGlobal,
20+
(objValue, srcValue, key: keyof GlobalMountOptions) => {
21+
switch (key) {
22+
case 'mocks':
23+
case 'provide':
24+
case 'components':
25+
case 'directives':
26+
return { ...objValue, ...srcValue }
27+
case 'plugins':
28+
case 'mixins':
29+
return [...(objValue || []), ...(srcValue || [])].filter(Boolean)
30+
}
2731
}
28-
})
32+
)
2933
}

0 commit comments

Comments
 (0)