Sha256: 04f78c7066ec73f2703c548546be3f2981638b789138ccb5ff4aea204712c6e9

Contents?: true

Size: 617 Bytes

Versions: 2

Compression:

Stored size: 617 Bytes

Contents

"use strict";

var _interopRequireWildcard = require("babel-runtime/helpers/interop-require-wildcard")["default"];

exports.__esModule = true;

var _babelTypes = require("babel-types");

var t = _interopRequireWildcard(_babelTypes);

/**
 * Normalize an AST.
 *
 * - Wrap `Program` node with a `File` node.
 */

exports["default"] = function (ast, comments, tokens) {
  if (ast) {
    if (ast.type === "Program") {
      return t.file(ast, comments || [], tokens || []);
    } else if (ast.type === "File") {
      return ast;
    }
  }

  throw new Error("Not a valid ast?");
};

module.exports = exports["default"];

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
babel-schmooze-sprockets-0.1.0.alpha.3 node_modules/babel-core/lib/helpers/normalize-ast.js
babel-schmooze-sprockets-0.1.0.alpha.2 node_modules/babel-core/lib/helpers/normalize-ast.js