@@ -58,35 +58,20 @@ function _extends() {
5858 return _extends . apply ( this , arguments ) ;
5959}
6060
61- function ownKeys ( object , enumerableOnly ) {
62- var keys = Object . keys ( object ) ;
63-
64- if ( Object . getOwnPropertySymbols ) {
65- var symbols = Object . getOwnPropertySymbols ( object ) ;
66- if ( enumerableOnly ) symbols = symbols . filter ( function ( sym ) {
67- return Object . getOwnPropertyDescriptor ( object , sym ) . enumerable ;
68- } ) ;
69- keys . push . apply ( keys , symbols ) ;
70- }
71-
72- return keys ;
73- }
74-
75- function _objectSpread2 ( target ) {
61+ function _objectSpread ( target ) {
7662 for ( var i = 1 ; i < arguments . length ; i ++ ) {
7763 var source = arguments [ i ] != null ? arguments [ i ] : { } ;
64+ var ownKeys = Object . keys ( source ) ;
7865
79- if ( i % 2 ) {
80- ownKeys ( source , true ) . forEach ( function ( key ) {
81- _defineProperty ( target , key , source [ key ] ) ;
82- } ) ;
83- } else if ( Object . getOwnPropertyDescriptors ) {
84- Object . defineProperties ( target , Object . getOwnPropertyDescriptors ( source ) ) ;
85- } else {
86- ownKeys ( source ) . forEach ( function ( key ) {
87- Object . defineProperty ( target , key , Object . getOwnPropertyDescriptor ( source , key ) ) ;
88- } ) ;
66+ if ( typeof Object . getOwnPropertySymbols === 'function' ) {
67+ ownKeys = ownKeys . concat ( Object . getOwnPropertySymbols ( source ) . filter ( function ( sym ) {
68+ return Object . getOwnPropertyDescriptor ( source , sym ) . enumerable ;
69+ } ) ) ;
8970 }
71+
72+ ownKeys . forEach ( function ( key ) {
73+ _defineProperty ( target , key , source [ key ] ) ;
74+ } ) ;
9075 }
9176
9277 return target ;
@@ -193,9 +178,9 @@ var validateMethods = (_validateMethods = {}, _defineProperty(_validateMethods,
193178} ) , _validateMethods ) ;
194179
195180var validateObject = function validateObject ( obj , defaultObj , validator ) {
196- var result = _objectSpread2 ( { } , obj ) ;
181+ var result = _objectSpread ( { } , obj ) ;
197182
198- var defaultValidator = _objectSpread2 ( { } , validator ) ;
183+ var defaultValidator = _objectSpread ( { } , validator ) ;
199184
200185 Object . entries ( defaultValidator ) . forEach ( function ( _ref ) {
201186 var _ref2 = _slicedToArray ( _ref , 2 ) ,
@@ -221,7 +206,7 @@ var validateObject = function validateObject(obj, defaultObj, validator) {
221206var filterObjWithDefaultObj = function filterObjWithDefaultObj ( obj , defaultObj ) {
222207 var filterKeys = arguments . length > 2 && arguments [ 2 ] !== undefined ? arguments [ 2 ] : [ ] ;
223208 return filterKeys . reduce ( function ( prev , key ) {
224- return Object . prototype . hasOwnProperty . call ( obj , key ) ? _objectSpread2 ( { } , prev , _defineProperty ( { } , key , obj [ key ] ) ) : _objectSpread2 ( { } , prev , _defineProperty ( { } , key , defaultObj [ key ] ) ) ;
209+ return Object . prototype . hasOwnProperty . call ( obj , key ) ? _objectSpread ( { } , prev , _defineProperty ( { } , key , obj [ key ] ) ) : _objectSpread ( { } , prev , _defineProperty ( { } , key , defaultObj [ key ] ) ) ;
225210 } , { } ) ;
226211} ;
227212
@@ -297,7 +282,7 @@ var decodeObj = function decodeObj(obj, objTypes) {
297282 key = _ref2 [ 0 ] ,
298283 value = _ref2 [ 1 ] ;
299284
300- return _objectSpread2 ( { } , prev , _defineProperty ( { } , key , decode ( objTypes [ key ] , value ) ) ) ;
285+ return _objectSpread ( { } , prev , _defineProperty ( { } , key , decode ( objTypes [ key ] , value ) ) ) ;
301286 } , { } ) ;
302287} ;
303288
@@ -321,7 +306,7 @@ var queryToPropsHOC = function queryToPropsHOC(DecoratedComponent, config) {
321306 throw new Error ( 'queryPropsConfig must be provided for configuration!' ) ;
322307 }
323308
324- var defaultState = _objectSpread2 ( { } , defaultQueryProps ) ;
309+ var defaultState = _objectSpread ( { } , defaultQueryProps ) ;
325310
326311 var queryToPropsComponent =
327312 /*#__PURE__*/
@@ -359,7 +344,7 @@ var queryToPropsHOC = function queryToPropsHOC(DecoratedComponent, config) {
359344 } ) ;
360345
361346 _defineProperty ( _assertThisInitialized ( _this ) , "__updateUrl" , function ( validatedState ) {
362- var newQueryObj = _objectSpread2 ( { } , _this . __getLocationQueryObj ( ) , { } , validatedState ) ;
347+ var newQueryObj = _objectSpread ( { } , _this . __getLocationQueryObj ( ) , validatedState ) ;
363348
364349 var queryStr = _this . __getQueryStr ( newQueryObj ) ;
365350
@@ -369,7 +354,7 @@ var queryToPropsHOC = function queryToPropsHOC(DecoratedComponent, config) {
369354 } ) ;
370355
371356 _defineProperty ( _assertThisInitialized ( _this ) , "__updateState" , function ( patches , callback ) {
372- var newState = _objectSpread2 ( { } , _this . state , { } , patches ) ;
357+ var newState = _objectSpread ( { } , _this . state , patches ) ;
373358
374359 var validatedState = validateObject ( newState , defaultState , validatorMap ) ;
375360
@@ -379,7 +364,7 @@ var queryToPropsHOC = function queryToPropsHOC(DecoratedComponent, config) {
379364 var prevValidatedQueryObj = _this . __getValidatedQueryObj ( ) ;
380365
381366 if ( ! deepEqual ( prevValidatedQueryObj , validatedState ) ) {
382- _this . setState ( _objectSpread2 ( { } , validatedState ) , function ( ) {
367+ _this . setState ( _objectSpread ( { } , validatedState ) , function ( ) {
383368 callback && callback ( validatedState ) ;
384369 } ) ;
385370 }
@@ -390,7 +375,7 @@ var queryToPropsHOC = function queryToPropsHOC(DecoratedComponent, config) {
390375
391376 var validatedQueryObj = _this . __getValidatedQueryObj ( currLocation ) ;
392377
393- _this . setState ( _objectSpread2 ( { } , _this . state , { } , validatedQueryObj ) ) ;
378+ _this . setState ( _objectSpread ( { } , _this . state , validatedQueryObj ) ) ;
394379
395380 if ( ! _this . __firstCallHandleRouteChanged && mapDefaultQueryPropsToUrlWhenMounted ) {
396381 _this . __updateUrl ( validatedQueryObj ) ;
@@ -404,7 +389,7 @@ var queryToPropsHOC = function queryToPropsHOC(DecoratedComponent, config) {
404389
405390 var _validatedQueryObj = _this . __getValidatedQueryObj ( props . location ) ;
406391
407- _this . state = _objectSpread2 ( { } , defaultState , { } , _validatedQueryObj ) ;
392+ _this . state = _objectSpread ( { } , defaultState , _validatedQueryObj ) ;
408393 return _this ;
409394 }
410395
0 commit comments