[Pkg-javascript-commits] [ltx] 402/469: add test documentation
Jonas Smedegaard
dr at jones.dk
Wed Aug 31 13:03:31 UTC 2016
This is an automated email from the git hooks/post-receive script.
js pushed a commit to branch master
in repository ltx.
commit 697b8274b0512fdbbd9e8ebcd8aed5d5c838aaf1
Author: Sonny Piers <sonny at fastmail.net>
Date: Mon Oct 26 08:46:24 2015 +0100
add test documentation
---
README.md | 9 +++++++++
lib/escape.js | 16 ++++++++++++----
lib/parsers/node-xml.js | 7 ++++++-
3 files changed, 27 insertions(+), 5 deletions(-)
diff --git a/README.md b/README.md
index ec1fe4a..e0a3108 100644
--- a/README.md
+++ b/README.md
@@ -13,6 +13,15 @@
For documentation please see http://node-xmpp.org/doc/ltx.html
+# Test
+
+```
+npm install -g standard browserify
+```
+
+npm test
+
+
## TODO
* More documentation
diff --git a/lib/escape.js b/lib/escape.js
index 26a4589..b1eec5b 100644
--- a/lib/escape.js
+++ b/lib/escape.js
@@ -1,9 +1,17 @@
'use strict'
-module.exports.escapeXML = function escapeXML (s) {
- return s.replace(/\&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/"/g, ''')
+exports.escapeXML = function escapeXML (s) {
+ return s
+ .replace(/\&/g, '&')
+ .replace(/</g, '<')
+ .replace(/>/g, '>')
+ .replace(/"/g, '"')
+ .replace(/"/g, ''')
}
-module.exports.escapeXMLText = function escapeXMLText (s) {
- return s.replace(/\&/g, '&').replace(/</g, '<').replace(/>/g, '>')
+exports.escapeXMLText = function escapeXMLText (s) {
+ return s
+ .replace(/\&/g, '&')
+ .replace(/</g, '<')
+ .replace(/>/g, '>')
}
diff --git a/lib/parsers/node-xml.js b/lib/parsers/node-xml.js
index cb5b9e3..277eb10 100644
--- a/lib/parsers/node-xml.js
+++ b/lib/parsers/node-xml.js
@@ -61,5 +61,10 @@ SaxNodeXML.prototype.end = function (data) {
}
function unescapeXml (s) {
- return s.replace(/\&/g, '&').replace(/\</g, '<').replace(/\>/g, '>').replace(/\"/g, '"').replace(/\'/g, "'")
+ return s
+ .replace(/\&/g, '&')
+ .replace(/\</g, '<')
+ .replace(/\>/g, '>')
+ .replace(/\"/g, '"')
+ .replace(/\'/g, "'")
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/ltx.git
More information about the Pkg-javascript-commits
mailing list