UNPKG

babel-core

Version:

Turn ES6 code into readable vanilla ES5 with source maps

22 lines (17 loc) 526 B
"use strict"; var nameMethod = require("../../helpers/name-method"); var t = require("../../../types"); var clone = require("lodash/lang/clone"); exports.check = function (node) { return t.isProperty(node) && (node.method || node.shorthand); }; exports.Property = function (node, parent, scope, file) { if (node.method) { node.method = false; nameMethod.property(node, file, scope); } if (node.shorthand) { node.shorthand = false; node.key = t.removeComments(clone(node.key)); } };