JSPM

get-root-node-polyfill

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 10343
  • Score
    100M100P100Q134677F
  • License MIT

Polyfill for the new Node method getRootNode

Package Exports

  • get-root-node-polyfill
  • get-root-node-polyfill/implement

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (get-root-node-polyfill) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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