babel-plugin-gjs
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -7,6 +7,2 @@ "use strict"; | ||
require("core-js/modules/es.object.get-own-property-descriptors"); | ||
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); | ||
var _lodash = _interopRequireDefault(require("lodash")); | ||
@@ -16,6 +12,2 @@ | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } | ||
const options = {}; | ||
@@ -31,4 +23,6 @@ | ||
if (path.parent.type !== 'CallExpression' || ((_path$parent$callee = path.parent.callee) === null || _path$parent$callee === void 0 ? void 0 : (_path$parent$callee$p = _path$parent$callee.property) === null || _path$parent$callee$p === void 0 ? void 0 : _path$parent$callee$p.name) !== 'registerClass') { | ||
node.declarations[0].init.arguments.push(_objectSpread({}, path.node)); | ||
path.replaceWith(node); | ||
const identifier = path.scope.generateUidIdentifier(path.node.id.name); | ||
node.declarations[0].init.arguments.push(identifier); | ||
path.node.id.name = identifier.name; | ||
path.insertAfter(node); | ||
path.traverse({ | ||
@@ -35,0 +29,0 @@ ClassMethod(path) { |
{ | ||
"name": "babel-plugin-gjs", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "babel plugin for gjs", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
7993
62