2015-10-23 11:46:43 +00:00
|
|
|
if (define === undefined) {
|
|
|
|
var define = function(fn) {
|
|
|
|
fn(require, exports, module);
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
define(function(require, exports, module) {
|
|
|
|
"use strict";
|
2015-12-08 11:56:38 +00:00
|
|
|
|
2015-10-23 11:46:43 +00:00
|
|
|
var hasInternalDomain = require("c9/has-internal-domain");
|
2015-11-23 18:35:15 +00:00
|
|
|
var hasInternalTestName = require("c9/has-internal-test-name");
|
2015-10-23 11:46:43 +00:00
|
|
|
|
2015-12-08 11:56:38 +00:00
|
|
|
function skipAnalytics(user) {
|
2015-10-23 11:46:43 +00:00
|
|
|
if (!user) return true;
|
2015-12-07 15:49:16 +00:00
|
|
|
if (user.id === -1) return true;
|
2015-12-08 11:56:38 +00:00
|
|
|
|
|
|
|
if (!user.id && user.uid === -1) return true;
|
2015-11-23 18:35:15 +00:00
|
|
|
|
|
|
|
if (hasInternalTestName(user)) return true;
|
2015-12-08 11:56:38 +00:00
|
|
|
if (hasInternalDomain(user.email)) return true;
|
2015-10-23 11:46:43 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = skipAnalytics;
|
|
|
|
});
|