Skip to content

Commit ebf6340

Browse files
committed
adding info and meta as sourceInfo and sourceMeta mientjan#38 mientjan#27
1 parent c5015e2 commit ebf6340

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/lib/util/tokensToAST.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import getTokenTypeByToken from './getTokenTypeByToken';
33

44
/**
55
*
6-
* @param {{type: string, tag:string, content: string, children: *, attrs: Array, meta}} token
6+
* @param {{type: string, tag:string, content: string, children: *, attrs: Array, meta, info}} token
77
* @param {number} tokenIndex
88
* @return {{type: string, content, tokenIndex: *, index: number, attributes: {}, children: *}}
99
*/
@@ -18,14 +18,13 @@ function createNode(token, tokenIndex) {
1818
const [name, value] = curr;
1919
return { ...prev, [name]: value };
2020
}, {});
21-
2221
}
2322

24-
2523
return {
2624
type,
2725
sourceType: token.type,
28-
meta: token.meta,
26+
sourceInfo: token.info,
27+
sourceMeta: token.meta,
2928
key: getUniqueID(),
3029
content,
3130
tokenIndex,
@@ -35,7 +34,6 @@ function createNode(token, tokenIndex) {
3534
};
3635
}
3736

38-
3937
/**
4038
*
4139
* @param {Array<{type: string, tag:string, content: string, children: *, attrs: Array}>}tokens

0 commit comments

Comments
 (0)