Skip to content

Commit a194f98

Browse files
author
Julio Farah
authored
Remove ndhoule/keys in favor of Object.keys (#26)
* elevio * kenshoo-infinity * optimizely * segmentio * taplytics
1 parent 7bed520 commit a194f98

File tree

10 files changed

+13
-23
lines changed

10 files changed

+13
-23
lines changed

integrations/elevio/lib/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
var integration = require('@segment/analytics.js-integration');
44
var tick = require('next-tick');
55
var objCase = require('obj-case');
6-
var objectKeys = require('@ndhoule/keys');
76

87
/**
98
* Expose `Elevio` integration.
@@ -64,7 +63,7 @@ Elevio.prototype.identify = function(identify) {
6463
if (name) user.name = name;
6564
if (plan) user.plan = [plan];
6665
if (plan) user.groups = [plan];
67-
if (objectKeys(traits).length > 0) user.traits = traits;
66+
if (Object.keys(traits).length > 0) user.traits = traits;
6867
window._elev.user = user;
6968
if (typeof window._elev.setUser === 'function') {
7069
window._elev.setUser(user);

integrations/elevio/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-elevio",
33
"description": "The Elevio analytics.js integration.",
4-
"version": "2.3.1",
4+
"version": "2.3.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/keys": "^2.0.0",
2827
"@segment/analytics.js-integration": "^3.3.2",
2928
"next-tick": "^1.0.0",
3029
"obj-case": "^0.2.0"

integrations/kenshoo-infinity/lib/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ var integration = require('@segment/analytics.js-integration');
88
var reject = require('reject');
99
var remove = require('obj-case').del;
1010
var extend = require('@ndhoule/extend');
11-
var keys = require('@ndhoule/keys');
1211
var trample = require('@segment/trample');
1312

1413
/**
@@ -115,7 +114,7 @@ function limitChars(string, limit) {
115114
function format(properties) {
116115
var ret = {};
117116
// Sort keys alphabetically and take the first 15
118-
var sortedKeys = keys(properties)
117+
var sortedKeys = Object.keys(properties)
119118
.sort()
120119
.slice(0, 15);
121120
sortedKeys.forEach(function(key) {

integrations/kenshoo-infinity/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-kenshoo-infinity",
33
"description": "The Kenshoo Infinity analytics.js integration.",
4-
"version": "1.0.1",
4+
"version": "1.0.2",
55
"keywords": [
66
"analytics.js",
77
"analytics.js-integration",
@@ -26,7 +26,6 @@
2626
"homepage": "https://github.com/segmentio/analytics.js-integrations/blob/master/integrations/kenshoo-infinity#readme",
2727
"dependencies": {
2828
"@ndhoule/extend": "^2.0.0",
29-
"@ndhoule/keys": "^2.0.0",
3029
"@segment/analytics.js-integration": "^3.3.2",
3130
"@segment/trample": "^0.2.0",
3231
"obj-case": "^0.2.0",

integrations/optimizely/lib/index.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
* Module dependencies.
55
*/
66

7-
var keys = require('@ndhoule/keys');
87
var values = require('@ndhoule/values');
98
var foldl = require('@ndhoule/foldl');
109
var integration = require('@segment/analytics.js-integration');
@@ -202,7 +201,7 @@ Optimizely.prototype.sendClassicDataToSegment = function(experimentState) {
202201
);
203202

204203
// Sorting for consistency across browsers
205-
var variationIds = keys(variationsMap).sort();
204+
var variationIds = Object.keys(variationsMap).sort();
206205
var variationNames = values(variationsMap).sort();
207206

208207
// Send data via `.track()`
@@ -248,7 +247,7 @@ Optimizely.prototype.sendClassicDataToSegment = function(experimentState) {
248247
}
249248

250249
// Sorting for consistency across browsers
251-
props.sectionId = keys(activeSections)
250+
props.sectionId = Object.keys(activeSections)
252251
.sort()
253252
.join(); // Not adding space for backward compat/consistency reasons since all IDs we've never had spaces
254253
props.sectionName = values(activeSections)
@@ -338,7 +337,7 @@ Optimizely.prototype.sendNewDataToSegment = function(campaignState) {
338337
);
339338

340339
// Sorting for consistency across browsers
341-
var audienceIds = keys(audiencesMap)
340+
var audienceIds = Object.keys(audiencesMap)
342341
.sort()
343342
.join(); // Not adding space for backward compat/consistency reasons since all IDs we've never had spaces
344343
var audienceNames = values(audiencesMap)

integrations/optimizely/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-optimizely",
33
"description": "The Optimizely analytics.js integration.",
4-
"version": "3.5.1",
4+
"version": "3.5.2",
55
"keywords": [
66
"analytics.js",
77
"analytics.js-integration",
@@ -25,7 +25,6 @@
2525
},
2626
"dependencies": {
2727
"@ndhoule/foldl": "^2.0.1",
28-
"@ndhoule/keys": "^2.0.0",
2928
"@ndhoule/values": "^2.0.1",
3029
"@segment/analytics.js-integration": "^3.3.2",
3130
"global-queue": "^1.0.1",

integrations/segmentio/lib/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ var clone = require('component-clone');
99
var JSCookie = require('js-cookie');
1010
var extend = require('@ndhoule/extend');
1111
var integration = require('@segment/analytics.js-integration');
12-
var keys = require('@ndhoule/keys');
1312
var localstorage = require('yields-store');
1413
var protocol = require('@segment/protocol');
1514
var send = require('@segment/send-json');
@@ -327,7 +326,7 @@ Segment.prototype.normalize = function(message) {
327326
msg._metadata = { failedInitializations: failedInitializations };
328327
}
329328
if (this.options.addBundledMetadata) {
330-
var bundled = keys(this.analytics.Integrations);
329+
var bundled = Object.keys(this.analytics.Integrations);
331330
msg._metadata = msg._metadata || {};
332331
msg._metadata.bundled = bundled;
333332
msg._metadata.unbundled = this.options.unbundledIntegrations;

integrations/segmentio/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-segmentio",
33
"description": "The Segmentio analytics.js integration.",
4-
"version": "4.2.7",
4+
"version": "4.2.8",
55
"keywords": [
66
"analytics.js",
77
"analytics.js-integration",
@@ -25,7 +25,6 @@
2525
},
2626
"dependencies": {
2727
"@ndhoule/extend": "^2.0.0",
28-
"@ndhoule/keys": "^2.0.0",
2928
"@segment/ad-params": "^1.0.0",
3029
"@segment/analytics.js-integration": "^3.3.2",
3130
"@segment/localstorage-retry": "^1.2.2",

integrations/taplytics/lib/index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
var integration = require('@segment/analytics.js-integration');
88
var is = require('is');
9-
var keys = require('@ndhoule/keys');
109
var push = require('global-queue')('_tlq');
1110

1211
/**
@@ -62,7 +61,7 @@ Taplytics.prototype.identify = function(identify) {
6261

6362
if (userId) attrs.id = userId;
6463

65-
if (keys(attrs).length) {
64+
if (Object.keys(attrs).length) {
6665
push('identify', attrs);
6766
}
6867
};
@@ -85,7 +84,7 @@ Taplytics.prototype.group = function(group) {
8584
if (traits) attrs.groupTraits = traits;
8685
if (userId) attrs.id = userId;
8786

88-
if (keys(attrs).length) push('identify', attrs);
87+
if (Object.keys(attrs).length) push('identify', attrs);
8988
};
9089

9190
/**

integrations/taplytics/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-taplytics",
33
"description": "The Taplytics analytics.js integration.",
4-
"version": "2.0.1",
4+
"version": "2.0.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/keys": "^2.0.0",
2827
"@segment/analytics.js-integration": "^3.3.2",
2928
"global-queue": "^1.0.1",
3029
"is": "^3.1.0"

0 commit comments

Comments
 (0)