13 lines
453 B
TypeScript
13 lines
453 B
TypeScript
|
|
/*
|
||
|
|
* This file is part of the kernelstudio package.
|
||
|
|
*
|
||
|
|
* (c) 2014-2025 zlin <admin@kernelstudio.com>
|
||
|
|
*
|
||
|
|
* For the full copyright and license information, please view the LICENSE file
|
||
|
|
* that was distributed with this source code.
|
||
|
|
*/
|
||
|
|
|
||
|
|
export const generateKey = (type: string | null = ''): string => {
|
||
|
|
return `${type ? (type + '_') : ''}${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`
|
||
|
|
.replace('-', '_').toLowerCase();
|
||
|
|
};
|