Skip to content

Commit 3cd8e32

Browse files
author
Julio Farah
authored
Remove ndhoule/clone in favor of object spread operator (#30)
* appboy * intercom * keen-io
1 parent 44a1841 commit 3cd8e32

File tree

6 files changed

+6
-12
lines changed

6 files changed

+6
-12
lines changed

integrations/appboy/lib/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
var integration = require('@segment/analytics.js-integration');
88
var Track = require('segmentio-facade').Track;
99
var del = require('obj-case').del;
10-
var clone = require('@ndhoule/clone');
1110
var appboyUtil = require('./appboyUtil');
1211

1312
/**
@@ -194,7 +193,7 @@ Appboy.prototype.identify = function(identify) {
194193
var gender = identify.gender();
195194
var lastName = identify.lastName();
196195
var phone = identify.phone();
197-
var traits = clone(identify.traits());
196+
var traits = { ...identify.traits() };
198197

199198
var options = this.options;
200199

integrations/appboy/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@segment/analytics.js-integration-appboy",
33
"description": "The Appboy analytics.js integration.",
4-
"version": "1.14.1",
4+
"version": "1.14.2",
55
"keywords": [
66
"analytics.js",
77
"analytics.js-integration",
@@ -24,7 +24,6 @@
2424
"url": "git+https://github.com/segmentio/analytics.js-integrations.git"
2525
},
2626
"dependencies": {
27-
"@ndhoule/clone": "^1.0.0",
2827
"@segment/analytics.js-integration": "^3.3.2",
2928
"obj-case": "^0.2.0",
3029
"@segment/facade": "^3.3.1"

integrations/intercom/lib/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ var del = require('obj-case').del;
99
var integration = require('@segment/analytics.js-integration');
1010
var is = require('is');
1111
var extend = require('@ndhoule/extend');
12-
var clone = require('@ndhoule/clone');
1312
var pick = require('@ndhoule/pick');
1413

1514
/**
@@ -267,7 +266,7 @@ function formatNestedCustomTraits(obj, settings) {
267266
var semanticTraits = basicIntercomTraits.concat(richLinkProperties);
268267

269268
// clone traits so we don't modify the original object
270-
var customTraits = clone(obj);
269+
var customTraits = { ...obj };
271270

272271
// filter out semanticTraits so that we only format custom nested traits
273272
semanticTraits.forEach(function(trait) {

integrations/intercom/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@segment/analytics.js-integration-intercom",
33
"description": "The Intercom analytics.js integration.",
4-
"version": "3.0.3",
4+
"version": "3.0.4",
55
"keywords": [
66
"analytics.js",
77
"analytics.js-integration",
@@ -24,7 +24,6 @@
2424
"url": "git+https://github.com/segmentio/analytics.js-integrations.git"
2525
},
2626
"dependencies": {
27-
"@ndhoule/clone": "^1.0.0",
2827
"@ndhoule/extend": "^2.0.0",
2928
"@ndhoule/foldl": "^2.0.1",
3029
"@ndhoule/pick": "^2.0.0",

integrations/keen-io/lib/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
*/
66

77
var integration = require('@segment/analytics.js-integration');
8-
var clone = require('@ndhoule/clone');
98

109
/**
1110
* Expose `Keen IO` integration.
@@ -144,7 +143,7 @@ Keen.prototype.identify = function(identify) {
144143
props = this.addons(props, identify);
145144
this.client.setGlobalProperties(function() {
146145
// Clone the props so the Keen Client can't manipulate the ref
147-
return clone(props);
146+
return { ...props };
148147
});
149148
};
150149

integrations/keen-io/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@segment/analytics.js-integration-keen-io",
33
"description": "The Keen Io analytics.js integration.",
4-
"version": "2.1.2",
4+
"version": "2.1.3",
55
"keywords": [
66
"analytics.js",
77
"analytics.js-integration",
@@ -24,7 +24,6 @@
2424
"url": "git+https://github.com/segmentio/analytics.js-integrations.git"
2525
},
2626
"dependencies": {
27-
"@ndhoule/clone": "^1.0.0",
2827
"@segment/analytics.js-integration": "^3.3.2"
2928
},
3029
"devDependencies": {

0 commit comments

Comments
 (0)