@@ -16,7 +16,7 @@ export function createConfig(context, opts?) {
16
16
// app.use('/api', proxy({target:'http://localhost:9000'}));
17
17
if ( isContextless ( context , opts ) ) {
18
18
config . context = '/' ;
19
- config . options = _ . assign ( config . options , context ) ;
19
+ config . options = Object . assign ( config . options , context ) ;
20
20
21
21
// app.use('/api', proxy('http://localhost:9000'));
22
22
// app.use(proxy('http://localhost:9000/api'));
@@ -25,15 +25,15 @@ export function createConfig(context, opts?) {
25
25
const target = [ oUrl . protocol , '//' , oUrl . host ] . join ( '' ) ;
26
26
27
27
config . context = oUrl . pathname || '/' ;
28
- config . options = _ . assign ( config . options , { target } , opts ) ;
28
+ config . options = Object . assign ( config . options , { target } , opts ) ;
29
29
30
30
if ( oUrl . protocol === 'ws:' || oUrl . protocol === 'wss:' ) {
31
31
config . options . ws = true ;
32
32
}
33
33
// app.use('/api', proxy({target:'http://localhost:9000'}));
34
34
} else {
35
35
config . context = context ;
36
- config . options = _ . assign ( config . options , opts ) ;
36
+ config . options = Object . assign ( config . options , opts ) ;
37
37
}
38
38
39
39
configureLogger ( config . options ) ;
@@ -57,7 +57,7 @@ export function createConfig(context, opts?) {
57
57
* @return {Boolean } [description]
58
58
*/
59
59
function isStringShortHand ( context : Filter ) {
60
- if ( _ . isString ( context ) ) {
60
+ if ( typeof context === 'string' ) {
61
61
return ! ! url . parse ( context ) . host ;
62
62
}
63
63
}
@@ -74,7 +74,7 @@ function isStringShortHand(context: Filter) {
74
74
* @return {Boolean } [description]
75
75
*/
76
76
function isContextless ( context : Filter , opts : Options ) {
77
- return _ . isPlainObject ( context ) && _ . isEmpty ( opts ) ;
77
+ return _ . isPlainObject ( context ) && ( opts == null || Object . keys ( opts ) . length === 0 ) ;
78
78
}
79
79
80
80
function configureLogger ( options : Options ) {
0 commit comments