This repository was archived by the owner on Sep 3, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +20
-10
lines changed Expand file tree Collapse file tree 5 files changed +20
-10
lines changed Original file line number Diff line number Diff line change 1+ # 4.1.2 / 2020-09-16
2+
3+ - Replaces ` @ndhoule/extend ` with ` lodash.assignin `
4+
15# 4.1.1 / 2020-09-15
26
37- Enable ` esModuleInterop ` in ` tsconfig.json `
Original file line number Diff line number Diff line change 22
33import { InitOptions } from './types' ;
44import cloneDeep from 'lodash.clonedeep'
5+ import assignIn from 'lodash.assignin'
56
67/*
78 * Module dependencies.
@@ -10,7 +11,6 @@ import cloneDeep from 'lodash.clonedeep'
1011var cookie = require ( './cookie' ) ;
1112var debug = require ( 'debug' ) ( 'analytics:entity' ) ;
1213var defaults = require ( '@ndhoule/defaults' ) ;
13- var extend = require ( '@ndhoule/extend' ) ;
1414var memory = require ( './memory' ) ;
1515var store = require ( './store' ) ;
1616var isodateTraverse = require ( '@segment/isodate-traverse' ) ;
@@ -221,10 +221,16 @@ Entity.prototype._setTraits = function(traits: object) {
221221
222222Entity . prototype . identify = function ( id ?: string , traits ?: object ) {
223223 traits = traits || { } ;
224- var current = this . id ( ) ;
225- if ( current === null || current === id )
226- traits = extend ( this . traits ( ) , traits ) ;
227- if ( id ) this . id ( id ) ;
224+ const current = this . id ( ) ;
225+
226+ if ( current === null || current === id ) {
227+ traits = assignIn ( this . traits ( ) , traits ) ;
228+ }
229+
230+ if ( id ) {
231+ this . id ( id ) ;
232+ }
233+
228234 this . debug ( 'identify %o, %o' , id , traits ) ;
229235 this . traits ( traits ) ;
230236 this . save ( ) ;
Original file line number Diff line number Diff line change 11{
22 "name" : " @segment/analytics.js-core" ,
33 "author" : " Segment <friends@segment.com>" ,
4- "version" : " 4.1.1 " ,
4+ "version" : " 4.1.2 " ,
55 "description" : " The hassle-free way to integrate analytics into any web application." ,
66 "types" : " lib/index.d.ts" ,
77 "keywords" : [
3131 "homepage" : " https://github.com/segmentio/analytics.js-core#readme" ,
3232 "dependencies" : {
3333 "@ndhoule/defaults" : " ^2.0.1" ,
34- "@ndhoule/extend" : " ^2.0.0" ,
3534 "@ndhoule/includes" : " ^2.0.1" ,
3635 "@ndhoule/pick" : " ^2.0.0" ,
3736 "@segment/canonical" : " ^1.0.0" ,
5453 "inherits" : " ^2.0.1" ,
5554 "install" : " ^0.7.3" ,
5655 "is" : " ^3.1.0" ,
56+ "lodash.assignin" : " ^4.2.0" ,
5757 "lodash.clonedeep" : " ^4.5.0" ,
5858 "new-date" : " ^1.0.0" ,
5959 "next-tick" : " ^0.2.2" ,
Original file line number Diff line number Diff line change 1- 'use strict' ;
1+ import assignIn from 'lodash.assignin'
22
33var Analytics = require ( '../build' ) . constructor ;
44var Facade = require ( 'segmentio-facade' ) ;
55var analytics = require ( '../build' ) ;
66var assert = require ( 'proclaim' ) ;
77var bind = require ( 'component-event' ) . bind ;
88var createIntegration = require ( '@segment/analytics.js-integration' ) ;
9- var extend = require ( '@ndhoule/extend' ) ;
109var type = require ( 'component-type' ) ;
1110var pageDefaults = require ( '../build/pageDefaults' ) ;
1211var sinon = require ( 'sinon' ) ;
@@ -836,7 +835,7 @@ describe('Analytics', function() {
836835 assert . deepEqual ( opts , { context : { page : defaults } } ) ;
837836 assert . deepEqual (
838837 props ,
839- extend ( defaults , { category : 'category' , name : 'name' } )
838+ assignIn ( { category : 'category' , name : 'name' } , defaults )
840839 ) ;
841840 done ( ) ;
842841 } ) ;
Original file line number Diff line number Diff line change @@ -5994,6 +5994,7 @@ lodash.assign@^4.2.0:
59945994lodash.assignin@^4.2.0 :
59955995 version "4.2.0"
59965996 resolved "https://registry.yarnpkg.com/lodash.assignin/-/lodash.assignin-4.2.0.tgz#ba8df5fb841eb0a3e8044232b0e263a8dc6a28a2"
5997+ integrity sha1-uo31+4QesKPoBEIysOJjqNxqKKI=
59975998
59985999lodash.clone@^4.5.0 :
59996000 version "4.5.0"
You can’t perform that action at this time.
0 commit comments