Skip to content

Commit bdab52d

Browse files
author
Dmitry Ovsyanko
committed
XMLNode.text code cleanup
1 parent 2220d88 commit bdab52d

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

lib/XMLNode.js

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -146,17 +146,9 @@ const XMLNode = class extends SAXEvent {
146146

147147
get text () {
148148

149-
let s = super.text
150-
151-
if (this [TYPE] === SAXEvent.TYPES.CHARACTERS) {
149+
const s = super.text; if (this [TYPE] !== SAXEvent.TYPES.CHARACTERS) return s
152150

153-
const entityResolver = this [ENTITY_RESOLVER]
154-
155-
if (entityResolver) return entityResolver.fix (s)
156-
157-
}
158-
159-
return s
151+
const entityResolver = this [ENTITY_RESOLVER]; return entityResolver ? entityResolver.fix (s) : s
160152

161153
}
162154

0 commit comments

Comments
 (0)