property-information
Advanced tools
Comparing version 4.1.0 to 4.2.0
'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 @@ |
@@ -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 |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
80772
22
934
820