Skip to content

Commit 9b36622

Browse files
committed
fix: fix build and tests
1 parent 898ec45 commit 9b36622

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

lib/td.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import u from 'unist-builder';
22

3-
export const CELL = 'cell';
4-
export const COLUMN = 'column';
5-
export const ROW = 'row';
6-
export const TABLE = 'table';
3+
const CELL = 'cell';
4+
const COLUMN = 'column';
5+
const ROW = 'row';
6+
const TABLE = 'table';
77

88
function fromArgs(...args) {
99
const [type, arg2, arg3] = args;
@@ -33,7 +33,7 @@ export default function td(...args) {
3333
const rows = [];
3434
let childIndex = 0;
3535
children.forEach((child) => {
36-
const childType = child?.type;
36+
const childType = child ? child.type : undefined;
3737
switch (childType) {
3838
case ROW:
3939
rows.push(td(ROW, { ...child, index: childIndex }, child.children));
@@ -51,7 +51,7 @@ export default function td(...args) {
5151
const rowIndex = index;
5252
let columnIndex = 0;
5353
children.forEach((child) => {
54-
const childType = child?.type;
54+
const childType = child ? child.type : undefined;
5555
const childProps = child instanceof Object ? child : { value: child };
5656
switch (childType) {
5757
case COLUMN:

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,16 @@
2727
"test": "jest --watch packages",
2828
"test:run": "jest"
2929
},
30+
"main": "dist/index.js",
31+
"module": "dist/index.module.js",
32+
"source": "index.js",
3033
"typings": "types/index.d.ts",
3134
"files": [
3235
"dist",
3336
"types"
3437
],
3538
"dependencies": {
36-
"tdast-types": "^0.1.1",
39+
"tdast-types": "^0.1.2",
3740
"unist-builder": "^2.0.3"
3841
},
3942
"devDependencies": {

tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"compilerOptions": {
33
"allowJs": true,
4+
"allowSyntheticDefaultImports": true,
45
"checkJs": true,
56
"esModuleInterop": true,
67
"noEmit": true

0 commit comments

Comments
 (0)