* Query an element selector if it's not an element already. * * @param {String|Element} el * @return {Element}
(el)
| 1122 | */ |
| 1123 | |
| 1124 | function query(el) { |
| 1125 | if (typeof el === 'string') { |
| 1126 | var selector = el; |
| 1127 | el = document.querySelector(el); |
| 1128 | if (!el) { |
| 1129 | 'development' !== 'production' && warn('Cannot find element: ' + selector); |
| 1130 | } |
| 1131 | } |
| 1132 | return el; |
| 1133 | } |
| 1134 | |
| 1135 | /** |
| 1136 | * Check if a node is in the document. |
no test coverage detected