aboutsummaryrefslogtreecommitdiff
path: root/src/new_fields/URLField.ts
diff options
context:
space:
mode:
authorTyler Schicke <tyler_schicke@brown.edu>2019-04-20 19:06:28 -0400
committerTyler Schicke <tyler_schicke@brown.edu>2019-04-20 19:06:28 -0400
commit8ddec1c70c01b3d7d919908299e1168b75698dc7 (patch)
tree653353473d8865d8b738dfcdc02f56dda77f9132 /src/new_fields/URLField.ts
parent1eb965a5d9c8aaebf1970bc645edecfb7017b601 (diff)
More refactoring
Diffstat (limited to 'src/new_fields/URLField.ts')
-rw-r--r--src/new_fields/URLField.ts12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/new_fields/URLField.ts b/src/new_fields/URLField.ts
index d27a2b692..e456a7d16 100644
--- a/src/new_fields/URLField.ts
+++ b/src/new_fields/URLField.ts
@@ -1,16 +1,16 @@
import { Deserializable } from "../client/util/SerializationHelper";
-import { serializable } from "serializr";
+import { serializable, custom } from "serializr";
import { ObjectField } from "./Doc";
function url() {
- return {
- serializer: function (value: URL) {
+ return custom(
+ function (value: URL) {
return value.href;
},
- deserializer: function (jsonValue: string, done: (err: any, val: any) => void) {
- done(undefined, new URL(jsonValue));
+ function (jsonValue: string) {
+ return new URL(jsonValue);
}
- };
+ );
}
@Deserializable("url")