File tree Expand file tree Collapse file tree 6 files changed +22
-17
lines changed Expand file tree Collapse file tree 6 files changed +22
-17
lines changed Original file line number Diff line number Diff line change 53
53
"@types/express" : " ^4.17.3" ,
54
54
"@types/is-glob" : " ^4.0.1" ,
55
55
"@types/jest" : " ^26.0.22" ,
56
- "@types/lodash" : " ^4.14.168" ,
57
56
"@types/micromatch" : " ^4.0.1" ,
58
57
"@types/node" : " ^14.14.37" ,
59
58
"@types/supertest" : " ^2.0.10" ,
79
78
},
80
79
"dependencies" : {
81
80
"@types/http-proxy" : " ^1.17.5" ,
81
+ "camelcase" : " ^6.2.0" ,
82
82
"http-proxy" : " ^1.18.1" ,
83
83
"is-glob" : " ^4.0.1" ,
84
- "lodash " : " ^4.17.21 " ,
84
+ "is-plain-object " : " ^5.0.0 " ,
85
85
"micromatch" : " ^4.0.2"
86
86
},
87
87
"engines" : {
Original file line number Diff line number Diff line change 1
- import * as _ from 'lodash ' ;
1
+ import { isPlainObject } from 'is-plain-object ' ;
2
2
import * as url from 'url' ;
3
3
import { ERRORS } from './errors' ;
4
4
import { getInstance } from './logger' ;
@@ -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 ) && ( opts == null || Object . keys ( opts ) . length === 0 ) ;
77
+ return isPlainObject ( context ) && ( opts == null || Object . keys ( opts ) . length === 0 ) ;
78
78
}
79
79
80
80
function configureLogger ( options : Options ) {
Original file line number Diff line number Diff line change 1
- import * as _ from 'lodash ' ;
1
+ import * as camelCase from 'camelcase ' ;
2
2
import { getInstance } from './logger' ;
3
3
const logger = getInstance ( ) ;
4
4
@@ -21,7 +21,7 @@ export function getHandlers(options) {
21
21
// all handlers for the http-proxy events are prefixed with 'on'.
22
22
// loop through options and try to find these handlers
23
23
// and add them to the handlers object for subscription in init().
24
- const eventName = _ . camelCase ( 'on ' + event ) ;
24
+ const eventName = camelCase ( 'on ' + event ) ;
25
25
const fnHandler = options ? options [ eventName ] : null ;
26
26
27
27
if ( typeof fnHandler === 'function' ) {
Original file line number Diff line number Diff line change 1
- import * as _ from 'lodash ' ;
1
+ import { isPlainObject } from 'is-plain-object ' ;
2
2
import { ERRORS } from './errors' ;
3
3
import { getInstance } from './logger' ;
4
4
const logger = getInstance ( ) ;
@@ -42,12 +42,12 @@ export function createPathRewriter(rewriteConfig) {
42
42
function isValidRewriteConfig ( rewriteConfig ) {
43
43
if ( typeof rewriteConfig === 'function' ) {
44
44
return true ;
45
- } else if ( _ . isPlainObject ( rewriteConfig ) && Object . keys ( rewriteConfig ) . length !== 0 ) {
45
+ } else if ( isPlainObject ( rewriteConfig ) && Object . keys ( rewriteConfig ) . length !== 0 ) {
46
46
return true ;
47
47
} else if (
48
48
rewriteConfig === undefined ||
49
49
rewriteConfig === null ||
50
- _ . isEqual ( rewriteConfig , { } )
50
+ JSON . stringify ( rewriteConfig ) === '{}'
51
51
) {
52
52
return false ;
53
53
} else {
@@ -58,7 +58,7 @@ function isValidRewriteConfig(rewriteConfig) {
58
58
function parsePathRewriteRules ( rewriteConfig ) {
59
59
const rules = [ ] ;
60
60
61
- if ( _ . isPlainObject ( rewriteConfig ) ) {
61
+ if ( isPlainObject ( rewriteConfig ) ) {
62
62
for ( const [ key ] of Object . entries ( rewriteConfig ) ) {
63
63
rules . push ( {
64
64
regex : new RegExp ( key ) ,
Original file line number Diff line number Diff line change 1
- import * as _ from 'lodash ' ;
1
+ import { isPlainObject } from 'is-plain-object ' ;
2
2
import { getInstance } from './logger' ;
3
3
const logger = getInstance ( ) ;
4
4
5
5
export async function getTarget ( req , config ) {
6
6
let newTarget ;
7
7
const router = config . router ;
8
8
9
- if ( _ . isPlainObject ( router ) ) {
9
+ if ( isPlainObject ( router ) ) {
10
10
newTarget = getTargetFromProxyTable ( req , router ) ;
11
11
} else if ( typeof router === 'function' ) {
12
12
newTarget = await router ( req ) ;
Original file line number Diff line number Diff line change 902
902
resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.5.tgz#dcce4430e64b443ba8945f0290fb564ad5bac6dd"
903
903
integrity sha512-7+2BITlgjgDhH0vvwZU/HZJVyk+2XUlvxXe8dFMedNX/aMkaOq++rMAFXc0tM7ij15QaWlbdQASBR9dihi+bDQ==
904
904
905
- " @types/lodash@^4.14.168 " :
906
- version "4.14.168"
907
- resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.168.tgz#fe24632e79b7ade3f132891afff86caa5e5ce008"
908
- integrity sha512-oVfRvqHV/V6D1yifJbVRU3TMp8OT6o6BG+U9MkwuJ3U8/CsDHvalRpsxBqivn71ztOFZBTfJMvETbqHiaNSj7Q==
909
-
910
905
" @types/micromatch@^4.0.1 " :
911
906
version "4.0.1"
912
907
resolved "https://registry.yarnpkg.com/@types/micromatch/-/micromatch-4.0.1.tgz#9381449dd659fc3823fd2a4190ceacc985083bc7"
@@ -1705,6 +1700,11 @@ camelcase@^6.0.0:
1705
1700
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.0.0.tgz#5259f7c30e35e278f1bdc2a4d91230b37cad981e"
1706
1701
integrity sha512-8KMDF1Vz2gzOq54ONPJS65IvTUaB1cHJ2DMM7MbPmLZljDH1qpzzLsWdiN9pHh6qvkRVDTi/07+eNGch/oLU4w==
1707
1702
1703
+ camelcase@^6.2.0 :
1704
+ version "6.2.0"
1705
+ resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.2.0.tgz#924af881c9d525ac9d87f40d964e5cea982a1809"
1706
+ integrity sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg==
1707
+
1708
1708
capture-exit@^2.0.0 :
1709
1709
version "2.0.0"
1710
1710
resolved "https://registry.yarnpkg.com/capture-exit/-/capture-exit-2.0.0.tgz#fb953bfaebeb781f62898239dabb426d08a509a4"
@@ -3624,6 +3624,11 @@ is-plain-object@^2.0.3, is-plain-object@^2.0.4:
3624
3624
dependencies :
3625
3625
isobject "^3.0.1"
3626
3626
3627
+ is-plain-object@^5.0.0 :
3628
+ version "5.0.0"
3629
+ resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-5.0.0.tgz#4427f50ab3429e9025ea7d52e9043a9ef4159344"
3630
+ integrity sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==
3631
+
3627
3632
is-potential-custom-element-name@^1.0.0 :
3628
3633
version "1.0.0"
3629
3634
resolved "https://registry.yarnpkg.com/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.0.tgz#0c52e54bcca391bb2c494b21e8626d7336c6e397"
You can’t perform that action at this time.
0 commit comments