How to use the @tsed/core.Metadata.has 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 / class / Metadata.spec.ts View on Github external
it("should set meta on instance", () => {
      expect(Metadata.set("metadatakey2", "test2", new Test())).to.equal(undefined);
      expect(Metadata.has("metadatakey2", Test)).to.be.true;
    });
github TypedProject / ts-express-decorators / test / units / core / class / Metadata.spec.ts View on Github external
it("should return false (bad target)", () => {
      expect(Metadata.has("testunknow", undefined)).to.equal(false);
    });
  });
github TypedProject / ts-express-decorators / test / units / core / class / Metadata.spec.ts View on Github external
it("should set meta on a class", () => {
      expect(Metadata.set("metadatakey1", "test1", Test)).to.equal(undefined);
      expect(Metadata.has("metadatakey1", Test)).to.be.true;
    });
github TypedProject / ts-express-decorators / packages / common / src / converters / services / ConverterService.ts View on Github external
getConverter(targetType: any): IConverter | undefined {
    if (Metadata.has(CONVERTER, targetType)) {
      const converter = Metadata.get(CONVERTER, targetType);

      if (converter) {
        return this.injectorService.get(converter);
      }
    }
  }