babel/lib/6to5/helpers/normalize-ast.js
2015-02-05 14:05:15 +11:00

10 lines
234 B
JavaScript

var t = require("../types");
module.exports = function (ast, comments, tokens) {
if (ast && ast.type === "Program") {
return t.file(ast, comments || [], tokens || []);
} else {
throw new Error("Not a valid ast?");
}
};