Sha256: d3b785b12679fa832894d75b86bd32b36e78026517d6cce00629d677a70f9138

Contents?: true

Size: 745 Bytes

Versions: 69

Compression:

Stored size: 745 Bytes

Contents

"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = toBlock;

var _generated = require("../validators/generated");

var _generated2 = require("../builders/generated");

function toBlock(node, parent) {
  if ((0, _generated.isBlockStatement)(node)) {
    return node;
  }

  let blockNodes = [];

  if ((0, _generated.isEmptyStatement)(node)) {
    blockNodes = [];
  } else {
    if (!(0, _generated.isStatement)(node)) {
      if ((0, _generated.isFunction)(parent)) {
        node = (0, _generated2.returnStatement)(node);
      } else {
        node = (0, _generated2.expressionStatement)(node);
      }
    }

    blockNodes = [node];
  }

  return (0, _generated2.blockStatement)(blockNodes);
}

Version data entries

69 entries across 61 versions & 12 rubygems

Version Path
optimacms-0.1.61 spec/dummy/node_modules/@babel/types/lib/converters/toBlock.js
disco_app-0.18.0 test/dummy/node_modules/@babel/types/lib/converters/toBlock.js
disco_app-0.18.2 test/dummy/node_modules/@babel/types/lib/converters/toBlock.js
trusty-cms-5.0.7 node_modules/@babel/types/lib/converters/toBlock.js
trusty-cms-5.0.6 node_modules/@babel/types/lib/converters/toBlock.js
trusty-cms-5.0.5 node_modules/@babel/types/lib/converters/toBlock.js
trusty-cms-5.0.4 node_modules/@babel/types/lib/converters/toBlock.js
disco_app-0.16.1 test/dummy/node_modules/@babel/preset-modules/node_modules/@babel/types/lib/converters/toBlock.js
disco_app-0.16.1 test/dummy/node_modules/@babel/types/lib/converters/toBlock.js
disco_app-0.15.2 test/dummy/node_modules/@babel/preset-modules/node_modules/@babel/types/lib/converters/toBlock.js
disco_app-0.15.2 test/dummy/node_modules/@babel/types/lib/converters/toBlock.js
trusty-cms-5.0.3 node_modules/@babel/types/lib/converters/toBlock.js
trusty-cms-5.0.2 node_modules/@babel/types/lib/converters/toBlock.js
disco_app-0.18.4 test/dummy/node_modules/@babel/preset-modules/node_modules/@babel/types/lib/converters/toBlock.js
disco_app-0.18.4 test/dummy/node_modules/@babel/types/lib/converters/toBlock.js
disco_app-0.18.1 test/dummy/node_modules/@babel/types/lib/converters/toBlock.js
disco_app-0.18.1 test/dummy/node_modules/@babel/preset-modules/node_modules/@babel/types/lib/converters/toBlock.js
disco_app-0.12.7.pre.puma.pre.3 test/dummy/node_modules/@babel/preset-modules/node_modules/@babel/types/lib/converters/toBlock.js
disco_app-0.12.7.pre.puma.pre.3 test/dummy/node_modules/@babel/types/lib/converters/toBlock.js
disco_app-0.14.0 test/dummy/node_modules/@babel/preset-modules/node_modules/@babel/types/lib/converters/toBlock.js