@@ -330,10 +330,10 @@ const parseXml = function (xmlData) {
330330
331331 //check if last tag of nested tag was unpaired tag
332332 const lastTagName = this . matcher . getCurrentTag ( ) ;
333- if ( tagName && this . options . unpairedTags . indexOf ( tagName ) !== - 1 ) {
333+ if ( tagName && this . options . unpairedTagsSet . has ( tagName ) ) {
334334 throw new Error ( `Unpaired tag can not be used as closing tag: </${ tagName } >` ) ;
335335 }
336- if ( lastTagName && this . options . unpairedTags . indexOf ( lastTagName ) !== - 1 ) {
336+ if ( lastTagName && this . options . unpairedTagsSet . has ( lastTagName ) ) {
337337 // Pop the unpaired tag
338338 this . matcher . pop ( ) ;
339339 this . tagsNodeStack . pop ( ) ;
@@ -438,7 +438,7 @@ const parseXml = function (xmlData) {
438438
439439 //check if last tag was unpaired tag
440440 const lastTag = currentNode ;
441- if ( lastTag && this . options . unpairedTags . indexOf ( lastTag . tagname ) !== - 1 ) {
441+ if ( lastTag && this . options . unpairedTagsSet . has ( lastTag . tagname ) ) {
442442 currentNode = this . tagsNodeStack . pop ( ) ;
443443 this . matcher . pop ( ) ;
444444 }
@@ -498,7 +498,7 @@ const parseXml = function (xmlData) {
498498 i = result . closeIndex ;
499499 }
500500 //unpaired tag
501- else if ( this . options . unpairedTags . indexOf ( tagName ) !== - 1 ) {
501+ else if ( this . options . unpairedTagsSet . has ( tagName ) ) {
502502 i = result . closeIndex ;
503503 }
504504 //normal tag
@@ -536,7 +536,7 @@ const parseXml = function (xmlData) {
536536 this . matcher . pop ( ) ; // Pop self-closing tag
537537 this . isCurrentNodeStopNode = false ; // Reset flag
538538 }
539- else if ( this . options . unpairedTags . indexOf ( tagName ) !== - 1 ) { //unpaired tag
539+ else if ( this . options . unpairedTagsSet . has ( tagName ) ) { //unpaired tag
540540 const childNode = new xmlNode ( tagName ) ;
541541 if ( prefixedAttrs ) {
542542 childNode [ ":@" ] = prefixedAttrs ;
0 commit comments