analytics-node
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -0,1 +1,6 @@ | ||
1.0.4 - 2014-08-14 | ||
================== | ||
* fix: given contexts to extended and not wiped out | ||
1.0.3 - 2014-08-05 | ||
@@ -2,0 +7,0 @@ ================== |
@@ -11,2 +11,3 @@ | ||
var version = require('../package.json').version; | ||
var extend = require('lodash').extend; | ||
@@ -169,3 +170,3 @@ global.setImmediate = global.setImmediate || process.nextTick.bind(process); | ||
message.type = type; | ||
message.context = { library: { name: 'analytics-node', version: version }}; | ||
message.context = extend(message.context || {}, { library: { name: 'analytics-node', version: version }}); | ||
if (!message.timestamp) message.timestamp = new Date(); | ||
@@ -172,0 +173,0 @@ |
{ | ||
"name": "analytics-node", | ||
"repository": "git://github.com/segmentio/analytics-node", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "The hassle-free way to integrate analytics into any node application.", | ||
@@ -19,2 +19,3 @@ "keywords": [ | ||
"join-component": "~1.0.0", | ||
"lodash": "~2.4.1", | ||
"superagent": "~0.16.0", | ||
@@ -21,0 +22,0 @@ "debug": "~1.0.4", |
@@ -106,2 +106,13 @@ | ||
}); | ||
it('should extend the given context', function(){ | ||
a.enqueue('type', { event: 'test', context: { name: 'travis' } }, noop); | ||
assert.deepEqual(a.queue[0].message.context, { | ||
library: { | ||
name:'analytics-node', | ||
version: require('../package.json').version | ||
}, | ||
name: 'travis' | ||
}); | ||
}); | ||
}); | ||
@@ -108,0 +119,0 @@ |
18120
515
7
+ Addedlodash@~2.4.1
+ Addedlodash@2.4.2(transitive)