Sha256: 99ec9068dc309773b3574d71da4d72de4b49cf7ac629239a0a6aa4c040551973

Contents?: true

Size: 913 Bytes

Versions: 13

Compression:

Stored size: 913 Bytes

Contents

"use strict";

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

var _helperPluginUtils = require("@babel/helper-plugin-utils");

var _core = require("@babel/core");

var _default = (0, _helperPluginUtils.declare)(api => {
  api.assertVersion(7);
  return {
    name: "transform-shorthand-properties",
    visitor: {
      ObjectMethod(path) {
        const {
          node
        } = path;

        if (node.kind === "method") {
          const func = _core.types.functionExpression(null, node.params, node.body, node.generator, node.async);

          func.returnType = node.returnType;
          path.replaceWith(_core.types.objectProperty(node.key, func, node.computed));
        }
      },

      ObjectProperty({
        node
      }) {
        if (node.shorthand) {
          node.shorthand = false;
        }
      }

    }
  };
});

exports.default = _default;

Version data entries

13 entries across 13 versions & 4 rubygems

Version Path
optimacms-0.1.61 spec/dummy/node_modules/@babel/plugin-transform-shorthand-properties/lib/index.js
tang-0.2.1 spec/tang_app/node_modules/@babel/plugin-transform-shorthand-properties/lib/index.js
tang-0.2.0 spec/tang_app/node_modules/@babel/plugin-transform-shorthand-properties/lib/index.js
tang-0.1.0 spec/tang_app/node_modules/@babel/plugin-transform-shorthand-properties/lib/index.js
tang-0.0.9 spec/tang_app/node_modules/@babel/plugin-transform-shorthand-properties/lib/index.js
enju_library-0.3.8 spec/dummy/node_modules/@babel/plugin-transform-shorthand-properties/lib/index.js
condenser-0.3 lib/condenser/processors/node_modules/@babel/plugin-transform-shorthand-properties/lib/index.js
condenser-0.2 lib/condenser/processors/node_modules/@babel/plugin-transform-shorthand-properties/lib/index.js
condenser-0.1 lib/condenser/processors/node_modules/@babel/plugin-transform-shorthand-properties/lib/index.js
condenser-0.0.12 lib/condenser/processors/node_modules/@babel/plugin-transform-shorthand-properties/lib/index.js
condenser-0.0.11 lib/condenser/processors/node_modules/@babel/plugin-transform-shorthand-properties/lib/index.js
condenser-0.0.10 lib/condenser/processors/node_modules/@babel/plugin-transform-shorthand-properties/lib/index.js
condenser-0.0.9 lib/condenser/processors/node_modules/@babel/plugin-transform-shorthand-properties/lib/index.js