Replace instanceof checks with other logic

This commit is contained in:
ahocevar
2018-10-05 16:16:51 +02:00
parent 96e99e481e
commit 9163558511
40 changed files with 232 additions and 268 deletions
+4 -13
View File
@@ -89,20 +89,11 @@ export function getAllTextContent_(node, normalizeWhitespace, accumulator) {
/**
* @param {?} value Value.
* @return {boolean} Is document.
* @param {Object} object Object.
* @return {boolean} Is a document.
*/
export function isDocument(value) {
return value instanceof Document;
}
/**
* @param {?} value Value.
* @return {boolean} Is node.
*/
export function isNode(value) {
return value instanceof Node;
export function isDocument(object) {
return 'documentElement' in object;
}