arche 0.3.3 → 0.3.6

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.
@@ -16,7 +16,7 @@ jobs:
16
16
 
17
17
  strategy:
18
18
  matrix:
19
- node-version: [14.x, 15.x, 16.x, 17.x, 18.x]
19
+ node-version: [16.x, 18.x, 20.x]
20
20
 
21
21
  steps:
22
22
  - uses: actions/checkout@v2
package/README.md CHANGED
@@ -2,10 +2,10 @@
2
2
  ![arche-logo](https://raw.githubusercontent.com/a-synchronous/assets/master/arche-logo-226x226.png)
3
3
  > Arche (/ˈɑːrki/; Ancient Greek: ἀρχή) is a Greek word with primary senses "beginning", "origin" or "source of action" (ἐξ' ἀρχῆς: from the beginning, οr ἐξ' ἀρχῆς λόγος: the original argument), and later "first principle" or "element". ([wikipedia](https://en.wikipedia.org/wiki/Arche))
4
4
 
5
- ![Node.js CI](https://github.com/richytong/arche/workflows/Node.js%20CI/badge.svg?branch=master)
5
+ ![Node.js CI](https://github.com/richytong/arche/actions/workflows/nodejs.yml/badge.svg)
6
6
  [![codecov](https://codecov.io/gh/richytong/arche/branch/master/graph/badge.svg)](https://codecov.io/gh/richytong/arche)
7
7
 
8
- HTML as JavaScript.
8
+ HTML as JavaScript.
9
9
 
10
10
  ```javascript [playground]
11
11
  const ReactElement = Arche(React)
@@ -24,7 +24,7 @@ const myElement = Div([
24
24
  render(myElement)
25
25
  // <div>
26
26
  // <h1>I am a heading</h1>
27
- // <p>heyo</p>
27
+ // <p>paragraph</p>
28
28
  // <p>lorem ipsum</p>
29
29
  // </div>
30
30
  ```
package/es.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Arche v0.3.2
2
+ * Arche v0.3.5
3
3
  * https://github.com/richytong/arche
4
4
  * (c) 2020-2023 Richard Tong
5
5
  * Arche may be freely distributed under the MIT license.
@@ -264,7 +264,7 @@ const Arche = function (creator, options = {}) {
264
264
  }
265
265
 
266
266
  if (isArray(arg1)) {
267
- if (arg0.css == null) {
267
+ if (arg0 == null || arg0.css == null) {
268
268
  return creatorCreateElement(creator, type, arg0, arg1)
269
269
  }
270
270
  const { css, ...props } = arg0
@@ -272,14 +272,14 @@ const Arche = function (creator, options = {}) {
272
272
  }
273
273
 
274
274
  if (arg1 == null) {
275
- if (arg0.css == null) {
275
+ if (arg0 == null || arg0.css == null) {
276
276
  return creatorCreateElement(creator, type, arg0, [])
277
277
  }
278
278
  const { css, ...props } = arg0
279
279
  return creatorCreateElement(creator, styledComponent([css]), props, [])
280
280
  }
281
281
 
282
- if (arg0.css == null) {
282
+ if (arg0 == null || arg0.css == null) {
283
283
  return creatorCreateElement(creator, type, arg0, [arg1])
284
284
  }
285
285
  const { css, ...props } = arg0
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Arche v0.3.2
2
+ * Arche v0.3.5
3
3
  * https://github.com/richytong/arche
4
4
  * (c) 2020-2023 Richard Tong
5
5
  * Arche may be freely distributed under the MIT license.
@@ -270,7 +270,7 @@ const Arche = function (creator, options = {}) {
270
270
  }
271
271
 
272
272
  if (isArray(arg1)) {
273
- if (arg0.css == null) {
273
+ if (arg0 == null || arg0.css == null) {
274
274
  return creatorCreateElement(creator, type, arg0, arg1)
275
275
  }
276
276
  const { css, ...props } = arg0
@@ -278,14 +278,14 @@ const Arche = function (creator, options = {}) {
278
278
  }
279
279
 
280
280
  if (arg1 == null) {
281
- if (arg0.css == null) {
281
+ if (arg0 == null || arg0.css == null) {
282
282
  return creatorCreateElement(creator, type, arg0, [])
283
283
  }
284
284
  const { css, ...props } = arg0
285
285
  return creatorCreateElement(creator, styledComponent([css]), props, [])
286
286
  }
287
287
 
288
- if (arg0.css == null) {
288
+ if (arg0 == null || arg0.css == null) {
289
289
  return creatorCreateElement(creator, type, arg0, [arg1])
290
290
  }
291
291
  const { css, ...props } = arg0
package/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Arche v0.3.2
2
+ * Arche v0.3.5
3
3
  * https://github.com/richytong/arche
4
4
  * (c) 2020-2023 Richard Tong
5
5
  * Arche may be freely distributed under the MIT license.
@@ -264,7 +264,7 @@ const Arche = function (creator, options = {}) {
264
264
  }
265
265
 
266
266
  if (isArray(arg1)) {
267
- if (arg0.css == null) {
267
+ if (arg0 == null || arg0.css == null) {
268
268
  return creatorCreateElement(creator, type, arg0, arg1)
269
269
  }
270
270
  const { css, ...props } = arg0
@@ -272,14 +272,14 @@ const Arche = function (creator, options = {}) {
272
272
  }
273
273
 
274
274
  if (arg1 == null) {
275
- if (arg0.css == null) {
275
+ if (arg0 == null || arg0.css == null) {
276
276
  return creatorCreateElement(creator, type, arg0, [])
277
277
  }
278
278
  const { css, ...props } = arg0
279
279
  return creatorCreateElement(creator, styledComponent([css]), props, [])
280
280
  }
281
281
 
282
- if (arg0.css == null) {
282
+ if (arg0 == null || arg0.css == null) {
283
283
  return creatorCreateElement(creator, type, arg0, [arg1])
284
284
  }
285
285
  const { css, ...props } = arg0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arche",
3
- "version": "0.3.3",
3
+ "version": "0.3.6",
4
4
  "description": "HTML as JavaScript",
5
5
  "author": "Richard Tong",
6
6
  "license": "MIT",
package/test.js CHANGED
@@ -117,11 +117,12 @@ describe('Arche', () => {
117
117
  Div({ css: 'article', id: 'nested' }, [
118
118
  Article('yo'),
119
119
  ]),
120
+ Span(),
120
121
  ])
121
122
 
122
123
  assert.strictEqual(
123
124
  JSON.stringify(el),
124
- '["div",{},[["h1",{},["header"]],["h3",{"style":{"color":"grey"}},["description"]],["b",{"id":"hey","excluded":null},[]],["article",{"id":"nested"},[["article",{},["yo"]]]]]]')
125
+ '["div",{},[["h1",{},["header"]],["h3",{"style":{"color":"grey"}},["description"]],["b",{"id":"hey","excluded":null},[]],["article",{"id":"nested"},[["article",{},["yo"]]]],["span",{},[]]]]')
125
126
  })
126
127
  })
127
128
  })