mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-20 12:11:20 -08:00
refactor(tooling): [MOD-02] split library build and development into typed modules
This commit is contained in:
1 parent
28c7abb2bb
commit
401d4cdd65
36 files changed
+1644
-427
No files matched your search
@@ -0,0 +1,11 @@
|
||||
export function toPascalCase(name: string): string {
|
||||
return name.replace(/(^|-)([a-z])/g, (_, _prefix: string, letter: string) => letter.toUpperCase())
|
||||
}
|
||||
|
||||
export function toCamelCase(name: string): string {
|
||||
return name.replace(/-([a-z])/g, (_, letter: string) => letter.toUpperCase())
|
||||
}
|
||||
|
||||
export function getGlobalName(name: string): string {
|
||||
return name === 'artplayer' || name.startsWith('artplayer-tool-') ? toPascalCase(name) : toCamelCase(name)
|
||||
}
|
||||
Reference in new issue
Block a user