UNPKG

1.36 kBJavaScriptView Raw
1"use strict";
2var __assign = (this && this.__assign) || function () {
3 __assign = Object.assign || function(t) {
4 for (var s, i = 1, n = arguments.length; i < n; i++) {
5 s = arguments[i];
6 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7 t[p] = s[p];
8 }
9 return t;
10 };
11 return __assign.apply(this, arguments);
12};
13Object.defineProperty(exports, "__esModule", { value: true });
14exports.FloatField = void 0;
15var type_graphql_1 = require("type-graphql");
16var utils_1 = require("../utils");
17var getCombinedDecorator_1 = require("./getCombinedDecorator");
18function FloatField(options) {
19 var _a;
20 if (options === void 0) { options = {}; }
21 var nullableOption = options.nullable === true ? { nullable: true } : {};
22 var defaultOption = options.default ? { default: options.default } : {};
23 var factories = getCombinedDecorator_1.getCombinedDecorator({
24 fieldType: 'float',
25 warthogColumnMeta: options,
26 gqlFieldType: type_graphql_1.Float,
27 dbType: (_a = options.dataType) !== null && _a !== void 0 ? _a : 'float8',
28 dbColumnOptions: __assign(__assign({}, nullableOption), defaultOption)
29 });
30 return utils_1.composeMethodDecorators.apply(void 0, factories);
31}
32exports.FloatField = FloatField;
33//# sourceMappingURL=FloatField.js.map
\No newline at end of file