UNPKG

@nestjs/common

Version:

Nest - modern, fast, powerful node.js web framework (@common)

17 lines (16 loc) 452 B
import { VERSION_METADATA } from '../../constants.js'; /** * Sets the version of the endpoint to the passed version * * @publicApi */ export function Version(version) { if (Array.isArray(version)) { // Drop duplicated versions version = Array.from(new Set(version)); } return (target, key, descriptor) => { Reflect.defineMetadata(VERSION_METADATA, version, descriptor.value); return descriptor; }; }