aboutsummaryrefslogtreecommitdiff
path: root/src/new_fields/Schema.ts
diff options
context:
space:
mode:
authorAndy Rickert <andrew_rickert@brown.edu>2020-04-02 17:42:18 -0700
committerAndy Rickert <andrew_rickert@brown.edu>2020-04-02 17:42:18 -0700
commitfb329b1a8abca361d831c7ec1f1a9ea0f3d410cf (patch)
treee09138a0544fe3814b1bd1e95d59bc4c0e96f5ed /src/new_fields/Schema.ts
parent3a1dac48c00dbe81142da90f8b52bfae02ce1921 (diff)
parentb4958eac84339dd7a88c964a9c52e89481048f55 (diff)
merge
Diffstat (limited to 'src/new_fields/Schema.ts')
-rw-r--r--src/new_fields/Schema.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/new_fields/Schema.ts b/src/new_fields/Schema.ts
index 3f0ff4284..72bce283d 100644
--- a/src/new_fields/Schema.ts
+++ b/src/new_fields/Schema.ts
@@ -33,7 +33,7 @@ export function makeInterface<T extends Interface[]>(...schemas: T): InterfaceFu
get(target: any, prop, receiver) {
const field = receiver.doc[prop];
if (prop in schema) {
- const desc = (schema as any)[prop];
+ const desc = prop === "proto" ? Doc : (schema as any)[prop]; // bcz: proto doesn't appear in schemas ... maybe it should?
if (typeof desc === "object" && "defaultVal" in desc && "type" in desc) {//defaultSpec
return Cast(field, desc.type, desc.defaultVal);
} else if (typeof desc === "function" && !ObjectField.isPrototypeOf(desc) && !RefField.isPrototypeOf(desc)) {