Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function stringToTag(str) {
return objectToTag(parseXml(str).children[0]);
}
return through.obj(function(file: File, encoding, done) {
if (file.isBuffer()) {
const before = file.contents.toString(encoding);
const XMLTree: XMLNode = parseXML(before);
const XMLRootNode =
XMLTree.type === 'document'
? (XMLTree.children[0] as XMLNode)
: XMLTree;
const iconName = file.stem;
const abstractRootNode = toAbstractNode(XMLRootNode, iconName);
const iconDefinitionBaseNode: IconDefinitionBase = {
name: iconName,
theme,
icon: abstractRootNode
};
const icond = stringify(iconDefinitionBaseNode);
file.contents = Buffer.from(icond);
done(null, file);