Skip to content
This repository was archived by the owner on Sep 3, 2022. It is now read-only.

Commit 6e33d3d

Browse files
Replace @ndhoule/pick with lodash.pick (#210)
1 parent 017124b commit 6e33d3d

File tree

4 files changed

+15
-10
lines changed

4 files changed

+15
-10
lines changed

HISTORY.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 4.1.3 / 2020-09-16
2+
3+
- Replace `@ndhoule/pick` with `lodash.pick`
4+
15
# 4.1.2 / 2020-09-16
26

37
- Replaces `@ndhoule/extend` with `lodash.assignin`

lib/analytics.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
} from './types';
1010

1111
import cloneDeep from 'lodash.clonedeep'
12+
import pick from 'lodash.pick'
1213

1314
var _analytics = global.analytics;
1415

@@ -42,7 +43,6 @@ var nextTick = require('next-tick');
4243
var normalize = require('./normalize');
4344
var on = require('component-event').bind;
4445
var pageDefaults = require('./pageDefaults');
45-
var pick = require('@ndhoule/pick');
4646
var prevent = require('@segment/prevent-default');
4747
var querystring = require('component-querystring');
4848
var store = require('./store');
@@ -600,20 +600,20 @@ Analytics.prototype.page = function(
600600

601601
// Ensure properties has baseline spec properties.
602602
// TODO: Eventually move these entirely to `options.context.page`
603-
var defs = pageDefaults();
603+
const defs = pageDefaults();
604604
defaults(properties, defs);
605605

606606
// Mirror user overrides to `options.context.page` (but exclude custom properties)
607607
// (Any page defaults get applied in `this.normalize` for consistency.)
608608
// Weird, yeah--moving special props to `context.page` will fix this in the long term.
609-
var overrides = pick(Object.keys(defs), properties);
609+
const overrides = pick(properties, Object.keys(defs));
610610
if (!is.empty(overrides)) {
611611
options = options || {};
612612
options.context = options.context || {};
613613
options.context.page = overrides;
614614
}
615615

616-
var msg = this.normalize({
616+
const msg = this.normalize({
617617
properties: properties,
618618
category: category,
619619
options: options,

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@segment/analytics.js-core",
33
"author": "Segment <[email protected]>",
4-
"version": "4.1.2",
4+
"version": "4.1.3",
55
"description": "The hassle-free way to integrate analytics into any web application.",
66
"types": "lib/index.d.ts",
77
"keywords": [
@@ -32,7 +32,6 @@
3232
"dependencies": {
3333
"@ndhoule/defaults": "^2.0.1",
3434
"@ndhoule/includes": "^2.0.1",
35-
"@ndhoule/pick": "^2.0.0",
3635
"@segment/canonical": "^1.0.0",
3736
"@segment/cookie": "^1.1.5",
3837
"@segment/is-meta": "^1.0.0",
@@ -55,6 +54,7 @@
5554
"is": "^3.1.0",
5655
"lodash.assignin": "^4.2.0",
5756
"lodash.clonedeep": "^4.5.0",
57+
"lodash.pick": "^4.4.0",
5858
"new-date": "^1.0.0",
5959
"next-tick": "^0.2.2",
6060
"package-json-versionify": "^1.0.4",

yarn.lock

+5-4
Original file line numberDiff line numberDiff line change
@@ -315,10 +315,6 @@
315315
dependencies:
316316
"@ndhoule/each" "^2.0.1"
317317

318-
"@ndhoule/pick@^2.0.0":
319-
version "2.0.0"
320-
resolved "https://registry.yarnpkg.com/@ndhoule/pick/-/pick-2.0.0.tgz#e1eb1a6ca3243eef56daa095c3a1612c74a52156"
321-
322318
"@ndhoule/rest@^2.0.0":
323319
version "2.0.0"
324320
resolved "https://registry.yarnpkg.com/@ndhoule/rest/-/rest-2.0.0.tgz#0346b02a964a513ed2ba24d164f01d34f2107a0f"
@@ -6119,6 +6115,11 @@ lodash.mergewith@^4.6.2:
61196115
resolved "https://registry.yarnpkg.com/lodash.mergewith/-/lodash.mergewith-4.6.2.tgz#617121f89ac55f59047c7aec1ccd6654c6590f55"
61206116
integrity sha512-GK3g5RPZWTRSeLSpgP8Xhra+pnjBC56q9FZYe1d5RN3TJ35dbkGy3YqBSMbyCrlbi+CM9Z3Jk5yTL7RCsqboyQ==
61216117

6118+
lodash.pick@^4.4.0:
6119+
version "4.4.0"
6120+
resolved "https://registry.yarnpkg.com/lodash.pick/-/lodash.pick-4.4.0.tgz#52f05610fff9ded422611441ed1fc123a03001b3"
6121+
integrity sha1-UvBWEP/53tQiYRRB7R/BI6AwAbM=
6122+
61226123
lodash.reduce@^4.6.0:
61236124
version "4.6.0"
61246125
resolved "https://registry.yarnpkg.com/lodash.reduce/-/lodash.reduce-4.6.0.tgz#f1ab6b839299ad48f784abbf476596f03b914d3b"

0 commit comments

Comments
 (0)