1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.Unique = void 0;
|
4 | const attribute_service_1 = require("../attribute-service");
|
5 | function Unique(...args) {
|
6 | if (args.length === 1) {
|
7 | const [options] = args;
|
8 | return (_target, _propertyName) => {
|
9 | annotate(_target, _propertyName, options);
|
10 | };
|
11 | }
|
12 | const [target, propertyName] = args;
|
13 | annotate(target, propertyName);
|
14 | }
|
15 | exports.Unique = Unique;
|
16 | function annotate(target, propertyName, option = true) {
|
17 | (0, attribute_service_1.addAttributeOptions)(target, propertyName, {
|
18 | unique: option,
|
19 | });
|
20 | }
|
21 |
|
\ | No newline at end of file |