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

@segment/analytics.js-core

Package Overview
Dependencies
Maintainers
61
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@segment/analytics.js-core - npm Package Compare versions

Comparing version 3.2.2 to 3.2.3

6

HISTORY.md
3.2.3 / 2017-11-09
==================
* Add support for schema defaults (#50).
3.2.2 / 2017-11-05

@@ -8,3 +13,2 @@ ==================

3.2.1 / 2017-11-03

@@ -11,0 +15,0 @@ ==================

@@ -314,2 +314,8 @@ 'use strict';

}
} else {
var defaultPlan = events.__default || { enabled: true };
if (!defaultPlan.enabled) {
// Disabled events should always be sent to Segment.
defaults(msg.integrations, { All: false, 'Segment.io': true });
}
}

@@ -316,0 +322,0 @@

2

package.json
{
"name": "@segment/analytics.js-core",
"author": "Segment <friends@segment.com>",
"version": "3.2.2",
"version": "3.2.3",
"description": "The hassle-free way to integrate analytics into any web application.",

@@ -6,0 +6,0 @@ "keywords": [

@@ -1176,2 +1176,52 @@ 'use strict';

it('should call #_invoke if new events are enabled', function() {
analytics.options.plan = {
track: {
__default: { enabled: true }
}
};
analytics.track('event');
assert(analytics._invoke.called);
var track = analytics._invoke.args[0][1];
assert.deepEqual({}, track.obj.integrations);
});
it('should call #_invoke for Segment if new events are disabled', function() {
analytics.options.plan = {
track: {
__default: { enabled: false }
}
};
analytics.track('even');
assert(analytics._invoke.called);
var track = analytics._invoke.args[0][1];
assert.deepEqual({ All: false, 'Segment.io': true }, track.obj.integrations);
});
it('should use the event plan if it exists and ignore defaults', function() {
analytics.options.plan = {
track: {
event: { enabled: true },
__default: { enabled: false }
}
};
analytics.track('event');
assert(analytics._invoke.called);
var track = analytics._invoke.args[0][1];
assert.deepEqual({}, track.obj.integrations);
});
it('should merge the event plan if it exists and ignore defaults', function() {
analytics.options.plan = {
track: {
event: { enabled: true, integrations: { Mixpanel: false } },
__default: { enabled: false }
}
};
analytics.track('event');
assert(analytics._invoke.called);
var track = analytics._invoke.args[0][1];
assert.deepEqual({ Mixpanel: false }, track.obj.integrations);
});
it('should not set ctx.integrations if plan.integrations is empty', function() {

@@ -1178,0 +1228,0 @@ analytics.options.plan = { track: { event: {} } };

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