upgrade-data.js 1.6 KB

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