function isSyntaxCorrect(args){

    args = args.slice(2);
    // If no arguments
    if(args.length == 0){
        return 1;
    }

    // args = [json_filename]
    filename = args[0].toLowerCase() + ".json";

    // Load JSON file
    try{

        let novel_metadata = require('./novels/' + filename);
        
        // Check if JSON file is in correct format
        if(!novel_metadata.novel_name && !novel.novel_link){
            return 16;
        }

        return novel_metadata;
        
    }catch(err){

        errDict.customError(err);
        return 2;
    }
}
/**
 * This checks for proper syntax in the command line on run.
 * 
 * @param {Array} args This is the list of sys.args from running the program
 * 
 * @returns exit code of novel metadata or non-zero exit code
 */
This checks for proper syntax in the command line on run.

@param {Array} args This is the list of sys.args from running the program

@returns exit code of novel metadata or non-zero exit code
This checks for proper syntax in the command line on run . @param { Array } args This is the list of sys . args from running the program @returns exit code of novel metadata or non - zero exit code
function isSyntaxCorrect(args){
    args = args.slice(2);
    if(args.length == 0){
        return 1;
    }
    filename = args[0].toLowerCase() + ".json";
    try{
        let novel_metadata = require('./novels/' + filename);
        if(!novel_metadata.novel_name && !novel.novel_link){
            return 16;
        }
        return novel_metadata;
    }catch(err){
        errDict.customError(err);
        return 2;
    }
}
function isSyntaxCorrect ( args ) { args = args . slice ( 2 ) ; if ( args . length == 0 ) { return 1 ; } filename = args [ 0 ] . toLowerCase ( ) + ".json" ; try { let novel_metadata = require ( './novels/' + filename ) ; if ( ! novel_metadata . novel_name && ! novel . novel_link ) { return 16 ; } return novel_metadata ; } catch ( err ) { errDict . customError ( err ) ; return 2 ; } }
This checks for proper syntax in the command line on run.
This checks for proper syntax in the command line on run .
// If no arguments // args = [json_filename] // Load JSON file // Check if JSON file is in correct format