src/util/config.js
/**
   * get config json
   * config will be load when called
   * @returns {JSON} config json
   */
get config json
config will be load when called
@returns {JSON} config json
get config json config will be load when called @returns { JSON } config json
json() {
    let cache = this.scope.json;
    let json = {};
    if (cache && cache[this.path]) return cache[this.path];
    cache[this.path] = json;
    function normalize(conf) {
      Object.keys(conf).forEach(key => {
        if (typeof conf[key] === "object") {
          if (conf[key].isConfig) {
            conf[key] =  conf[key].json();
          } else {
            conf[key] = normalize(conf[key]);
          }
        }
      });
      return conf;
    }
    Object.assign(json, normalize(this.conf));
    return json;
  }
json ( ) { let cache = this . scope . json ; let json = { } ; if ( cache && cache [ this . path ] ) return cache [ this . path ] ; cache [ this . path ] = json ; function normalize ( conf ) { Object . keys ( conf ) . forEach ( key => { if ( typeof conf [ key ] === "object" ) { if ( conf [ key ] . isConfig ) { conf [ key ] = conf [ key ] . json ( ) ; } else { conf [ key ] = normalize ( conf [ key ] ) ; } } } ) ; return conf ; } Object . assign ( json , normalize ( this . conf ) ) ; return json ; }
get config json
 config will be load when called
 @returns {JSON} config json
get config json config will be load when called @returns { JSON } config json