crowdstart-analytics
Advanced tools
Comparing version 0.2.10 to 0.2.12
// Generated by CoffeeScript 1.10.0 | ||
var FacebookAudiences, Integration, | ||
var FacebookAudiences, Integration, parseCurrency, | ||
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, | ||
@@ -8,2 +8,10 @@ hasProp = {}.hasOwnProperty; | ||
parseCurrency = function(value) { | ||
if (typeof value === 'string') { | ||
return value; | ||
} else if (typeof value === 'number') { | ||
return value.toFixed(2); | ||
} | ||
}; | ||
module.exports = FacebookAudiences = (function(superClass) { | ||
@@ -110,3 +118,3 @@ extend(FacebookAudiences, superClass); | ||
fbq('track', 'Purchase', { | ||
value: props.total, | ||
value: parseCurrency(props.total), | ||
currency: (ref = props.currency) != null ? ref : 'USD' | ||
@@ -113,0 +121,0 @@ }); |
@@ -33,3 +33,2 @@ // Generated by CoffeeScript 1.10.0 | ||
Generic.prototype.track = function(event, props, opts, cb) { | ||
var err, error, fn; | ||
if (cb == null) { | ||
@@ -42,9 +41,3 @@ cb = function() {}; | ||
this.log('Generic.track', this.opts.name, event, props, opts); | ||
try { | ||
fn = new Function("function(event, props, opts, cb) {" + opts.code + "}"); | ||
return fn(event, props, opts, cb); | ||
} catch (error) { | ||
err = error; | ||
return this.log('Generic.error', this.opts.name, event, props, opts); | ||
} | ||
return this.opts.fn(event, props, opts, cb); | ||
}; | ||
@@ -51,0 +44,0 @@ |
{ | ||
"name": "crowdstart-analytics", | ||
"version": "0.2.10", | ||
"description": "Analytics support for Crowdstart.", | ||
"version": "0.2.12", | ||
"description": "Analytics support for Hanzo.", | ||
"main": "lib", | ||
@@ -27,14 +27,14 @@ "devDependencies": { | ||
"type": "git", | ||
"url": "git+https://github.com/crowdstart/analytics.git" | ||
"url": "git+https://github.com/hanzo-io/analytics.js.git" | ||
}, | ||
"keywords": [ | ||
"analytics", | ||
"crowdstart" | ||
"hanzo" | ||
], | ||
"author": "\"author\": \"Zach Kelling <zk@crowdstart.com> (http://zeekay.io)", | ||
"author": "\"author\": \"Zach Kelling <zk@hanzo.io> (http://hanzo.io)", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/crowdstart/analytics/issues" | ||
"url": "https://github.com/hanzo-io/analytics.js/issues" | ||
}, | ||
"homepage": "https://github.com/crowdstart/analytics#readme", | ||
"homepage": "https://github.com/hanzo-io/analytics.js#readme", | ||
"dependencies": { | ||
@@ -41,0 +41,0 @@ "load-iframe": "^1.0.0", |
@@ -1,2 +0,8 @@ | ||
# crowdstart-analytics | ||
Crowdstart's analytics library. Multiplexes client-side integrations for ease of use. | ||
# analytics.js | ||
Hanzo's analytics library. Multiplexes client-side integrations for ease of | ||
use. | ||
## Install | ||
```shell | ||
npm install @hanzo/analytics.js | ||
``` |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 14 instances in 1 package
9
6
0
141531
41
1803