Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
attributeList: function(data) {
var xml = '' + entities.decodeXML(data) + '';
xml2js.parseString(xml, { explicitArray: true }, function(err, result) {
if (!err) {
// In order to keep the existing event signature this
// triggers an event for every attribute changed.
result.attributeList.attribute.forEach(function(attribute) {
self.emit('attributeList',
attribute.name[0],
attribute.value[0],
attribute.prevalue[0],
attribute.ts[0]
);
});
}
});
}
};
result.messages.forEach(function iterator(message) {
msg.push(counter + '. line ' + message.line + ', column ' + message.column + ': ' + decodeXML(message.message));
counter++;
});
'entities.decodeXML': function () { entities.decodeXML(textToDecode); },
'entities.decodeHTML4': function () { entities.decodeHTML4(textToDecode); },
this.soapAction('urn:Belkin:service:deviceevent:1', 'GetAttributes', null, function(err, data) {
if (err) return cb(err);
var xml = '' + entities.decodeXML(data.attributeList) + '';
xml2js.parseString(xml, { explicitArray: false }, function(err, result) {
if (err) return cb(err);
var attributes = {};
for (var key in result.attributeList.attribute) {
var attribute = result.attributeList.attribute[key];
attributes[attribute.name] = attribute.value;
}
cb(null, attributes);
});
});
};
'entities.decodeXML': function () { entities.decodeXML(littleTextToDecode); },
'entities.decodeHTML4': function () { entities.decodeHTML4(littleTextToDecode); },
'entities.decodeXML': function () { entities.decodeXML(emptyTextToDecode); },
'entities.decodeHTML4': function () { entities.decodeHTML4(emptyTextToDecode); },
mwUtil.extractRedirect = (html) => {
const redirectMatch = redirectRegEx.exec(html);
if (redirectMatch) {
return decodeURIComponent(entities.decodeXML(redirectMatch[1]));
} else {
return null;
}
};
$('.highlight code').each(function(index, elem) {
options.lang = elem.attribs['data-lang'];
var code = entities.decodeXML($(elem).text());
var content = util.highlight(code, options);
$(elem).html(content);
});