@@ -325,11 +325,9 @@ class VaultClient {
325325 Version : '2010-05-08' ,
326326 } ;
327327
328- if ( accountName ) {
329- assert ( ! this . parameterValidation || typeof accountName === 'string' ,
330- 'the account name, if set, should be a string' ) ;
331- data . AccountName = accountName ;
332- }
328+ assert ( ! this . parameterValidation || typeof accountName === 'string' ,
329+ 'the account name should be a string' ) ;
330+ data . AccountName = accountName ;
333331 this . request ( 'POST' , '/' , true , callback , data ) ;
334332 }
335333
@@ -473,16 +471,15 @@ class VaultClient {
473471 if ( key === undefined ) {
474472 assert ( false , 'key needs to be specified' ) ;
475473 }
476- assert ( ( accountArn , typeof accountArn === 'string'
477- || 'arn should be a string' ) ) ;
478- assert ( ( accountName , typeof accountName === 'string'
479- || 'name should be a string' ) ) ;
480- assert ( ( accountId , typeof accountId === 'string'
481- || 'id should be a string' ) ) ;
482- assert ( ( canonicalId , typeof canonicalId === 'string'
483- || 'canonicalId should be a string' ) ) ;
484- assert ( ( key , typeof key === 'string'
485- || 'key should be a string' ) ) ;
474+ assert ( accountArn === undefined || typeof accountArn === 'string' ,
475+ 'arn should be a string' ) ;
476+ assert ( accountName === undefined || typeof accountName === 'string' ,
477+ 'name should be a string' ) ;
478+ assert ( accountId === undefined || typeof accountId === 'string' ,
479+ 'id should be a string' ) ;
480+ assert ( canonicalId === undefined || typeof canonicalId === 'string' ,
481+ 'canonicalId should be a string' ) ;
482+ assert ( typeof key === 'string' , 'key should be a string' ) ;
486483 const data = {
487484 Action : 'AddAccountAttribute' ,
488485 Version : '2010-05-08' ,
@@ -501,8 +498,7 @@ class VaultClient {
501498 data . canonicalId = canonicalId ;
502499 }
503500 if ( value ) {
504- assert ( ( value , typeof value === 'string'
505- || 'value should be a string' ) ) ;
501+ assert ( typeof value === 'string' , 'value should be a string' ) ;
506502 data . value = value ;
507503 }
508504 this . request ( 'POST' , '/' , true , callback , data ) ;
@@ -538,16 +534,15 @@ class VaultClient {
538534 if ( key === undefined ) {
539535 assert ( false , 'key needs to be specified' ) ;
540536 }
541- assert ( ( accountArn , typeof accountArn === 'string'
542- || 'arn should be a string' ) ) ;
543- assert ( ( accountName , typeof accountName === 'string'
544- || 'name should be a string' ) ) ;
545- assert ( ( accountId , typeof accountId === 'string'
546- || 'id should be a string' ) ) ;
547- assert ( ( canonicalId , typeof canonicalId === 'string'
548- || 'canonicalId should be a string' ) ) ;
549- assert ( ( key , typeof key === 'string'
550- || 'key should be a string' ) ) ;
537+ assert ( accountArn === undefined || typeof accountArn === 'string' ,
538+ 'arn should be a string' ) ;
539+ assert ( accountName === undefined || typeof accountName === 'string' ,
540+ 'name should be a string' ) ;
541+ assert ( accountId === undefined || typeof accountId === 'string' ,
542+ 'id should be a string' ) ;
543+ assert ( canonicalId === undefined || typeof canonicalId === 'string' ,
544+ 'canonicalId should be a string' ) ;
545+ assert ( typeof key === 'string' , 'key should be a string' ) ;
551546 const data = {
552547 Action : 'DeleteAccountAttribute' ,
553548 Version : '2010-05-08' ,
0 commit comments