Skip to content

Commit f830ae6

Browse files
author
Umed Khudoiberdiev
committed
fixed issue with null dates
1 parent 8b6ee87 commit f830ae6

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "class-transformer",
3-
"version": "0.1.2",
3+
"version": "0.1.3",
44
"description": "Proper decorator-based transformation / serialization / deserialization of plain javascript objects to class constructors",
55
"license": "MIT",
66
"readmeFilename": "README.md",

src/TransformOperationExecutor.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ export class TransformOperationExecutor {
6666
if (value instanceof Date) {
6767
return new Date(value.valueOf());
6868
}
69+
if (value === null || value === undefined)
70+
return value;
71+
6972
return new Date(value);
7073

7174
} else if (value instanceof Object) {

0 commit comments

Comments
 (0)