This repository was archived by the owner on Sep 3, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +11
-12
lines changed Expand file tree Collapse file tree 3 files changed +11
-12
lines changed Original file line number Diff line number Diff line change 1+ # 4.0.2 / 2020-09-01
2+
3+ - Replace @ndhoule/foldl with Array.prototype.reduce
4+
15# 4.0.1 / 2020-08-21
26
37- Minor version bump since previous version was published incorrectly. No code change.
Original file line number Diff line number Diff line change @@ -939,17 +939,13 @@ Analytics.prototype._parseQuery = function(query: string): SegmentAnalytics {
939939 function pickPrefix ( prefix : string , object : object ) {
940940 var length = prefix . length ;
941941 var sub ;
942- return foldl (
943- function ( acc , val , key ) {
944- if ( key . substr ( 0 , length ) === prefix ) {
945- sub = key . substr ( length ) ;
946- acc [ sub ] = val ;
947- }
948- return acc ;
949- } ,
950- { } ,
951- object
952- ) ;
942+ return Object . keys ( object ) . reduce ( function ( acc , key ) {
943+ if ( key . substr ( 0 , length ) === prefix ) {
944+ sub = key . substr ( length ) ;
945+ acc [ sub ] = object [ key ] ;
946+ }
947+ return acc ;
948+ } , { } ) ;
953949 }
954950} ;
955951
Original file line number Diff line number Diff line change 3232 "dependencies" : {
3333 "@ndhoule/defaults" : " ^2.0.1" ,
3434 "@ndhoule/extend" : " ^2.0.0" ,
35- "@ndhoule/foldl" : " ^2.0.1" ,
3635 "@ndhoule/includes" : " ^2.0.1" ,
3736 "@ndhoule/keys" : " ^2.0.0" ,
3837 "@ndhoule/pick" : " ^2.0.0" ,
You can’t perform that action at this time.
0 commit comments