How to use the @tsed/core.setValue function in @tsed/core

To help you get started, we’ve selected a few @tsed/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github TypedProject / ts-express-decorators / test / units / core / utils / setValue.spec.ts View on Github external
before(() => {
      map = new Map();
      setValue("test.t1", "value2", map);
    });
github TypedProject / ts-express-decorators / test / units / core / utils / setValue.spec.ts View on Github external
before(() => {
      map = new Map();

      setValue("test", "value", map);
    });
github TypedProject / ts-express-decorators / packages / di / src / services / DIConfiguration.ts View on Github external
setRaw(propertyKey: string, value: any) {
    setValue(propertyKey, value, this.map);

    return this;
  }
github TypedProject / ts-express-decorators / packages / common / src / di / services / SettingsService.ts View on Github external
set(propertyKey: string | IBootstrapSettings, value?: any): this {
    if (typeof propertyKey === "string") {
      setValue(propertyKey, value, this._map);
    } else {
      const self: any = this;

      Object.keys(propertyKey).forEach(key => {
        const descriptor = Object.getOwnPropertyDescriptor(SettingsService.prototype, key);

        if (descriptor && ["set", "get", "providers"].indexOf(key) === -1) {
          self[key] = propertyKey[key];
        } else {
          this._map.set(key, propertyKey[key]);
        }
      });

      this._map.forEach((value, key) => {
        this.set(key, this.resolve(value));
      });
github TypedProject / ts-express-decorators / packages / common / src / config / services / ServerSettingsService.ts View on Github external
set(propertyKey: string | IServerSettings, value?: any): this {
    if (typeof propertyKey === "string") {
      setValue(propertyKey, value, this.map);
    } else {
      const self: any = this;

      Object.keys(propertyKey).forEach(key => {
        const descriptor = Object.getOwnPropertyDescriptor(ServerSettingsService.prototype, key);

        if (descriptor && ["set", "map"].indexOf(key) === -1) {
          self[key] = propertyKey[key];
        } else {
          this.set(key, propertyKey[key]);
        }
      });

      this.forEach((value, key) => {
        this.map.set(key, this.resolve(value));
      });