Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

leek

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

leek - npm Package Compare versions

Comparing version 0.0.6 to 0.0.7

lib/md5.js

28

lib/leek.js
'use strict';
var Configstore = require('configstore'),
Promise = require('rsvp').Promise,
var Promise = require('rsvp').Promise,
provider = require('./provider'),
uuid = require('node-uuid'),
request = require('request'),
getVersions = require('./get-versions'),
md5 = require('./md5'),
extend = require('lodash').extend;

@@ -20,23 +19,18 @@

if (!options.name) {
throw new Error('You need to specify the name.');
if (!options.globalName) {
throw new Error('You need to specify the global name.');
}
this.trackingCode = options.trackingCode;
this.name = options.name;
this.name = options.name || '';
this.globalName = options.globalName;
this.clientId = this.globalName + md5(this.name);
this.version = options.version || '';
this.silent = options.silent || false;
this.config = options.config || new Configstore('leek-' + this.name, {
clientId: options.clientId || uuid.v1()
});
}
Object.defineProperty(Leek.prototype, 'clientId', {
get: function() {
return this.config.get('clientId');
},
set: function(value) {
this.config.set('clientId', value);
}
});
Leek.prototype.setName = function(value) {
this.name = value;
this.clientId = this.globalName + md5(this.name);
};

@@ -43,0 +37,0 @@ Leek.prototype._enqueue = function(eventType, meta) {

@@ -16,5 +16,5 @@ 'use strict';

cid: this.clientId,
an: this.name,
an: this.globalName,
av: this.version + ' ' + meta.platform + ', node ' + meta.version,
cd: meta.name + ' ' + meta.message,
cd: meta.message,
qt: now - parseInt(id, 10),

@@ -38,3 +38,3 @@ z: now

cid: this.clientId,
an: this.name,
an: this.globalName,
av: this.version + ' ' + meta.platform + ', node ' + meta.version,

@@ -61,3 +61,3 @@ exd: meta.description,

cid: this.clientId,
an: this.name,
an: this.globalName,
av: this.version + ' ' + meta.platform + ', node ' + meta.version,

@@ -86,6 +86,6 @@ utc: meta.category,

cid: this.clientId,
an: this.name,
an: this.globalName,
av: this.version + ' ' + meta.platform + ', node ' + meta.version,
ec: meta.category,
ea: meta.name,
ea: meta.globalName,
el: meta.value,

@@ -92,0 +92,0 @@ ev: meta.label,

{
"name": "leek",
"description": "GA tracking",
"version": "0.0.6",
"version": "0.0.7",
"keywords": [

@@ -26,5 +26,3 @@ "stats",

"request": "^2.27.0",
"lodash": "^2.4.1",
"node-uuid": "^1.4.1",
"configstore": "^0.3.0"
"lodash": "^2.4.1"
},

@@ -31,0 +29,0 @@ "devDependencies": {

@@ -24,4 +24,5 @@ 'use strict';

leek = new Leek({
name: 'ember-cli',
version: '0.0.23'
globalName: 'ember-cli',
name: 'cli',
version: '0.0.23'
});

@@ -31,15 +32,7 @@ }, 'You need to specify the tracking code.');

it('asserts if name is not specified', function() {
throws(function() {
leek = new Leek({
trackingCode: 'xxxxx',
version: '0.0.23'
});
}, 'You need to specify the name.');
});
it('should set options', function() {
leek = new Leek({
trackingCode: 'xxxxx',
name: 'ember-cli',
globalName: 'ember-cli',
name: 'cli',
clientId: 'things',

@@ -50,4 +43,4 @@ version: '0.0.1'

equal(leek.trackingCode, 'xxxxx', 'tracking code is correct');
equal(leek.name, 'ember-cli', 'name is correct');
ok(leek.config);
equal(leek.globalName, 'ember-cli', 'name is correct');
equal(leek.name, 'cli', 'name is correct');
equal(leek.version, '0.0.1', 'version is correct');

@@ -59,3 +52,4 @@ });

trackingCode: 'xxxxx',
name: 'ember-cli',
globalName: 'ember-cli',
name: 'cli',
clientId: 'things'

@@ -70,3 +64,4 @@ });

trackingCode: 'xxxxx',
name: 'ember-cli'
globalName: 'ember-cli',
name: 'cli'
});

@@ -83,3 +78,4 @@

trackingCode: 'xxxxx',
name: 'ember-cli'
globalName: 'ember-cli',
name: 'cli'
});

@@ -86,0 +82,0 @@

@@ -36,3 +36,4 @@ 'use strict';

trackingCode: 'xxxxx',
name: 'ember-cli',
globalName: 'ember-cli',
name: 'cli',
clientId: 'things',

@@ -51,2 +52,3 @@ version: '0.0.1'

variable: 'test',
label: 'broccoli',
value: '200ms'

@@ -57,8 +59,7 @@ });

equal(params.qs.v, expected.v);
equal(params.qs.t, expected.t);
equal(params.qs.v, expected.v);
equal(params.qs.t, expected.t);
equal(params.qs.aip, expected.aip);
equal(params.qs.tid, expected.tid);
equal(params.qs.cid, expected.cid);
equal(params.qs.an, expected.an);
equal(params.qs.an, expected.an);

@@ -65,0 +66,0 @@ equal(params.qs.utv, expected.utv);

@@ -16,3 +16,4 @@ 'use strict';

trackingCode: 'xxxxx',
name: 'ember-cli',
globalName: 'ember-cli',
name: 'cli',
clientId: 'things',

@@ -57,3 +58,4 @@ version: '0.0.1'

trackingCode: 'xxxxx',
name: 'ember-cli',
globalName: 'ember-cli',
name: 'cli',
clientId: 'things',

@@ -98,3 +100,4 @@ version: '0.0.1'

trackingCode: 'xxxxx',
name: 'ember-cli',
globalName: 'ember-cli',
name: 'cli',
clientId: 'things',

@@ -122,2 +125,3 @@ version: '0.0.1'

variable: 'foo',
label: 'bar',
value: '100ms'

@@ -132,2 +136,3 @@ });

variable: 'foo',
label: 'bar',
value: '100ms'

@@ -143,3 +148,4 @@ }

trackingCode: 'xxxxx',
name: 'ember-cli',
globalName: 'ember-cli',
name: 'cli',
clientId: 'things',

@@ -183,2 +189,1 @@ version: '0.0.1'

});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc