boxwood 0.63.0 → 0.64.0

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.
Files changed (2) hide show
  1. package/index.js +6 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -12,6 +12,7 @@ async function compile(path) {
12
12
  const styles = []
13
13
  const scripts = []
14
14
  const walk = (node) => {
15
+ if (!node) { return }
15
16
  if (node.name === 'head') {
16
17
  nodes.head = node
17
18
  }
@@ -35,7 +36,7 @@ async function compile(path) {
35
36
  if (Array.isArray(node)) {
36
37
  node.forEach(walk)
37
38
  } else if (Array.isArray(node.children)) {
38
- node.children.forEach(walk)
39
+ node.children.filter(Boolean).forEach(walk)
39
40
  }
40
41
  }
41
42
  walk(tree)
@@ -129,7 +130,9 @@ const attributes = (options) => {
129
130
  result.push(key)
130
131
  } else {
131
132
  const name = ALIASES[key] || key
132
- result.push(name + '=' + '"' + options[key] + '"')
133
+ const value = options[key]
134
+ const content = Array.isArray(value) ? classes(...value) : value
135
+ result.push(name + '=' + '"' + content + '"')
133
136
  }
134
137
  }
135
138
  }
@@ -450,5 +453,6 @@ module.exports = {
450
453
  raw,
451
454
  css,
452
455
  js,
456
+ tag,
453
457
  ...nodes,
454
458
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "boxwood",
3
- "version": "0.63.0",
3
+ "version": "0.64.0",
4
4
  "description": "Compile HTML templates into JS",
5
5
  "main": "index.js",
6
6
  "scripts": {