our-own-type-system
                                
                                 our-own-type-system copied to clipboard
                                
                                    our-own-type-system copied to clipboard
                            
                            
                            
                        Basic JavaScript type checker, in 100 lines.
Our own type system
A compiler which checks types for 3 scenarios:
- Issue with un-compatible types on declaration and expression
fn("craig-string"); // throw with string vs number
function fn(a: number) {}
- Issue with unknown type on declaration and expression
fn("craig-string"); // throw with string vs ?
function fn(a: made_up_type) {} // throw with bad type
- Issue with property name
interface Person {
  name: string;
}
fn({ nam: "craig" }); // throw with "nam" vs "name"
function fn(a: Person) {}