You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
511 B
21 lines
511 B
import { EmojiRecord } from './types';
|
|
|
|
export function createElement(tagName: string, className?: string): HTMLElement {
|
|
const element = document.createElement(tagName);
|
|
|
|
if (className) {
|
|
element.className = className;
|
|
}
|
|
|
|
return element;
|
|
}
|
|
|
|
export function empty(element: HTMLElement): void {
|
|
while (element.firstChild) {
|
|
element.removeChild(element.firstChild);
|
|
}
|
|
}
|
|
|
|
export function getEmojiName(emoji: EmojiRecord): string {
|
|
return typeof emoji.n === 'string' ? emoji.n : emoji.n[0];
|
|
}
|
|
|