版博士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.

пре 1 година
1234567891011121314151617
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.generateLegacyCode = void 0;
  4. const shared_1 = require("@intlify/shared");
  5. function generateLegacyCode({ isGlobal }, generator) {
  6. // prettier-ignore
  7. const componentNamespace = `Component.options`;
  8. const variableName = !isGlobal ? '__i18n' : '__i18nGlobal';
  9. const exportSyntax = 'export default';
  10. const code = `${exportSyntax} function (Component) {
  11. ${componentNamespace}.${variableName} = ${componentNamespace}.${variableName} || []
  12. ${componentNamespace}.${variableName}.push(${(0, shared_1.friendlyJSONstringify)(generator())})
  13. delete ${componentNamespace}._Ctor
  14. }`;
  15. return code;
  16. }
  17. exports.generateLegacyCode = generateLegacyCode;