fixup 0de69e30: avoid passing falsy selectors to $()
This commit is contained in:
parent
0de69e306d
commit
6704956b22
|
@ -12,7 +12,7 @@ for (const type of [NodeList, NamedNodeMap, HTMLCollection, HTMLAllCollection])
|
|||
}
|
||||
|
||||
$.remove = (selector, base = document) => {
|
||||
const el = selector instanceof Node ? selector : $(selector, base);
|
||||
const el = selector && typeof selector === 'string' ? $(selector, base) : selector;
|
||||
if (el) {
|
||||
el.remove();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user