Socket
Socket
Sign inDemoInstall

domv

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

domv - npm Package Compare versions

Comparing version 1.5.1 to 2.0.0

lib/name-overrides-builtin.js

13

lib/domv.js

@@ -29,2 +29,3 @@ 'use strict';

var slice = Array.prototype.slice;
var nameOverridesBuiltin = require('./name-overrides-builtin');

@@ -813,2 +814,14 @@

/**
* Does the given name potentially override a builtin property of `document` or `HTMLFormElement`?
* This list of invalid properties used by this method might not be exhaustive, this method is not intended
* to validate arbitrary user input.
* @param name Value of `name` or `id` attribute
* @return {Boolean} True if this name overrides a builtin property
*/
module.exports.nameOverridesBuiltin = function(name)
{
return nameOverridesBuiltin(name);
};
/**
* <p>The Node interface is the primary datatype for the entire Document Object Model.

@@ -815,0 +828,0 @@ * It represents a single node in the document tree. While all objects implementing

18

package.json
{
"name": "domv",
"version": "1.5.1",
"version": "2.0.0",
"author": "Joris van der Wel <joris@jorisvanderwel.com>",

@@ -39,14 +39,14 @@ "description": "Create views as components using DOM. Run the same code on the browser and on the server.",

"inherits": "^2.0.1",
"throwable": "^1.0.0"
"throwable": "^1.0.3"
},
"optionalDependencies": {
"jsdom": "^3.1.0"
"jsdom": "^5.4.3"
},
"devDependencies": {
"browserify": "^7.0.1",
"istanbul": "^0.3.5",
"jsdoc": "^3.3.0-alpha11",
"jsdoc-to-markdown": "^0.6.4",
"jshint": "^2.5.10",
"nodeunit": "^0.9.0"
"browserify": "^10.2.1",
"istanbul": "^0.3.14",
"jsdoc": "^3.3.0",
"jsdoc-to-markdown": "^1.1.1",
"jshint": "^2.7.0",
"nodeunit": "^0.9.1"
},

@@ -53,0 +53,0 @@ "scripts": {

@@ -5,2 +5,24 @@ 'use strict';

function getAllPropertyNames()
{
var names = [];
for (var i = 0; i < arguments.length; ++i)
{
var obj = arguments[i];
while (obj)
{
names = names.concat(Object.getOwnPropertyNames(obj));
obj = Object.getPrototypeOf(obj);
}
}
names.sort();
return names.filter(function(name, index, names)
{
return index === 0 || names[index - 1] !== name;
});
}
function testParseHTMLDocumentResult(test, doc)

@@ -488,3 +510,37 @@ {

test.done();
},
'nameOverridesBuiltin': function(test)
{
getAllPropertyNames(this.document).forEach(function(name)
{
if (require('jsdom').jsdom && name[0] === '_')
{
// skip jsdom interal property
// (also, jsdom does not support [OverrideBuiltins] yet)
return;
}
test.ok(domv.nameOverridesBuiltin(name), name);
});
getAllPropertyNames(this.document.createElement('form')).forEach(function(name)
{
if (require('jsdom').jsdom && name[0] === '_')
{
// skip jsdom interal property
// (also, jsdom does not support [OverrideBuiltins] yet)
return;
}
test.ok(domv.nameOverridesBuiltin(name), name);
});
// a few random ones it should return false for
test.ok(!domv.nameOverridesBuiltin('foo'));
test.ok(!domv.nameOverridesBuiltin('firstchild')); // (wrong case)
test.ok(!domv.nameOverridesBuiltin('bar'));
test.ok(!domv.nameOverridesBuiltin(''));
test.done();
}
};

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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