Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
/**
* Module dependencies.
*/
var indexOf = require('index-of');
var debug = require('debug')('range-normalize');
// map to an Object for faster lookup times
var voidElements = require('void-elements').reduce(function (obj, name) {
obj[name.toUpperCase()] = true;
return obj;
}, {});
/**
* Module exports.
*/
module.exports = normalize;
/**
* "Normalizes" the DOM Range instance, such that slight variations in the start
* and end containers end up being normalized to the same "base" representation.
* The aim is to always have `startContainer` and `endContainer` pointing to
* TextNode instances.
*