From 30853212c70564dc5dfa12772497aec13af053af Mon Sep 17 00:00:00 2001 From: Dana Date: Wed, 14 Oct 2015 10:22:36 +0000 Subject: [PATCH 1/4] move internal domain check outside analytics --- node_modules/c9/blacklist.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 node_modules/c9/blacklist.js diff --git a/node_modules/c9/blacklist.js b/node_modules/c9/blacklist.js new file mode 100644 index 00000000..5479d6ea --- /dev/null +++ b/node_modules/c9/blacklist.js @@ -0,0 +1,13 @@ +var _ = require("lodash"); + + +var internalDomain = ['c9.io', 'clou9beta.com']; + +function hasInternalDomain(email) { + var emailElements = email.split("@"); + var emailDomain = emailElements[emailElements.length - 1]; + + return _.contains(internalDomain, emailDomain); +} + +module.exports = hasInternalDomain(); \ No newline at end of file From d39a09dcc1f7114fefc655ec426b8ae64ed9ae40 Mon Sep 17 00:00:00 2001 From: Dana Date: Wed, 14 Oct 2015 15:46:27 +0000 Subject: [PATCH 2/4] fix tests --- node_modules/c9/blacklist.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/node_modules/c9/blacklist.js b/node_modules/c9/blacklist.js index 5479d6ea..85cfb617 100644 --- a/node_modules/c9/blacklist.js +++ b/node_modules/c9/blacklist.js @@ -4,6 +4,8 @@ var _ = require("lodash"); var internalDomain = ['c9.io', 'clou9beta.com']; function hasInternalDomain(email) { + if (!email) return false; + var emailElements = email.split("@"); var emailDomain = emailElements[emailElements.length - 1]; From 53a222db34782cf2b753c585824bf80a5e03023d Mon Sep 17 00:00:00 2001 From: Dana Date: Thu, 15 Oct 2015 08:21:18 +0000 Subject: [PATCH 3/4] Fix function export error --- node_modules/c9/blacklist.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node_modules/c9/blacklist.js b/node_modules/c9/blacklist.js index 85cfb617..cfcd29c3 100644 --- a/node_modules/c9/blacklist.js +++ b/node_modules/c9/blacklist.js @@ -12,4 +12,4 @@ function hasInternalDomain(email) { return _.contains(internalDomain, emailDomain); } -module.exports = hasInternalDomain(); \ No newline at end of file +module.exports = hasInternalDomain; \ No newline at end of file From f7ed5dff992c4d5520a0eb5bb8de6a0096f5a922 Mon Sep 17 00:00:00 2001 From: Dana Date: Thu, 15 Oct 2015 12:13:29 +0000 Subject: [PATCH 4/4] Rename blacklist file to something more descriptive --- node_modules/c9/{blacklist.js => has-internal-domain.js} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename node_modules/c9/{blacklist.js => has-internal-domain.js} (100%) diff --git a/node_modules/c9/blacklist.js b/node_modules/c9/has-internal-domain.js similarity index 100% rename from node_modules/c9/blacklist.js rename to node_modules/c9/has-internal-domain.js