ÿØÿà JFIF H H ÿÛ C GIF89;
| System: Linux srv913213 5.15.0-190-generic #200-Ubuntu SMP Fri Aug 7 15:06:04 UTC 2026 x86_64 Current Path : /var/www/talentgenesis_admin_backend/node_modules/exceljs/lib/xlsx/xform/simple/ |
| Current File : /var/www/talentgenesis_admin_backend/node_modules/exceljs/lib/xlsx/xform/simple/string-xform.js |
const BaseXform = require('../base-xform');
class StringXform extends BaseXform {
constructor(options) {
super();
this.tag = options.tag;
this.attr = options.attr;
this.attrs = options.attrs;
}
render(xmlStream, model) {
if (model !== undefined) {
xmlStream.openNode(this.tag);
if (this.attrs) {
xmlStream.addAttributes(this.attrs);
}
if (this.attr) {
xmlStream.addAttribute(this.attr, model);
} else {
xmlStream.writeText(model);
}
xmlStream.closeNode();
}
}
parseOpen(node) {
if (node.name === this.tag) {
if (this.attr) {
this.model = node.attributes[this.attr];
} else {
this.text = [];
}
}
}
parseText(text) {
if (!this.attr) {
this.text.push(text);
}
}
parseClose() {
if (!this.attr) {
this.model = this.text.join('');
}
return false;
}
}
module.exports = StringXform;