New, woefully inadequate.
authorMike Taylor <mike@indexdata.com>
Tue, 22 Apr 2014 16:54:33 +0000 (17:54 +0100)
committerMike Taylor <mike@indexdata.com>
Tue, 22 Apr 2014 16:54:33 +0000 (17:54 +0100)
src/mkws-filter.js [new file with mode: 0644]

diff --git a/src/mkws-filter.js b/src/mkws-filter.js
new file mode 100644 (file)
index 0000000..c62235e
--- /dev/null
@@ -0,0 +1,12 @@
+// Factory function for filters. These can be of several types.
+function filter(id, field, value) {
+    var res;
+
+    if (id) {
+       res = { id: id, name: name };
+    } else {
+       res = { field: field, value: value };
+    }
+
+    return res;
+}