/is-dom-document

Determine if an object is a DOM Document (from any Realm).

Primary LanguageJavaScriptMIT LicenseMIT

is-dom-document NPM Version File Size Build Status Coverage Status Dependency Monitor

Determine if an object is a Document (from any Realm).

Installation

Node.js >= 10 is required. To install, type this at the command line:

npm install is-dom-document

Importing

ES Module:

import isDOMDocument from 'is-dom-document';

CommonJS Module:

const isDOMDocument = require('is-dom-document');

Usage

isDOMDocument(window.document); //-> true
isDOMDocument({}); //-> false