Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it("should set meta on instance", () => {
expect(Metadata.set("metadatakey2", "test2", new Test())).to.equal(undefined);
expect(Metadata.has("metadatakey2", Test)).to.be.true;
});
it("should return false (bad target)", () => {
expect(Metadata.has("testunknow", undefined)).to.equal(false);
});
});
it("should set meta on a class", () => {
expect(Metadata.set("metadatakey1", "test1", Test)).to.equal(undefined);
expect(Metadata.has("metadatakey1", Test)).to.be.true;
});
getConverter(targetType: any): IConverter | undefined {
if (Metadata.has(CONVERTER, targetType)) {
const converter = Metadata.get(CONVERTER, targetType);
if (converter) {
return this.injectorService.get(converter);
}
}
}