mirror of
https://github.com/vector-im/element-web.git
synced 2026-05-07 05:06:38 +02:00
fix(docs): restore missing toHex function declaration
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
parent
6ea1ac6565
commit
5c5b3d7215
@ -130,6 +130,12 @@ function restoreCaretOffset(editor: HTMLElement, offset: number): void {
|
||||
sel?.addRange(range);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Encode a UTF-8 string as a lowercase hex string, as required by
|
||||
* the Automerge `set_actor_id` API.
|
||||
*/
|
||||
function toHex(str: string): string {
|
||||
return Array.from(new TextEncoder().encode(str))
|
||||
.map((b) => b.toString(16).padStart(2, "0"))
|
||||
.join("");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user