Sha256: 33e595b547bcf1ab85be6b77419858697c136ca8f3e61e173931ff03cf6cea2f

Contents?: true

Size: 868 Bytes

Versions: 3

Compression:

Stored size: 868 Bytes

Contents

class Configurator {
  constructor() {
    this.localeVar = "en";
    this.protocolWithHostVar = null;
    this.scopeVar = null;
  }

  get locale() {
    return this.localeVar;
  }

  set locale(val) {
    this.localeVar = val;
    return this.localeVar;
  }

  get protocolWithHost() {
    return this.protocolWithHostVar;
  }

  set protocolWithHost(val) {
    if (!val) {
      this.protocolWithHostVar = null;
      return this.protocolWithHostVar;
    }
    if (val[val.length - 1] === "/") {
      this.protocolWithHostVar = val.slice(0, val.length - 1);
      return this.protocolWithHostVar;
    }
    this.protocolWithHostVar = val;
    return this.protocolWithHostVar;
  }

  get scope() {
    return this.scopeVar;
  }

  set scope(val) {
    this.scopeVar = val;
    return this.scopeVar;
  }
}

const Config = new Configurator();

export default Config;

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
loco-rails-3.0.3 test/dummy/node_modules/loco-js-model/src/config.js
loco-rails-3.0.2 test/dummy/node_modules/loco-js-model/src/config.js
loco-rails-3.0.1 test/dummy/node_modules/loco-js-model/src/config.js