aboutsummaryrefslogtreecommitdiff
path: root/src/new_fields/URLField.ts
diff options
context:
space:
mode:
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")