Advertisement
tymonr

validation-js-config-example.js

Feb 12th, 2020
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Worker {
  2.     /**
  3.      * @constructor
  4.     */
  5.   constructor() { Worker._metacodeValidate(); }
  6.  
  7.     /**
  8.      * Checks all related configs
  9.      * #validator
  10.      *
  11.      * @private
  12.     */
  13.   static _metacodeValidate() {
  14.         if(Worker._metacodeValidated){
  15.             return;
  16.         }
  17.         assert.ok(configs.engineSettings, `Worker: engine_settings.json wasn't loaded`)
  18.         assert.ok(configs.dbConnection, `Worker: db_connection.json wasn't loaded`)
  19.  
  20.         Worker._metacodeValidated = true;
  21.     }
  22.     /**
  23.      * @private
  24.      * @static
  25.     */
  26.     static _metacodeValidated = false;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement