@@ -16,7 +16,7 @@ export function createConfig(context, opts?) {
1616 // app.use('/api', proxy({target:'http://localhost:9000'}));
1717 if ( isContextless ( context , opts ) ) {
1818 config . context = '/' ;
19- config . options = _ . assign ( config . options , context ) ;
19+ config . options = Object . assign ( config . options , context ) ;
2020
2121 // app.use('/api', proxy('http://localhost:9000'));
2222 // app.use(proxy('http://localhost:9000/api'));
@@ -25,15 +25,15 @@ export function createConfig(context, opts?) {
2525 const target = [ oUrl . protocol , '//' , oUrl . host ] . join ( '' ) ;
2626
2727 config . context = oUrl . pathname || '/' ;
28- config . options = _ . assign ( config . options , { target } , opts ) ;
28+ config . options = Object . assign ( config . options , { target } , opts ) ;
2929
3030 if ( oUrl . protocol === 'ws:' || oUrl . protocol === 'wss:' ) {
3131 config . options . ws = true ;
3232 }
3333 // app.use('/api', proxy({target:'http://localhost:9000'}));
3434 } else {
3535 config . context = context ;
36- config . options = _ . assign ( config . options , opts ) ;
36+ config . options = Object . assign ( config . options , opts ) ;
3737 }
3838
3939 configureLogger ( config . options ) ;
@@ -57,7 +57,7 @@ export function createConfig(context, opts?) {
5757 * @return {Boolean } [description]
5858 */
5959function isStringShortHand ( context : Filter ) {
60- if ( _ . isString ( context ) ) {
60+ if ( typeof context === 'string' ) {
6161 return ! ! url . parse ( context ) . host ;
6262 }
6363}
@@ -74,7 +74,7 @@ function isStringShortHand(context: Filter) {
7474 * @return {Boolean } [description]
7575 */
7676function isContextless ( context : Filter , opts : Options ) {
77- return _ . isPlainObject ( context ) && _ . isEmpty ( opts ) ;
77+ return _ . isPlainObject ( context ) && ( opts == null || Object . keys ( opts ) . length === 0 ) ;
7878}
7979
8080function configureLogger ( options : Options ) {
0 commit comments