UNPKG

babel-plugin-transform-me-module

Version:

Transform me.js module to commonjs module

20 lines (12 loc) 922 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isEvalFunctionCall = exports.isReadyFunctionCall = exports.isProvideFunctionCall = void 0; var _lodash = require("lodash"); const isProvideFunctionCall = node => (0, _lodash.get)(node, 'callee.property.name') === 'provide' && ((0, _lodash.get)(node, 'callee.object.callee.object.name') === 'me' || (0, _lodash.get)(node, 'callee.object.name') === 'me'); exports.isProvideFunctionCall = isProvideFunctionCall; const isReadyFunctionCall = node => (0, _lodash.get)(node, 'callee.property.name') === 'ready' && (0, _lodash.get)(node, 'callee.object.name') === 'exports'; exports.isReadyFunctionCall = isReadyFunctionCall; const isEvalFunctionCall = node => (0, _lodash.get)(node, 'callee.name') === 'eval' && (0, _lodash.get)(node, 'arguments.0.callee.property.name') === 'extract'; exports.isEvalFunctionCall = isEvalFunctionCall;