版博士V2.0程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

chunk-JRF6VJCB.js 927 B

12345678910111213141516171819202122232425262728293031323334353637
  1. "use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/core/index.ts
  2. var _common = require('@vue-macros/common');
  3. function transformDefineProps(code, id) {
  4. if (!code.includes(_common.DEFINE_PROPS_DOLLAR))
  5. return;
  6. const { scriptSetup, getSetupAst } = _common.parseSFC.call(void 0, code, id);
  7. if (!scriptSetup)
  8. return;
  9. const offset = scriptSetup.loc.start.offset;
  10. const s = new (0, _common.MagicString)(code);
  11. const setupAst = getSetupAst();
  12. _common.walkAST.call(void 0, setupAst, {
  13. enter(node) {
  14. if (_common.isCallOf.call(void 0, node, _common.DEFINE_PROPS_DOLLAR)) {
  15. s.overwriteNode(
  16. node.callee,
  17. // add space for fixing mapping
  18. ` ${_common.DEFINE_PROPS}`,
  19. { offset }
  20. );
  21. }
  22. }
  23. });
  24. return _common.getTransformResult.call(void 0, s, id);
  25. }
  26. exports.transformDefineProps = transformDefineProps;