Kilu.He c1cf58b99e
feat: support withYHistory and editing document on web (#6438)
* 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
2024-10-03 13:54:42 +08:00

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));