get-root-node-polyfill
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

Node.prototype.getRootNode polyfill

Polyfill for the new DOM method Node.prototype.getRootNode as defined by the DOM specification

Install

npm install --save get-root-node-polyfill

Usage

// Implement the method if it does not already exist:
require('get-root-node-polyfill/implement');
aDiv.getRootNode({ composed: false }); // options are optional, defaults to composed = false.
 
// Get the method without touching Node.prototype
const getRootNode = require('get-root-node-polyfill');
getRootNode.call(aDiv, { composed: false });
 
// Check if the method is available on Node.prototype.
const isImplemented = require('get-root-node-polyfill/is-implemented');
isImplemented(); // true if the method is available

Package Sidebar

Install

npm i get-root-node-polyfill

Weekly Downloads

7,470

Version

1.0.0

License

MIT

Unpacked Size

5.08 kB

Total Files

8

Last publish

Collaborators

  • ephys