11import assert from 'assert' ;
22
3- import _ from 'lodash' ;
3+ import isNil from 'lodash/isNil' ;
4+ import capitalize from 'lodash/capitalize' ;
5+ import isObject from 'lodash/isObject' ;
46import { HTTP_STATUS , HEADERS , API_MESSAGE } from '@verdaccio/commons-api' ;
57
68import smartRequest , { RequestPromise } from './request' ;
@@ -50,7 +52,7 @@ export interface ServerBridge {
5052const TOKEN_BASIC = 'Basic' ;
5153
5254function buildToken ( type : string , token : string ) : string {
53- return `${ _ . capitalize ( type ) } ${ token } ` ;
55+ return `${ capitalize ( type ) } ${ token } ` ;
5456}
5557
5658const buildAuthHeader = ( user , pass ) : string => {
@@ -81,7 +83,7 @@ export default class Server implements ServerBridge {
8183 method : options . method || 'GET' ,
8284 headers : headers ,
8385 encoding : options . encoding ,
84- json : _ . isNil ( options . json ) === false ? options . json : true ,
86+ json : isNil ( options . json ) === false ? options . json : true ,
8587 } ) ;
8688 }
8789
@@ -118,7 +120,7 @@ export default class Server implements ServerBridge {
118120 }
119121
120122 public putPackage ( name : string , data ) {
121- if ( _ . isObject ( data ) && ! Buffer . isBuffer ( data ) ) {
123+ if ( isObject ( data ) && ! Buffer . isBuffer ( data ) ) {
122124 data = JSON . stringify ( data ) ;
123125 }
124126
@@ -132,7 +134,7 @@ export default class Server implements ServerBridge {
132134 }
133135
134136 public putVersion ( name : string , version : string , data : any ) {
135- if ( _ . isObject ( data ) && ! Buffer . isBuffer ( data ) ) {
137+ if ( isObject ( data ) && ! Buffer . isBuffer ( data ) ) {
136138 data = JSON . stringify ( data ) ;
137139 }
138140
0 commit comments