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

react-faux-dom

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-faux-dom - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

2

package.json
{
"name": "react-faux-dom",
"version": "1.0.2",
"version": "1.0.3",
"description": "DOM like data structure to be mutated by D3 et al, then rendered to React elements",

@@ -5,0 +5,0 @@ "main": "src/ReactFauxDOM.js",

@@ -246,2 +246,20 @@ var React = require('react')

// These NS methods are called by things like D3 if it spots a namespace.
// Like xlink:href. I don't care about namespaces, so these functions have NS aliases created.
var namespaceMethods = [
'setAttribute',
'getAttribute',
'getAttributeNode',
'removeAttribute',
'getElementsByTagName',
'getElementById'
]
namespaceMethods.forEach(function (name) {
var fn = Element.prototype[name]
Element.prototype[name + 'NS'] = function () {
return fn.apply(this, Array.prototype.slice.call(arguments, 1))
}
})
module.exports = Element

@@ -134,1 +134,10 @@ var test = require('tape')

})
test('NS methods behave the same', function (t) {
var el = mk()
.attr('xlink:href', 'localhost')
.node()
t.plan(1)
t.equal(el.getAttributeNS('xlink', 'href'), 'localhost')
})
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