* Asserts that the node is of the given type and returns it with stricter * typing. Throws if the node's type does not match.
(node, family)
| 6039 | */ |
| 6040 | |
| 6041 | function assertAtomFamily(node, family) { |
| 6042 | var typedNode = checkAtomFamily(node, family); |
| 6043 | |
| 6044 | if (!typedNode) { |
| 6045 | throw new Error("Expected node of type \"atom\" and family \"" + family + "\", but got " + (node ? node.type === "atom" ? "atom of family " + node.family : "node of type " + node.type : String(node))); |
| 6046 | } |
| 6047 | |
| 6048 | return typedNode; |
| 6049 | } |
| 6050 | /** |
| 6051 | * Returns the node more strictly typed iff it is of the given type. Otherwise, |
| 6052 | * returns null. |
no test coverage detected