Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if ( that.evaluate( './*', 'nodes', path, 0, true ).length === 0 ) {
// Select all text nodes (excluding repeat COMMENT nodes!)
that.evaluate( './text()', 'nodes', path, 0, true ).forEach( node => {
node.textContent = '';
} );
} else {
// If the node in the default instance is a group (empty in record, so appears to be a leaf node
// but isn't), empty all true leaf node descendants.
that.evaluate( './/*[not(*)]', 'nodes', path, 0, true ).forEach( node => {
node.textContent = '';
} );
}
}
} );
merger = new MergeXML( {
join: false
} );
modelInstanceChildStr = ( new XMLSerializer() ).serializeToString( modelInstanceChildEl );
recordStr = ( new XMLSerializer() ).serializeToString( record );
// first the model, to preserve DOM order of that of the default instance
merger.AddSource( modelInstanceChildStr );
// then merge the record into the model
merger.AddSource( recordStr );
if ( merger.error.code ) {
throw new Error( merger.error.text );
}
/**