@@ -160,22 +160,22 @@ describe("custom transformation decorator", () => {
160
160
} ) ;
161
161
162
162
let model : any ;
163
- it ( ' should serialize json into model instance of class Person' , ( ) => {
163
+ it ( " should serialize json into model instance of class Person" , ( ) => {
164
164
expect ( ( ) => {
165
165
const json = {
166
- name : ' John Doe' ,
166
+ name : " John Doe" ,
167
167
address : {
168
- street : ' Main Street 25' ,
169
- tel : ' 5454-534-645' ,
168
+ street : " Main Street 25" ,
169
+ tel : " 5454-534-645" ,
170
170
zip : 10353 ,
171
- country : ' West Samoa'
171
+ country : " West Samoa"
172
172
} ,
173
173
age : 25 ,
174
174
hobbies : [
175
- { type : ' sport' , name : ' sailing' } ,
176
- { type : ' relax' , name : ' reading' } ,
177
- { type : ' sport' , name : ' jogging' } ,
178
- { type : ' relax' , name : ' movies' }
175
+ { type : " sport" , name : " sailing" } ,
176
+ { type : " relax" , name : " reading" } ,
177
+ { type : " sport" , name : " jogging" } ,
178
+ { type : " relax" , name : " movies" }
179
179
]
180
180
} ;
181
181
class Hobby {
@@ -185,7 +185,7 @@ describe("custom transformation decorator", () => {
185
185
class Address {
186
186
public street : string ;
187
187
188
- @Expose ( { name : ' tel' } )
188
+ @Expose ( { name : " tel" } )
189
189
public telephone : string ;
190
190
191
191
public zip : number ;
@@ -199,19 +199,19 @@ describe("custom transformation decorator", () => {
199
199
public address : Address ;
200
200
201
201
@Type ( ( ) => Hobby )
202
- @Transform ( value => value . filter ( ( hobby : any ) => hobby . type === ' sport' ) , { toClassOnly : true } )
202
+ @Transform ( value => value . filter ( ( hobby : any ) => hobby . type === " sport" ) , { toClassOnly : true } )
203
203
public hobbies : Hobby [ ] ;
204
204
205
205
public age : number ;
206
206
}
207
207
model = plainToClass ( Person , json ) ;
208
208
expect ( model instanceof Person ) ;
209
209
expect ( model . address instanceof Address ) ;
210
- model . hobbies . forEach ( ( hobby : Hobby ) => expect ( hobby instanceof Hobby && hobby . type === ' sport' ) ) ;
210
+ model . hobbies . forEach ( ( hobby : Hobby ) => expect ( hobby instanceof Hobby && hobby . type === " sport" ) ) ;
211
211
} ) . to . not . throw ( ) ;
212
212
} ) ;
213
213
214
- it ( ' should serialize a model into json' , ( ) => {
214
+ it ( " should serialize a model into json" , ( ) => {
215
215
expect ( ( ) => {
216
216
classToPlain ( model ) ;
217
217
} ) . to . not . throw ( ) ;
0 commit comments