diff options
Diffstat (limited to '')
| -rw-r--r-- | lang/js/src/Signature.js | 23 | 
1 files changed, 13 insertions, 10 deletions
| diff --git a/lang/js/src/Signature.js b/lang/js/src/Signature.js index 65365772..a6539048 100644 --- a/lang/js/src/Signature.js +++ b/lang/js/src/Signature.js @@ -30,25 +30,27 @@ import { gpgme_error } from './Errors';   * {@link expNote}.   * @returns {GPGME_Signature|GPGME_Error} Signature Object   */ -export function createSignature(sigObject){ +export function createSignature (sigObject){      if ( -        typeof(sigObject) !=='object' || +        typeof (sigObject) !=='object' ||          !sigObject.hasOwnProperty('summary') ||          !sigObject.hasOwnProperty('fingerprint') ||          !sigObject.hasOwnProperty('timestamp') -        //TODO check if timestamp is mandatory in specification +        // TODO check if timestamp is mandatory in specification      ){          return gpgme_error('SIG_WRONG');      }      let keys = Object.keys(sigObject);      for (let i=0; i< keys.length; i++){ -        if ( typeof(sigObject[keys[i]]) !== expKeys[keys[i]] ){ +        // eslint-disable-next-line no-use-before-define +        if ( typeof (sigObject[keys[i]]) !== expKeys[keys[i]] ){              return gpgme_error('SIG_WRONG');          }      }      let sumkeys = Object.keys(sigObject.summary);      for (let i=0; i< sumkeys.length; i++){ -        if ( typeof(sigObject.summary[sumkeys[i]]) !== expSum[sumkeys[i]] ){ +        // eslint-disable-next-line no-use-before-define +        if ( typeof (sigObject.summary[sumkeys[i]]) !== expSum[sumkeys[i]] ){              return gpgme_error('SIG_WRONG');          }      } @@ -60,7 +62,8 @@ export function createSignature(sigObject){              let notation = sigObject.notations[i];              let notekeys = Object.keys(notation);              for (let j=0; j < notekeys.length; j++){ -                if ( typeof(notation[notekeys[j]]) !== expNote[notekeys[j]] ){ +                // eslint-disable-next-line no-use-before-define +                if ( typeof (notation[notekeys[j]]) !== expNote[notekeys[j]] ){                      return gpgme_error('SIG_WRONG');                  }              } @@ -81,10 +84,10 @@ export function createSignature(sigObject){   */  class GPGME_Signature { -    constructor(sigObject){ +    constructor (sigObject){          this._rawSigObject = sigObject;      } -    get fingerprint(){ +    get fingerprint (){          if (!this._rawSigObject.fingerprint){              return gpgme_error('SIG_WRONG');          } else { @@ -97,7 +100,7 @@ class GPGME_Signature {       * signature does not expire       * @returns {Date | null}       */ -    get expiration(){ +    get expiration (){          if (!this._rawSigObject.exp_timestamp){              return null;          } @@ -130,7 +133,7 @@ class GPGME_Signature {       * for details on the values.       * @returns {Object} Object with boolean properties       */ -    get errorDetails(){ +    get errorDetails (){          let properties = ['revoked', 'key-expired', 'sig-expired',              'key-missing', 'crl-missing', 'crl-too-old', 'bad-policy',              'sys-error']; | 
