summaryrefslogtreecommitdiff
path: root/node_modules/textr/test/support.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/textr/test/support.js')
-rw-r--r--node_modules/textr/test/support.js28
1 files changed, 28 insertions, 0 deletions
diff --git a/node_modules/textr/test/support.js b/node_modules/textr/test/support.js
new file mode 100644
index 0000000..a530253
--- /dev/null
+++ b/node_modules/textr/test/support.js
@@ -0,0 +1,28 @@
+'use strict';
+
+/**
+ * Convert text to capitalized string
+ * @param {String} text
+ * @return {String}
+ */
+exports.capitalize = function(text) {
+ return text.replace(/\b(.{1})/g, function (l) {
+ return l.toUpperCase();
+ });
+};
+
+/**
+ * Wrap text by html headline with given level
+ * @param {Number} level
+ * @return {Function}
+ */
+exports.headline = function(level) {
+ return function(text) {
+ return '<h' + level + '>' + text + '</h' + level + '>';
+ };
+};
+
+/**
+ * noop function
+ */
+exports.noop = function() {};