How to use the property-information.html function in property-information

To help you get started, we’ve selected a few property-information examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github adobe / helix-pipeline / src / utils / hast-util-to-dom.js View on Github external
const key = props[i];

      const {
        attribute,
        property,
        // `mustUseAttribute`,
        mustUseProperty,
        boolean,
        booleanish,
        overloadedBoolean,
        // `number`,
        // `defined`,
        commaSeparated,
        // `spaceSeparated`,
        // `commaOrSpaceSeparated`,
      } = info.find(info.html, key);

      let value = properties[key];

      if (Array.isArray(value)) {
        value = value.join(commaSeparated ? ', ' : ' ');
      }

      if (mustUseProperty) {
        el[property] = value;
      }

      if (boolean || (overloadedBoolean && typeof value === 'boolean')) {
        if (value) {
          el.setAttribute(attribute, '');
        } else {
          el.removeAttribute(attribute);

property-information

Info on the properties and attributes of the web platform

MIT
Latest version published 8 months ago

Package Health Score

70 / 100
Full package analysis