Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
static get(target: Type, method: string | symbol): EndpointMetadata {
if (!this.has(target, method)) {
const endpoint = new EndpointMetadata(target, method);
this.getOwnEndpoints(target).push(endpoint);
Metadata.set("endpoints", endpoint, target, method);
}
return Metadata.getOwn("endpoints", target, method);
}
static getOwnEndpoints(target: Type) {
if (!this.hasEndpoints(target)) {
Metadata.set("endpoints", [], target);
}
return Metadata.getOwn("endpoints", target);
}
static getMetadata(target: any) {
return Metadata.getOwn(SERVER_SETTINGS, target);
}