Last change
on this file since 188ee53 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
268 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | /*
|
---|
| 2 | MIT License http://www.opensource.org/licenses/mit-license.php
|
---|
| 3 | */
|
---|
| 4 |
|
---|
| 5 | "use strict";
|
---|
| 6 |
|
---|
| 7 | class DateObjectSerializer {
|
---|
| 8 | serialize(obj, { write }) {
|
---|
| 9 | write(obj.getTime());
|
---|
| 10 | }
|
---|
| 11 | deserialize({ read }) {
|
---|
| 12 | return new Date(read());
|
---|
| 13 | }
|
---|
| 14 | }
|
---|
| 15 |
|
---|
| 16 | module.exports = DateObjectSerializer;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.