UNPKG

@breadcrum/extract-meta

Version:
6 lines (5 loc) 277 B
/** * @param {HTMLElement | Element | null} [node] - The DOM node to extract content from. * @returns { string | null | undefined } The content or value attribute of the node. */ export const getContent = node => node?.getAttribute('content') || node?.getAttribute('value')