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