JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 17409316
  • Score
    100M100P100Q219419F
  • License MIT

Information for HTML properties

Package Exports

  • property-information

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (property-information) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

property-information Build Status Coverage Status

Information for HTML properties.

Installation

npm:

npm install property-information

property-information is also available for bower, duo, and for AMD, CommonJS, and globals (uncompressed and compressed).

Usage

console.log(propertyInformation('itemScope'));

Yields:

{
  "name": "class",
  "propertyName": "className",
  "mustUseAttribute": true,
  "mustUseProperty": false,
  "boolean": false,
  "overloadedBoolean": false,
  "numeric": false,
  "positiveNumeric": false
}

API

propertyInformation(name)

Get information for a DOM property.

Parameters:

  • name (string) — Case-insensitive name.

Returns: Information? — Information, when available.

propertyInformation.all

Object mapping case-insensitive names to Information objects. This gives raw access to the information returned by propertyInformation(): do not change the objects.

Information

Properties:

  • name (string) — Case-insensitive name;

  • propertyName (string) — Case-sensitive IDL attribute (e.g., a class attribute is added in HTML and a className is added in Web IDL);

  • mustUseAttribute (boolean) — Whether setAttribute must be used when patching a DOM node;

  • mustUseProperty (boolean) — Whether node[propertyName] must be used when patching a DOM node;

  • boolean (boolean) — Whether the value of the property is boolean;

  • overloadedBoolean (boolean) — Whether the value of the property can be boolean;

  • numeric (boolean) — Whether the value of the property is number;

  • positiveNumeric (boolean) — Whether the value of the property is number and positive;

License

MIT © Titus Wormer

Derivative work based on React licensed under BSD-3-Clause-Clear, © 2013-2015, Facebook, Inc.