mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-18 06:31:27 +00:00
fix(nuxt3): ensure import names are unique
This commit is contained in:
parent
23a7db2a59
commit
5fef9e8db2
@ -270,7 +270,7 @@ function hasSuffix (path: string, suffix: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function getImportName (name: string) {
|
export function getImportName (name: string) {
|
||||||
return pascalCase(name).replace(/[^\w]/g, '')
|
return pascalCase(name).replace(/[^\w]/g, r => '_' + r.charCodeAt(0))
|
||||||
}
|
}
|
||||||
|
|
||||||
function uniqueBy <T, K extends keyof T> (arr: T[], key: K) {
|
function uniqueBy <T, K extends keyof T> (arr: T[], key: K) {
|
||||||
|
Loading…
Reference in New Issue
Block a user