posthtml-component 1.0.0-RC.1 → 1.0.0-RC.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "posthtml-component",
3
- "version": "1.0.0-RC.1",
3
+ "version": "1.0.0-RC.2",
4
4
  "description": "PostHTML Components Blade-like with slots, attributes as props and custom tag",
5
5
  "license": "MIT",
6
6
  "repository": "thewebartisan7/posthtml-components",
package/src/index.js CHANGED
@@ -76,7 +76,7 @@ module.exports = (options = {}) => tree => {
76
76
  // Additional element attributes, in case already exist in valid-attributes.js it will replace all attributes
77
77
  // It should be an object with key as tag name and as value a function modifier which receive
78
78
  // the default attributes and return an array of attributes. Example:
79
- // { TAG: (attrsibutes) => { attributes[] = 'attribute-name'; return attributes; } }
79
+ // { TAG: (attributes) => { attributes[] = 'attribute-name'; return attributes; } }
80
80
  options.elementAttributes = isPlainObject(options.elementAttributes) ? options.elementAttributes : {};
81
81
  options.safelistAttributes = Array.isArray(options.safelistAttributes) ? options.safelistAttributes : [];
82
82
  options.blacklistAttributes = Array.isArray(options.blacklistAttributes) ? options.blacklistAttributes : [];
@@ -52,7 +52,7 @@ module.exports = (currentNode, attributes, props, options, aware) => {
52
52
 
53
53
  // Merge or override elementAttributes from options provided
54
54
  if (!isEmpty(options.elementAttributes)) {
55
- each(options.elementAttributes, (tagName, modifier) => {
55
+ each(options.elementAttributes, (modifier, tagName) => {
56
56
  if (typeof modifier === 'function' && isString(tagName)) {
57
57
  tagName = tagName.toUpperCase();
58
58
  const attributes = modifier(validAttributes.elementAttributes[tagName]);