File tree Expand file tree Collapse file tree 1 file changed +5
-11
lines changed Expand file tree Collapse file tree 1 file changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -219,21 +219,15 @@ function encode(buffer, encoding) {
219
219
}
220
220
221
221
function getFormat ( format ) {
222
- let f ;
223
222
if ( format ) {
224
223
if ( format === 'compressed' )
225
- f = POINT_CONVERSION_COMPRESSED ;
226
- else if ( format === 'hybrid' )
227
- f = POINT_CONVERSION_HYBRID ;
228
- // Default
229
- else if ( format === 'uncompressed' )
230
- f = POINT_CONVERSION_UNCOMPRESSED ;
231
- else
224
+ return POINT_CONVERSION_COMPRESSED ;
225
+ if ( format === 'hybrid' )
226
+ return POINT_CONVERSION_HYBRID ;
227
+ if ( format !== 'uncompressed' )
232
228
throw new ERR_CRYPTO_ECDH_INVALID_FORMAT ( format ) ;
233
- } else {
234
- f = POINT_CONVERSION_UNCOMPRESSED ;
235
229
}
236
- return f ;
230
+ return POINT_CONVERSION_UNCOMPRESSED ;
237
231
}
238
232
239
233
module . exports = {
You can’t perform that action at this time.
0 commit comments