gl-store-s3.js/node_modules/aws-sdk/lib/xml/escape-attribute.js

14 lines
320 B
JavaScript
Raw Normal View History

2019-05-08 11:19:12 +00:00
/**
* Escapes characters that can not be in an XML attribute.
*/
function escapeAttribute(value) {
return value.replace(/&/g, '&amp;').replace(/'/g, '&apos;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');
}
/**
* @api private
*/
module.exports = {
escapeAttribute: escapeAttribute
};