UNPKG

@nodecfdi/cfdi-cleaner

Version:

Librería para limpiar comprobantes fiscales digitales v3.3 y v4.0

25 lines (24 loc) 803 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * This provides methods used for xml attributes handling. It´s not meant to * be used directly. */ class XmlAttributeMethods { attributeRemove(attribute) { const { ownerElement, nodeName } = attribute; /* istanbul ignore else -- For usage always is not null but for default ownerElement is posible null @preserve */ if (ownerElement !== null) { ownerElement.removeAttribute(nodeName); } } attributeSetValueOrRemoveIfEmpty(attribute, value) { if (value === '') { this.attributeRemove(attribute); return; } attribute.value = value; attribute.nodeValue = value; } } exports.default = XmlAttributeMethods;