diff options
| author | Stanley Yip <33562077+yipstanley@users.noreply.github.com> | 2019-07-17 14:56:45 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-07-17 14:56:45 +0000 |
| commit | 253813f3ed75c5bbc08f32a1e822ff922bfe185b (patch) | |
| tree | 78cb59565eb78955e089a11d96011da79e0c81c7 /src/new_fields | |
| parent | cfc5a68c1d93f937ada7ba905265b159ec8be2a9 (diff) | |
| parent | ba25d48d52f6db6021f5149e39021f651af22317 (diff) | |
Merge branch 'master' into small_fix_0716
Diffstat (limited to 'src/new_fields')
| -rw-r--r-- | src/new_fields/Doc.ts | 2 | ||||
| -rw-r--r-- | src/new_fields/Schema.ts | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/src/new_fields/Doc.ts b/src/new_fields/Doc.ts index 0d9fa540f..1dd721396 100644 --- a/src/new_fields/Doc.ts +++ b/src/new_fields/Doc.ts @@ -371,6 +371,8 @@ export namespace Doc { copy[key] = field; } else if (field instanceof ObjectField) { copy[key] = ObjectField.MakeCopy(field); + } else if (field instanceof Promise) { + field.then(f => (copy[key] === undefined) && (copy[key] = f)); //TODO what should we do here? } else { copy[key] = field; } diff --git a/src/new_fields/Schema.ts b/src/new_fields/Schema.ts index 2355304d5..b1a449e08 100644 --- a/src/new_fields/Schema.ts +++ b/src/new_fields/Schema.ts @@ -104,7 +104,7 @@ export function makeStrictInterface<T extends Interface>(schema: T): (doc: Doc) } export function createSchema<T extends Interface>(schema: T): T & { proto: ToConstructor<Doc> } { - schema.proto = Doc; + (schema as any).proto = Doc; return schema as any; } |
