Say I have some interface:

```
export interface MyDocument {
    id: string,
    collection: string[];
}

```

I then create a new (well cast an existing to that type):

`const workingDocument = <MyDocument>document;`

And finally, I have this if statement block to check whether it actually contains everything I have specified in that interface:

```
if (!workingDocument.id) {
   throw new Error("Document missing `id`");
} else if (!workingDocument.collection) {
   throw new Error("Document missing `collection` array");
}

```

However I don't seem to like this as that if statement could grow forever and not very good to maintain.

Is there a better way?

Thanks.