The module exposes a single function which takes an AST node object and an optional second parameter specifying the type of the node:
"program". If the node type is omitted, it is presumed to be a top-level
"Program" node. The function will return true if the AST is valid, or throw an error otherwise, with a message detailing where the invalid node was found.