Skip to content

Commit 40da66f

Browse files
committed
chore: Generate latest bundle
1 parent 47bfd61 commit 40da66f

2 files changed

Lines changed: 26 additions & 32 deletions

File tree

dist/LocalyticsEventForwarder.common.js

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,6 @@ function isObject(val) {
1111
return val != null && typeof val === 'object' && Array.isArray(val) === false;
1212
}
1313

14-
var isobject = /*#__PURE__*/Object.freeze({
15-
'default': isObject
16-
});
17-
18-
function getCjsExportFromNamespace (n) {
19-
return n && n['default'] || n;
20-
}
21-
22-
var isobject$1 = getCjsExportFromNamespace(isobject);
23-
2414
// Copyright 2015 mParticle, Inc.
2515
//
2616
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -99,7 +89,7 @@ var isobject$1 = getCjsExportFromNamespace(isobject);
9989
l[i] = function() { (l[i].q = l[i].q || []).push(arguments); };
10090
l[i].t = +new Date;
10191
(s = y.createElement(t)).type = 'text/javascript';
102-
s.src = '//web.localytics.com/v3/localytics.js';
92+
s.src = '//web.localytics.com/v4/localytics.min.js';
10393
(c = y.getElementsByTagName(t)[0]).parentNode.insertBefore(s, c);
10494
}(window, document, 'script', 'll');
10595

@@ -335,16 +325,16 @@ var isobject$1 = getCjsExportFromNamespace(isobject);
335325

336326
function register(config) {
337327
if (!config) {
338-
window.console.log('You must pass a config object to register the kit ' + name);
328+
console.log('You must pass a config object to register the kit ' + name);
339329
return;
340330
}
341331

342-
if (!isobject$1(config)) {
343-
window.console.log('\'config\' must be an object. You passed in a ' + typeof config);
332+
if (!isObject(config)) {
333+
console.log('\'config\' must be an object. You passed in a ' + typeof config);
344334
return;
345335
}
346336

347-
if (isobject$1(config.kits)) {
337+
if (isObject(config.kits)) {
348338
config.kits[name] = {
349339
constructor: constructor
350340
};
@@ -354,15 +344,17 @@ var isobject$1 = getCjsExportFromNamespace(isobject);
354344
constructor: constructor
355345
};
356346
}
357-
window.console.log('Successfully registered ' + name + ' to your mParticle configuration');
347+
console.log('Successfully registered ' + name + ' to your mParticle configuration');
358348
}
359349

360-
if (window && window.mParticle && window.mParticle.addForwarder) {
361-
window.mParticle.addForwarder({
362-
name: name,
363-
constructor: constructor,
364-
getId: getId
365-
});
350+
if (typeof window !== 'undefined') {
351+
if (window && window.mParticle && window.mParticle.addForwarder) {
352+
window.mParticle.addForwarder({
353+
name: name,
354+
constructor: constructor,
355+
getId: getId
356+
});
357+
}
366358
}
367359

368360
var LocalyticsEventForwarder = {

dist/LocalyticsEventForwarder.iife.js

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ var mpLocalyticsKit = (function (exports) {
8888
l[i] = function() { (l[i].q = l[i].q || []).push(arguments); };
8989
l[i].t = +new Date;
9090
(s = y.createElement(t)).type = 'text/javascript';
91-
s.src = '//web.localytics.com/v3/localytics.js';
91+
s.src = '//web.localytics.com/v4/localytics.min.js';
9292
(c = y.getElementsByTagName(t)[0]).parentNode.insertBefore(s, c);
9393
}(window, document, 'script', 'll');
9494

@@ -324,12 +324,12 @@ var mpLocalyticsKit = (function (exports) {
324324

325325
function register(config) {
326326
if (!config) {
327-
window.console.log('You must pass a config object to register the kit ' + name);
327+
console.log('You must pass a config object to register the kit ' + name);
328328
return;
329329
}
330330

331331
if (!isObject(config)) {
332-
window.console.log('\'config\' must be an object. You passed in a ' + typeof config);
332+
console.log('\'config\' must be an object. You passed in a ' + typeof config);
333333
return;
334334
}
335335

@@ -343,15 +343,17 @@ var mpLocalyticsKit = (function (exports) {
343343
constructor: constructor
344344
};
345345
}
346-
window.console.log('Successfully registered ' + name + ' to your mParticle configuration');
346+
console.log('Successfully registered ' + name + ' to your mParticle configuration');
347347
}
348348

349-
if (window && window.mParticle && window.mParticle.addForwarder) {
350-
window.mParticle.addForwarder({
351-
name: name,
352-
constructor: constructor,
353-
getId: getId
354-
});
349+
if (typeof window !== 'undefined') {
350+
if (window && window.mParticle && window.mParticle.addForwarder) {
351+
window.mParticle.addForwarder({
352+
name: name,
353+
constructor: constructor,
354+
getId: getId
355+
});
356+
}
355357
}
356358

357359
var LocalyticsEventForwarder = {

0 commit comments

Comments
 (0)