Add simple search modal, fix preview modal not closing on cancel
This commit is contained in:
parent
752f13f8bf
commit
2662c78080
6 changed files with 296 additions and 6 deletions
|
|
@ -219,3 +219,13 @@ export function migrateObject<T extends object>(object: T, oldData: any, default
|
|||
object[key] = oldData.hasOwnProperty(key) ? oldData[key] : defaultData[key];
|
||||
}
|
||||
}
|
||||
|
||||
export function unCamelCase(str: string): string {
|
||||
return str
|
||||
// insert a space between lower & upper
|
||||
.replace(/([a-z])([A-Z])/g, '$1 $2')
|
||||
// space before last upper in a sequence followed by lower
|
||||
.replace(/\b([A-Z]+)([A-Z])([a-z])/, '$1 $2$3')
|
||||
// uppercase the first character
|
||||
.replace(/^./, function(str){ return str.toUpperCase(); });
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue