juxscript 1.1.315 → 1.1.316
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.
|
@@ -21,7 +21,7 @@ class Grid {
|
|
|
21
21
|
// Resolve columns
|
|
22
22
|
const cols = this.opts.cols;
|
|
23
23
|
let templateCols;
|
|
24
|
-
if (Array.isArray(cols)) {
|
|
24
|
+
if (cols && typeof cols === 'object' && Array.isArray(cols)) {
|
|
25
25
|
this._columns = cols.map(c => ({
|
|
26
26
|
name: c.name,
|
|
27
27
|
width: c.width || '1fr'
|
|
@@ -29,7 +29,7 @@ class Grid {
|
|
|
29
29
|
templateCols = this._columns.map(c => c.width).join(' ');
|
|
30
30
|
}
|
|
31
31
|
else {
|
|
32
|
-
const count = cols
|
|
32
|
+
const count = typeof cols === 'number' ? cols : 2;
|
|
33
33
|
templateCols = `repeat(${count}, 1fr)`;
|
|
34
34
|
}
|
|
35
35
|
const d = DENSITY_MAP[this.opts.density] || DENSITY_MAP.normal;
|