chore(version-bridge): Removed highest-version shortcut, and made the map configurable

Signed-off-by: Gustaf Räntilä <g.rantila@gmail.com>
This commit is contained in:
Gustaf Räntilä
2022-11-09 10:22:42 +01:00
parent e70984325d
commit dc5b8f7b30
2 changed files with 2 additions and 12 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
---
'@backstage/version-bridge': minor
'@backstage/version-bridge': patch
---
Debuggable/inspectable versioned values
@@ -41,18 +41,8 @@ export function createVersionedValueMap<
return versions[version];
},
};
Object.defineProperty(versionedValue, '$value', {
configurable: false,
enumerable: true,
get() {
const highest = Object.keys(versions)
.map(v => parseInt(v, 10))
.sort((a, b) => b - a)[0];
return versions[highest];
},
});
Object.defineProperty(versionedValue, '$map', {
configurable: false,
configurable: true,
enumerable: true,
get() {
return versions;