Skip to content

Commit

Permalink
style(utils): cleanup code
Browse files Browse the repository at this point in the history
  • Loading branch information
thetutlage committed Nov 10, 2018
1 parent ca780e5 commit 1c41b64
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ export class ObjectifyString {
* ```
*/
public flush (): string {
const obj = this.obj
const obj = `{ ${this.obj} }`
this.obj = ''
return `{ ${obj} }`
return obj
}
}

Expand Down Expand Up @@ -248,14 +248,6 @@ export function hasChildSuper (token: ITagToken): boolean {
}

return isBlock(token.children[0], 'super')
// const child = token.children[0]
// if (child.type === TagTypes.TAG || child.type === TagTypes.ETAG) {
// }
// if ([TagTypes.TAG, TagTypes.ETAG].indexOf(token.children[0].type) === -1) {
// return false
// }

// return (token.children[0] as IBlockNode).properties.name === 'super'
}

/**
Expand Down Expand Up @@ -289,17 +281,16 @@ export function mergeSections (base: IToken[], extended: IToken[]): IToken[] {
return node
}

const blockNode = node as ITagToken
const extendedNode = extendedSections[blockNode.properties.jsArg]
const extendedNode = extendedSections[node.properties.jsArg.trim()]
if (!extendedNode) {
return blockNode
return node
}

/**
* Concat children when super was called
*/
if (hasChildSuper(extendedNode)) {
extendedNode.children = blockNode.children.concat(extendedNode.children)
extendedNode.children = node.children.concat(extendedNode.children)
}

return extendedNode
Expand Down

0 comments on commit 1c41b64

Please sign in to comment.