Skip to content

Commit 133720d

Browse files
author
Jose Tavares
committed
fix: add object.assign polyfill
1 parent 9db5345 commit 133720d

8 files changed

Lines changed: 85 additions & 27 deletions

File tree

.babelrc

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
{
2-
"presets": [
3-
["env", { modules: false }]
4-
],
5-
"plugins": ["external-helpers"]
2+
"presets": [
3+
[
4+
"env",
5+
{
6+
"modules": false
7+
}
8+
]
9+
],
10+
"plugins": [
11+
"external-helpers",
12+
"transform-object-assign"
13+
]
614
}

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "statful-client-javascript",
3-
"version": "2.1.2",
3+
"version": "2.1.3",
44
"description": "Statful client for Javascript applications",
55
"main": "dist/statful.js",
66
"authors": [

dist/statful.js

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* statful-client-javascript 2.1.2
2+
* statful-client-javascript 2.1.3
33
* Copyright 2018 Statful <https://www.statful.com/>
44
*/
55

@@ -46,6 +46,26 @@ var createClass = function () {
4646
};
4747
}();
4848

49+
50+
51+
52+
53+
54+
55+
var _extends = Object.assign || function (target) {
56+
for (var i = 1; i < arguments.length; i++) {
57+
var source = arguments[i];
58+
59+
for (var key in source) {
60+
if (Object.prototype.hasOwnProperty.call(source, key)) {
61+
target[key] = source[key];
62+
}
63+
}
64+
}
65+
66+
return target;
67+
};
68+
4969
/* eslint-disable no-console */
5070
var Logger = function () {
5171
function Logger(enableDebug) {
@@ -84,7 +104,7 @@ var StatfulUtil = function () {
84104
classCallCheck(this, StatfulUtil);
85105

86106
this.config = {};
87-
Object.assign(this.config, config);
107+
_extends(this.config, config);
88108

89109
this.logger = new Logger(this.config.debug);
90110
if (this.config && this.config.flushInterval) {
@@ -257,9 +277,9 @@ var Metric = function () {
257277

258278
var tags = {};
259279

260-
Object.assign(tags, globalTags);
261-
Object.assign(tags, typeTags);
262-
Object.assign(tags, methodTags);
280+
_extends(tags, globalTags);
281+
_extends(tags, typeTags);
282+
_extends(tags, methodTags);
263283

264284
if (!tags.app && app) {
265285
tags.app = app;
@@ -429,8 +449,8 @@ var Statful = function () {
429449
clientConfig = {};
430450
}
431451

432-
Object.assign(this.config, defaultConfig);
433-
Object.assign(this.config, clientConfig);
452+
_extends(this.config, defaultConfig);
453+
_extends(this.config, clientConfig);
434454

435455
// Create Logger
436456
this.logger = new Logger(this.config.debug);
@@ -560,7 +580,7 @@ var Statful = function () {
560580
clearMeasures: false
561581
};
562582

563-
Object.assign(defaults$$1, options);
583+
_extends(defaults$$1, options);
564584

565585
// Create endMark if none is set
566586
if (!defaults$$1.endMark) {

dist/statful.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/statful.umd.js

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* statful-client-javascript 2.1.2
2+
* statful-client-javascript 2.1.3
33
* Copyright 2018 Statful <https://www.statful.com/>
44
*/
55

@@ -49,6 +49,26 @@ var createClass = function () {
4949
};
5050
}();
5151

52+
53+
54+
55+
56+
57+
58+
var _extends = Object.assign || function (target) {
59+
for (var i = 1; i < arguments.length; i++) {
60+
var source = arguments[i];
61+
62+
for (var key in source) {
63+
if (Object.prototype.hasOwnProperty.call(source, key)) {
64+
target[key] = source[key];
65+
}
66+
}
67+
}
68+
69+
return target;
70+
};
71+
5272
/* eslint-disable no-console */
5373
var Logger = function () {
5474
function Logger(enableDebug) {
@@ -87,7 +107,7 @@ var StatfulUtil = function () {
87107
classCallCheck(this, StatfulUtil);
88108

89109
this.config = {};
90-
Object.assign(this.config, config);
110+
_extends(this.config, config);
91111

92112
this.logger = new Logger(this.config.debug);
93113
if (this.config && this.config.flushInterval) {
@@ -260,9 +280,9 @@ var Metric = function () {
260280

261281
var tags = {};
262282

263-
Object.assign(tags, globalTags);
264-
Object.assign(tags, typeTags);
265-
Object.assign(tags, methodTags);
283+
_extends(tags, globalTags);
284+
_extends(tags, typeTags);
285+
_extends(tags, methodTags);
266286

267287
if (!tags.app && app) {
268288
tags.app = app;
@@ -432,8 +452,8 @@ var Statful = function () {
432452
clientConfig = {};
433453
}
434454

435-
Object.assign(this.config, defaultConfig);
436-
Object.assign(this.config, clientConfig);
455+
_extends(this.config, defaultConfig);
456+
_extends(this.config, clientConfig);
437457

438458
// Create Logger
439459
this.logger = new Logger(this.config.debug);
@@ -563,7 +583,7 @@ var Statful = function () {
563583
clearMeasures: false
564584
};
565585

566-
Object.assign(defaults$$1, options);
586+
_extends(defaults$$1, options);
567587

568588
// Create endMark if none is set
569589
if (!defaults$$1.endMark) {

dist/statful.umd.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 10 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "statful-client-javascript",
3-
"version": "2.1.2",
3+
"version": "2.1.3",
44
"description": "Statful client for Javascript applications",
55
"banner": "/**\n* <%= pkg.name %> <%= pkg.version %>\n* Copyright 2018 Statful <https://www.statful.com/>\n*/\n",
66
"scripts": {
@@ -24,6 +24,7 @@
2424
"devDependencies": {
2525
"babel-core": "^6.26.0",
2626
"babel-plugin-external-helpers": "^6.22.0",
27+
"babel-plugin-transform-object-assign": "^6.22.0",
2728
"babel-polyfill": "^6.26.0",
2829
"babel-preset-env": "^1.6.1",
2930
"eslint": "^4.19.1",

0 commit comments

Comments
 (0)