This repository has been archived on 2020-11-02. You can view files and clone it, but cannot push or open issues or pull requests.
2020-11-01 22:46:04 +00:00

21 lines
398 B
JavaScript

'use strict'
module.exports = one
function one(node, parent) {
var self = this
var visitors = self.visitors
// Fail on unknown nodes.
if (typeof visitors[node.type] !== 'function') {
self.file.fail(
new Error(
'Missing compiler for node of type `' + node.type + '`: `' + node + '`'
),
node
)
}
return visitors[node.type].call(self, node, parent)
}