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
18
18
const MAX_SAFE_INTEGER_LIMIT = Math . pow ( 2 , 53 ) ;
19
19
20
20
// 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 ) {
23
23
return { } ;
24
24
}
25
25
if ( typeof Object . assign === 'function' ) {
26
- return Object . assign ( ...sources ) ;
26
+ return Object . assign ( target , ...sources ) ;
27
27
} 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 ++ ) {
30
30
const nextSource = sources [ index ] ;
31
31
if ( nextSource !== null && nextSource !== undefined ) {
32
32
for ( const nextKey in nextSource ) {
You can’t perform that action at this time.
0 commit comments