Skip to content

Commit fd68ae7

Browse files
authored
Merge pull request #83 from cexbrayat/fix/utils
fix: remove globalProperties
2 parents 53859e6 + 2d7cf78 commit fd68ae7

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)