Refine the get AST nodes logic.
Refine the get AST nodes logic.

- Use one if-else branch statement.
- Workaround the weak set issue in node.js <= 3.
- It needs a `type` property on AST object.

depcheck/depcheck,depcheck/depcheck