upgrade-data.js 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. "use strict";
  2. /**
  3. * Use of this source code is governed by an MIT-style license that can be
  4. * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
  5. */
  6. Object.defineProperty(exports, "__esModule", { value: true });
  7. exports.nzUpgradeData = void 0;
  8. exports.getVersionUpgradeData = getVersionUpgradeData;
  9. const schematics_1 = require("@angular/cdk/schematics");
  10. const data_1 = require("./data");
  11. /** Upgrade data that will be used for the NG-ZORRO ng-update schematic. */
  12. exports.nzUpgradeData = {
  13. attributeSelectors: data_1.attributeSelectors,
  14. classNames: data_1.classNames,
  15. constructorChecks: data_1.constructorChecks,
  16. cssSelectors: data_1.cssSelectors,
  17. cssTokens: data_1.cssTokens,
  18. elementSelectors: data_1.elementSelectors,
  19. inputNames: data_1.inputNames,
  20. methodCallChecks: data_1.methodCallChecks,
  21. outputNames: data_1.outputNames,
  22. propertyNames: data_1.propertyNames,
  23. symbolRemoval: data_1.symbolRemoval,
  24. importSpecifiers: data_1.importSpecifiers
  25. };
  26. /**
  27. * Gets the reduced upgrade data for the specified data key. The function reads out the
  28. * target version and upgrade data object from the migration and resolves the specified
  29. * data portion that is specifically tied to the target version.
  30. */
  31. function getVersionUpgradeData(migration, dataName) {
  32. if (migration.targetVersion === null) {
  33. return [];
  34. }
  35. // Note that below we need to cast to `unknown` first TS doesn't infer the type of T correctly.
  36. return (0, schematics_1.getChangesForTarget)(migration.targetVersion, migration.upgradeData[dataName]);
  37. }
  38. //# sourceMappingURL=upgrade-data.js.map