@scania/tegel
Version:
Tegel Design System
12 lines (9 loc) • 342 B
JavaScript
;
/**
* Checks if the provided element has a slotted element
* in the slot with the corresponding slotName
* @param slotName the name of the slot.
* @param element the element to look for the slot within.
*/
const hasSlot = (slotName, element) => !!element.querySelector(`[slot="${slotName}"]`);
exports.hasSlot = hasSlot;