File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
packages/optimizely-sdk/lib/utils/fns Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -18,15 +18,15 @@ import { generateUUID as uuid, keyBy as keyByUtil } from '@optimizely/js-sdk-uti
1818const MAX_SAFE_INTEGER_LIMIT = Math . pow ( 2 , 53 ) ;
1919
2020// eslint-disable-next-line
21- export function assign ( ...sources : [ any ] ) : any {
22- if ( sources . length < 1 ) {
21+ export function assign ( target : any , ...sources : any [ ] ) : any {
22+ if ( ! target ) {
2323 return { } ;
2424 }
2525 if ( typeof Object . assign === 'function' ) {
26- return Object . assign ( ...sources ) ;
26+ return Object . assign ( target , ...sources ) ;
2727 } else {
28- const to = Object ( sources [ 0 ] ) ;
29- for ( let index = 1 ; index < sources . length ; index ++ ) {
28+ const to = Object ( target ) ;
29+ for ( let index = 0 ; index < sources . length ; index ++ ) {
3030 const nextSource = sources [ index ] ;
3131 if ( nextSource !== null && nextSource !== undefined ) {
3232 for ( const nextKey in nextSource ) {
You can’t perform that action at this time.
0 commit comments