code: function typeFactory(test) {
    return type
  
    function type(node) {
      return Boolean(node && node.type === test)
    }
  }
docs: Utility to convert a string into a function which checks a given node’s type for said string.