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

analytics.js-loader

Package Overview
Dependencies
Maintainers
4
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

analytics.js-loader - npm Package Compare versions

Comparing version 2.1.1 to 2.1.2

4

HISTORY.md

@@ -0,1 +1,5 @@

# 2.1.2 (2016-01-31)
* fix loader to compensate for segment queue object
# 2.1.1 (2016-01-01)

@@ -2,0 +6,0 @@

@@ -90,3 +90,27 @@ module.exports = load;

return analytics;
/*
* The analytics.js-loader module returns the "initial" analytics
* object, which is basically just a queue to hold events until the
* "real" one is loaded with a global script. Problem is, the "real"
* one simply replaces `window.analytics`, and doesn't change over
* this initial "queue" object, meaning that nothing gets registered
* after the "real" one is loaded - things just keep adding to the queue.
*
* This is why we save off `initialAnalytics`, and then always run
* methods through `window.analytics`, which might be the queue, and
* might be the real one.
*/
var initialAnalytics = analytics;
var actualAnalytics = {};
window.analytics = initialAnalytics;
initialAnalytics.methods.forEach(function(method) {
actualAnalytics[method] = function() {
window.analytics[method].apply(window.analytics, arguments);
}
});
return actualAnalytics;
}

2

package.json
{
"name": "analytics.js-loader",
"version": "2.1.1",
"version": "2.1.2",
"description": "Asynchronously load segment.com analytics.js with an npm module",

@@ -5,0 +5,0 @@ "main": "index.js",

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