build/bundle.js
/**
   *
   *
   * @param {Object} jsonContent - file content
   * @returns{Object} isValid - returns true and JSON content for valid files
   * and false for invalid files
   * @memberOf InvertedIndex
   */
@param {Object} jsonContent - file content
@returns{Object} isValid - returns true and JSON content for valid files
and false for invalid files
@memberOf InvertedIndex
@param { Object } jsonContent - file content @returns { Object } isValid - returns true and JSON content for valid files and false for invalid files @memberOf InvertedIndex
static validateFile(jsonContent) {
    let isValid = { status: false };
    const invalidStructureError = {
      name: 'validate file structure',
      message: 'File structure is invalid'
    };
    if (Object.keys(jsonContent).length === 0 &&
       typeof jsonContent === 'object') {
      return isValid;
    }
    try {
      jsonContent.forEach((doc) => {
        if (!doc.title || !doc.text) {
          throw invalidStructureError;
        } else {
          isValid = {
            status: true,
            jsonContent
          };
          return isValid;
        }
      });
    } catch (error) {
      if (error.name === 'validate file structure') return isValid;
      throw error;
    }
    return isValid;
  }
static validateFile ( jsonContent ) { let isValid = { status : false } ; const invalidStructureError = { name : 'validate file structure' , message : 'File structure is invalid' } ; if ( Object . keys ( jsonContent ) . length === 0 && typeof jsonContent === 'object' ) { return isValid ; } try { jsonContent . forEach ( ( doc ) => { if ( ! doc . title || ! doc . text ) { throw invalidStructureError ; } else { isValid = { status : true , jsonContent } ; return isValid ; } } ) ; } catch ( error ) { if ( error . name === 'validate file structure' ) return isValid ; throw error ; } return isValid ; }
@param {Object} jsonContent - file content
 @returns{Object} isValid - returns true and JSON content for valid files
 and false for invalid files
 @memberOf InvertedIndex
@param { Object } jsonContent - file content @returns { Object } isValid - returns true and JSON content for valid files and false for invalid files @memberOf InvertedIndex