UNPKG

417 BJavaScriptView Raw
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.isUnique = isUnique;
7/**
8 * Checks if the selector is unique
9 * @param { Object } element
10 * @param { String } selector
11 * @return { Array }
12 */
13function isUnique(el, selector) {
14 if (!Boolean(selector)) return false;
15 var elems = el.ownerDocument.querySelectorAll(selector);
16 return elems.length === 1 && elems[0] === el;
17}
\No newline at end of file