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
+
1
5
# 4.0.1 / 2020-08-21
2
6
3
7
- 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 {
939
939
function pickPrefix ( prefix : string , object : object ) {
940
940
var length = prefix . length ;
941
941
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
+ } , { } ) ;
953
949
}
954
950
} ;
955
951
Original file line number Diff line number Diff line change 32
32
"dependencies" : {
33
33
"@ndhoule/defaults" : " ^2.0.1" ,
34
34
"@ndhoule/extend" : " ^2.0.0" ,
35
- "@ndhoule/foldl" : " ^2.0.1" ,
36
35
"@ndhoule/includes" : " ^2.0.1" ,
37
36
"@ndhoule/keys" : " ^2.0.0" ,
38
37
"@ndhoule/pick" : " ^2.0.0" ,
You can’t perform that action at this time.
0 commit comments