aboutsummaryrefslogtreecommitdiffstats
path: root/lib/util.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/util.js')
-rw-r--r--lib/util.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/util.js b/lib/util.js
index 3532203..089e31c 100644
--- a/lib/util.js
+++ b/lib/util.js
@@ -63,3 +63,15 @@ exports.getISODate = function getISODate(dateStr) {
return date.getFullYear() + '-' + pad(date.getMonth() + 1) + '-' +
pad(date.getDate());
};
+
+/**
+ * object to pack messaging. Use as in
+ postMessage(new Message("GetPassword", {
+ login: login,
+ hostname: location.hostname
+ }));
+ */
+exports.Message = function Message(cmd, data) {
+ this.cmd = cmd;
+ this.data = data;
+};