Skip to content

Commit

Permalink
tidy up
Browse files Browse the repository at this point in the history
  • Loading branch information
shawnbot committed May 15, 2018
1 parent b3761fd commit 375bb92
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ const parse = (source, options) => {
Object.assign({}, PARSE_DEFAULTS, options)
)
const tree = degonzify(gtree)
Object.defineProperty(tree.source = {}, 'string', {
tree.source = {}
Object.defineProperty(tree.source, 'string', {
enumerable: false,
get: () => source,
get: () => source
})
return unistify(tree)
}
Expand All @@ -25,7 +26,7 @@ const degonzify = src => {
position: {
start: src.start,
end: src.end,
},
}
}
if (Array.isArray(src.content)) {
node.children = src.content.map(degonzify)
Expand All @@ -41,5 +42,5 @@ const unistify = tree => {

module.exports = {
parse,
unistify,
unistify
}

0 comments on commit 375bb92

Please sign in to comment.