@diplodoc/transform
Version:
A simple transformer of text in YFM (Yandex Flavored Markdown) to HTML
10 lines (8 loc) • 314 B
text/typescript
export const getEventTarget = (event: Event) => {
const path = event.composedPath();
return Array.isArray(path) && path.length > 0 ? path[0] : event.target;
};
export const isCustom = (event: Event) => {
const target = getEventTarget(event);
return !target || !(target as HTMLElement).matches;
};