Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

html-element

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

html-element - npm Package Compare versions

Comparing version 1.2.3 to 1.2.4

9

example.js
require('./index.js')
var util = require('util');
var h1=document.createElement('h1');
var h3=document.createElement('h3');
var h4=document.createElement('h4');
var h5=document.createElement('h5');
h1.setAttribute('n', 'v');
h1.style.setProperty('color','red');
h1.textContent = 'w0f w0f';
h1.appendChild(h3)
h1.appendChild(h4)
h1.insertBefore(h5, h4);
h1.src ="bla"
h1.className="cls";
console.log(h1.outerHTML);
console.log(util.inspect(h1, true, null));

@@ -108,2 +108,19 @@ global.Document = Document

Element.prototype.removeChild = function(rChild) {
var self = this;
this.childNodes.forEach(function(child, index){
if (child === rChild) delete self.childNodes[index];
})
}
Element.prototype.insertBefore = function(newChild, existingChild) {
var self = this;
this.childNodes.forEach(function(child, index){
if (child === existingChild) {
index === 0 ? self.childNodes.unshift(newChild)
: self.childNodes.splice(index, 0, newChild);
}
})
}
Element.prototype.__defineGetter__('innerHTML', function () {

@@ -110,0 +127,0 @@ var s = ''

2

package.json
{
"name": "html-element",
"version": "1.2.3",
"version": "1.2.4",
"homepage": "https://github.com/1N50MN14/html-element",

@@ -5,0 +5,0 @@ "repository": {

@@ -17,2 +17,4 @@ # html-element

- replaceChild(node)
- removeChild(node)
- insertBefore(new, existing)
- toString()

@@ -19,0 +21,0 @@ - setAttribute(name, value)

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc