@fiado/type-kit 2.0.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,7 +11,9 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.Place = void 0;
13
13
  const class_validator_1 = require("class-validator");
14
+ const Timezone_1 = require("./Timezone");
14
15
  const Country_1 = require("../../country/enums/Country");
16
+ const class_transformer_1 = require("class-transformer");
15
17
  class Place {
16
18
  }
17
19
  exports.Place = Place;
@@ -96,7 +98,8 @@ __decorate([
96
98
  __decorate([
97
99
  (0, class_validator_1.IsOptional)(),
98
100
  (0, class_validator_1.ValidateNested)(),
99
- __metadata("design:type", Object)
101
+ (0, class_transformer_1.Type)(() => Timezone_1.Timezone),
102
+ __metadata("design:type", Timezone_1.Timezone)
100
103
  ], Place.prototype, "timezone", void 0);
101
104
  __decorate([
102
105
  (0, class_validator_1.IsOptional)(),
@@ -1,4 +1,4 @@
1
- export type Timezone = {
1
+ export declare class Timezone {
2
2
  name: string;
3
3
  offset: string;
4
- };
4
+ }
@@ -1,2 +1,24 @@
1
1
  "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
2
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.Timezone = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ class Timezone {
15
+ }
16
+ exports.Timezone = Timezone;
17
+ __decorate([
18
+ (0, class_validator_1.IsString)(),
19
+ __metadata("design:type", String)
20
+ ], Timezone.prototype, "name", void 0);
21
+ __decorate([
22
+ (0, class_validator_1.IsString)(),
23
+ __metadata("design:type", String)
24
+ ], Timezone.prototype, "offset", void 0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/type-kit",
3
- "version": "2.0.00",
3
+ "version": "2.0.1",
4
4
  "description": "",
5
5
  "main": "bin/index.js",
6
6
  "types": "bin/index.d.ts",
@@ -2,6 +2,7 @@ import { IsArray, IsBoolean, IsEnum, IsOptional, IsString, Length, ValidateNeste
2
2
  import { Geometry } from "./Geometry";
3
3
  import { Timezone } from "./Timezone";
4
4
  import { Country } from '../../country/enums/Country';
5
+ import { Type } from 'class-transformer';
5
6
 
6
7
  export class Place {
7
8
  @ValidateNested()
@@ -70,6 +71,7 @@ export class Place {
70
71
 
71
72
  @IsOptional()
72
73
  @ValidateNested()
74
+ @Type(() => Timezone)
73
75
  timezone?: Timezone;
74
76
 
75
77
  @IsOptional()
@@ -1,6 +1,10 @@
1
1
 
2
+ import { IsString } from 'class-validator';
2
3
 
3
- export type Timezone = {
4
- name: string;
5
- offset: string;
4
+ export class Timezone {
5
+ @IsString()
6
+ name: string;
7
+
8
+ @IsString()
9
+ offset: string;
6
10
  }