Typescript bypass return type error

JS
S
JavaScript

Ability to over power TS and ignore specific errors. Collection of tricks

1/* ByPass Trick #1
2Error: insuranceSchema can only be assigned to Schema. Item.schema returns void.
3Bypass: cast to any
4*/
5const insuranceSchema: Schema = Item.schema.add({
6    requiresInsurance: {
7        type: Boolean,
8        default: true
9    }
10}) as any;   

Created on 1/20/2018