mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2025-07-28 11:31:54 +00:00

* feat: support withYHistory * fix: inline elements * fix: insert break in single line * fix: add enter key behavior tests * fix: add test cases * fix: add test cases
11 lines
361 B
TypeScript
11 lines
361 B
TypeScript
const generateRandomId = (length: number): string => {
|
|
const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
|
let result = '';
|
|
for (let i = 0; i < length; i++) {
|
|
result += characters.charAt(Math.floor(Math.random() * characters.length));
|
|
}
|
|
return result;
|
|
};
|
|
|
|
export const nanoid = jest.fn(() => generateRandomId(8));
|