Socket
Socket
Sign inDemoInstall

property-information

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

property-information - npm Package Compare versions

Comparing version 4.1.0 to 4.2.0

lib/util/defined-info.js

6

find.js
'use strict'
var normalize = require('./normalize')
var DefinedInfo = require('./lib/util/defined-info')
var Info = require('./lib/util/info')

@@ -17,2 +18,3 @@

var prop = value
var Type = Info

@@ -30,5 +32,7 @@ if (normal in schema.normal) {

}
Type = DefinedInfo
}
return new Info(prop, value)
return new Type(prop, value)
}

@@ -35,0 +39,0 @@

9

lib/util/create.js

@@ -5,3 +5,3 @@ 'use strict'

var Schema = require('./schema')
var Info = require('./info')
var DefinedInfo = require('./defined-info')

@@ -22,3 +22,8 @@ module.exports = create

for (prop in props) {
info = new Info(prop, transform(attributes, prop), props[prop], space)
info = new DefinedInfo(
prop,
transform(attributes, prop),
props[prop],
space
)

@@ -25,0 +30,0 @@ if (mustUseProperty.indexOf(prop) !== -1) {

'use strict'
var types = require('./types')
module.exports = Info

@@ -20,24 +18,7 @@

proto.mustUseProperty = false
proto.defined = false
function Info(property, attribute, mask, space) {
mark(this, 'space', space)
mark(this, 'attribute', attribute)
mark(this, 'property', property)
mark(this, 'boolean', check(mask, types.boolean))
mark(this, 'booleanish', check(mask, types.booleanish))
mark(this, 'overloadedBoolean', check(mask, types.overloadedBoolean))
mark(this, 'number', check(mask, types.number))
mark(this, 'commaSeparated', check(mask, types.commaSeparated))
mark(this, 'spaceSeparated', check(mask, types.spaceSeparated))
mark(this, 'commaOrSpaceSeparated', check(mask, types.commaOrSpaceSeparated))
function Info(property, attribute) {
this.property = property
this.attribute = attribute
}
function mark(values, key, value) {
if (value) {
values[key] = value
}
}
function check(value, mask) {
return (value & mask) === mask
}
{
"name": "property-information",
"version": "4.1.0",
"version": "4.2.0",
"description": "Information for HTML properties",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -231,2 +231,6 @@ # property-information [![Build Status][build-badge]][build-status] [![Coverage Status][coverage-badge]][coverage-status]

`'checked'`, `'multiple'`, `'muted'`, and `'selected'`)
* `defined` (`boolean`) — The property is [defined by a space](#support).
This is true for values in HTML (including data and ARIA), SVG, XML,
XMLNS, and XLink.
These values can only be accessed through `find`.

@@ -233,0 +237,0 @@ ## Support

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