Critical Stability & Performance fixes. Excessive Log Set button gone on QIuck Log screen
This commit is contained in:
5
src/utils/text.ts
Normal file
5
src/utils/text.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
export const toTitleCase = (str: string): string => {
|
||||
return str.replace(/\w\S*/g, (txt) => {
|
||||
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
|
||||
});
|
||||
};
|
||||
10
src/utils/uuid.ts
Normal file
10
src/utils/uuid.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
export const generateId = (): string => {
|
||||
if (typeof crypto !== 'undefined' && typeof crypto.randomUUID === 'function') {
|
||||
return crypto.randomUUID();
|
||||
}
|
||||
// Fallback for non-secure contexts
|
||||
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
||||
var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
|
||||
return v.toString(16);
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user